Ignoring tags in XML

Discussion in 'XML' started by vincente13@gmail.com, Jun 2, 2006.

  1. Guest

    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?
     
    , Jun 2, 2006
    #1
    1. Advertising

  2. 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
     
    Joe Kesselman, Jun 2, 2006
    #2
    1. Advertising

  3. 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
     
    Joe Kesselman, Jun 2, 2006
    #3
  4. Stan R. Guest

    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
     
    Stan R., Jun 4, 2006
    #4
  5. 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
     
    =?UTF-8?B?SsO8cmdlbiBLYWhycw==?=, Jun 4, 2006
    #5
  6. Stan R. Guest

    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
     
    Stan R., Jun 4, 2006
    #6
  7. 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
     
    Joe Kesselman, Jun 4, 2006
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sandeep
    Replies:
    1
    Views:
    928
    Raymond DeCampo
    Jan 15, 2006
  2. Thierry Lam
    Replies:
    2
    Views:
    393
    Chris
    Sep 6, 2005
  3. Damo_Suzuki
    Replies:
    1
    Views:
    337
    Damo_Suzuki
    Dec 8, 2006
  4. =?ISO-8859-1?Q?Fabian_L=F3pez?=

    ignoring chinese characters parsing xml file

    =?ISO-8859-1?Q?Fabian_L=F3pez?=, Oct 22, 2007, in forum: Python
    Replies:
    3
    Views:
    418
    limodou
    Oct 23, 2007
  5. Abhinav
    Replies:
    0
    Views:
    145
    Abhinav
    Aug 16, 2004
Loading...

Share This Page