Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Newbie quesiton.

Reply
Thread Tools

Newbie quesiton.

 
 
JustSomeGuy
Guest
Posts: n/a
 
      12-05-2004
What is the purpose of the ?s in this xml:
<?xml version="1.0"?>

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


 
Reply With Quote
 
 
 
 
Bjoern Hoehrmann
Guest
Posts: n/a
 
      12-05-2004
* 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 · private.php?do=newpm&u= · 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/
 
Reply With Quote
 
 
 
 
JustSomeGuy
Guest
Posts: n/a
 
      12-05-2004

"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 · private.php?do=newpm&u= · 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/



 
Reply With Quote
 
Bjoern Hoehrmann
Guest
Posts: n/a
 
      12-05-2004
* 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 · private.php?do=newpm&u= · 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/
 
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
newbie with newbie questions JohnE ASP .Net 3 08-17-2009 10:10 PM
VONAGE Newbie w/newbie question New_kid@nowhere.new VOIP 0 08-11-2007 01:40 PM
another newbie question from another newbie.... Lee UK VOIP 4 05-17-2005 04:10 PM
newbie: cisco vlan newbie question No Spam Cisco 3 06-07-2004 10:02 AM
Newbie! I'm a newbie! What's wrong with this program? Id0x Python 4 07-20-2003 11:40 PM



Advertisments