Valid PI tag names

Discussion in 'XML' started by Spacen Jasset, Jan 20, 2005.

  1. I am thinking of using XML PI tags to convey some preprocessing
    instructions to a pre-processor before passing the xml to an xmlparser
    in an external library.

    Something likethis

    <?pi?>

    I've read the xml specification and it seems to allow colons in the PI
    name like namespaces, thus:

    <?pi:test?>

    However, internet exporer complains the document isn't valid. So
    presumably it's not and there is some footnote to this affect somewhere?
    Spacen Jasset, Jan 20, 2005
    #1
    1. Advertising

  2. Spacen Jasset wrote:


    > I've read the xml specification and it seems to allow colons in the PI
    > name like namespaces, thus:
    >
    > <?pi:test?>
    >
    > However, internet exporer complains the document isn't valid. So
    > presumably it's not and there is some footnote to this affect somewhere?


    Yes, XML 1.0 doesn't know about namespaces, a second recommendation
    covers that and it says in here
    <http://www.w3.org/TR/REC-xml-names/#Conformance>

    "No entity names, PI targets, or notation names contain any colons."

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Jan 20, 2005
    #2
    1. Advertising

  3. In article <>,
    Spacen Jasset <> wrote:

    >I've read the xml specification and it seems to allow colons in the PI
    >name like namespaces, thus:
    >
    ><?pi:test?>
    >
    >However, internet exporer complains the document isn't valid. So
    >presumably it's not and there is some footnote to this affect somewhere?


    It's legal XML, but most tools expect conformance to other standards
    too, in particular the XML Namespaces specification. This uses colons
    for its own purposes, and does not allow them in PI names, so it would
    be very unwise to use them. You can still use hyphens and underscores.

    -- Richard
    Richard Tobin, Jan 20, 2005
    #3
    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. shruds
    Replies:
    1
    Views:
    747
    John C. Bollinger
    Jan 27, 2006
  2. Bob
    Replies:
    13
    Views:
    2,943
    Toby A Inkster
    Dec 26, 2003
  3. Jukka K. Korpela
    Replies:
    3
    Views:
    761
    Michael Winter
    Mar 6, 2004
  4. Michael Winter
    Replies:
    4
    Views:
    575
    Lasse Reichstein Nielsen
    Mar 6, 2004
  5. DU
    Replies:
    0
    Views:
    4,011
Loading...

Share This Page