Newbie quesiton.

Discussion in 'XML' started by JustSomeGuy, Dec 5, 2004.

  1. JustSomeGuy

    JustSomeGuy Guest

    What is the purpose of the ?s in this xml:
    <?xml version="1.0"?>

    can this be written as:
    <?xml version=\"1.0\"?>
    </?xml>
    JustSomeGuy, Dec 5, 2004
    #1
    1. Advertising

  2. * JustSomeGuy wrote in comp.text.xml:
    >What is the purpose of the ?s in this xml:
    ><?xml version="1.0"?>


    Basically to ensure that this is not confused with e.g.

    <xml version="1.0">

    which would not make much sense.

    >can this be written as:
    ><?xml version=\"1.0\"?>
    ></?xml>


    No. See http://www.w3.org/TR/REC-xml/#NT-XMLDecl for details.
    --
    Björn Höhrmann · mailto: · http://bjoern.hoehrmann.de
    Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
    68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
    Bjoern Hoehrmann, Dec 5, 2004
    #2
    1. Advertising

  3. JustSomeGuy

    JustSomeGuy Guest

    "Bjoern Hoehrmann" <> wrote in message
    news:...
    > * JustSomeGuy wrote in comp.text.xml:
    > >What is the purpose of the ?s in this xml:
    > ><?xml version="1.0"?>

    >
    > Basically to ensure that this is not confused with e.g.
    >
    > <xml version="1.0">
    >
    > which would not make much sense.
    >


    Why wouldn't that make sense?
    Is there something special about the '?' character in xml?
    ie is this legal?

    <?foo v="100"?>
    or
    <?foo v="100">
    </?foo>


    > >can this be written as:
    > ><?xml version=\"1.0\"?>
    > ></?xml>

    >




    > No. See http://www.w3.org/TR/REC-xml/#NT-XMLDecl for details.
    > --
    > Björn Höhrmann · mailto: · http://bjoern.hoehrmann.de
    > Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
    > 68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
    JustSomeGuy, Dec 5, 2004
    #3
  4. * JustSomeGuy wrote in comp.text.xml:
    >> Basically to ensure that this is not confused with e.g.
    >>
    >> <xml version="1.0">
    >>
    >> which would not make much sense.

    >
    >Why wouldn't that make sense?


    People and possibly processors would confuse it with element syntax, for
    example.

    >Is there something special about the '?' character in xml?


    Well, to some extend yes, it is used to construct the XML declaration
    and processing instruction.

    >ie is this legal?
    >
    ><?foo v="100"?>


    Yes, that's a processing instruction, check http://www.w3.org/TR/REC-xml
    to learn more about processing instructions.

    >or
    ><?foo v="100">
    ></?foo>


    That's legal if there is a closing ?> following it.
    --
    Björn Höhrmann · mailto: · http://bjoern.hoehrmann.de
    Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
    68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
    Bjoern Hoehrmann, Dec 5, 2004
    #4
    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. Yamin

    deep copy quesiton

    Yamin, Nov 30, 2004, in forum: Java
    Replies:
    9
    Views:
    606
    charely
    Dec 4, 2004
  2. Hunter
    Replies:
    16
    Views:
    836
    Michael
    Jan 10, 2004
  3. philbo30

    Newbie quesiton: Mix C and C++

    philbo30, Sep 16, 2007, in forum: C Programming
    Replies:
    8
    Views:
    346
    Pierre Asselin
    Sep 17, 2007
  4. Tobias
    Replies:
    1
    Views:
    154
    Tobias
    Jan 21, 2007
  5. DIAMOND Mark R.
    Replies:
    5
    Views:
    112
    DIAMOND Mark R.
    Aug 10, 2004
Loading...

Share This Page