Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Ignoring tags in XML

Reply
Thread Tools

Ignoring tags in XML

 
 
vincente13@gmail.com
Guest
Posts: n/a
 
      06-02-2006
Lets say i have a XML element

<command>
system(" $opt = <STDIN> ")
</command>


in my program i actually used the whole string given between <command>
tags to execute the command.

however putting <STDIN> is not allowed in XML..is there any other
alternatives?

 
Reply With Quote
 
 
 
 
Joe Kesselman
Guest
Posts: n/a
 
      06-02-2006
wrote:
> <command>system(" $opt = <STDIN> ")</command>
>
> however putting <STDIN> is not allowed in XML..is there any other
> alternatives?


Use &lt; and &gt;, which are the standard XML representations for the <
and > characters. (Or, of course, you can use numeric character
references, < and > respectively.) If you read the file through
any of the standard XML tools, those will be converted to the angle
brackets automagically as part of the parsing process.


--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
 
Reply With Quote
 
 
 
 
Joe Kesselman
Guest
Posts: n/a
 
      06-02-2006
Sorry, I should have said "use &lt; etcetera in text content". That is,

<command>system(" $opt = &lt;STDIN&gt; ")</command>

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
 
Reply With Quote
 
Stan R.
Guest
Posts: n/a
 
      06-04-2006
Joe Kesselman wrote:
> wrote:
>> <command>system(" $opt = <STDIN> ")</command>
>>
>> however putting <STDIN> is not allowed in XML..is there any other
>> alternatives?

>
> Use &lt; and &gt;, which are the standard XML representations for the
> < and > characters. (Or, of course, you can use numeric character
> references, < and > respectively.) If you read the file


> through any of the standard XML tools, those will be converted to the
> angle brackets automagically as part of the parsing process.


Could you please tell what the standard XML tools are (name) ? I am
particularly interested in have a "standard" commandline tools for
parsing and validating xml (and html/sgml as a bonus) on my linux
system, and also win32 wouldn't hurt, as I'm frequently using both. I
say command line because I can configure my editor to use it for
checking (it lets me set a path for any validators, compilers, parsers,
etc. Would be great if I could just check HTML and XML documents on the
fly like I can with, say, Perl or c.)

The reason I'm asking is doing a google search on google for XML parser
gave me many useless results, and it's rather hard to tell which one
realy does things right (conforming to standards.)

Thanks.

--
Stan


 
Reply With Quote
 
=?UTF-8?B?SsO8cmdlbiBLYWhycw==?=
Guest
Posts: n/a
 
      06-04-2006
Stan R. wrote:

> Could you please tell what the standard XML tools are (name) ? I am
> particularly interested in have a "standard" commandline tools for
> parsing and validating xml (and html/sgml as a bonus) on my linux
> system, and also win32 wouldn't hurt, as I'm frequently using both. I


http://xmlsoft.org/xmllint.html
 
Reply With Quote
 
Stan R.
Guest
Posts: n/a
 
      06-04-2006
Jürgen Kahrs wrote:
> Stan R. wrote:
>
>> Could you please tell what the standard XML tools are (name) ? I am
>> particularly interested in have a "standard" commandline tools for
>> parsing and validating xml (and html/sgml as a bonus) on my linux
>> system, and also win32 wouldn't hurt, as I'm frequently using both. I

>
> http://xmlsoft.org/xmllint.html


Thank you

--
Stan



Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
 
Reply With Quote
 
Joe Kesselman
Guest
Posts: n/a
 
      06-04-2006
Stan R. wrote:
> Could you please tell what the standard XML tools are (name) ?


Any SAX or DOM parser. XSLT. Anything else built around the XML
specifications.

> particularly interested in have a "standard" commandline tools for
> parsing and validating xml (and html/sgml as a bonus) on my linux
> system, and also win32 wouldn't hurt, as I'm frequently using both.


I generally use Apache Xerces as my parser, unless I've got a Good
Reason for doing something different. Your milage may vary.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ignoring chinese characters parsing xml file =?ISO-8859-1?Q?Fabian_L=F3pez?= Python 3 10-23-2007 07:20 AM
Ignoring tags when extracting data from xhtml Damo_Suzuki Java 1 12-08-2006 01:37 AM
Ignoring spaces, tabs and line in XML DOM parsing Sandeep Java 1 01-15-2006 06:56 PM
Ignoring ampersand(&) as a special character in xml Thierry Lam Python 2 09-06-2005 07:58 PM
XML::Xerces : Schema for ignoring unknown tags ? Abhinav Perl Misc 0 08-16-2004 06:05 PM



Advertisments