Newbie quesiton.

J

JustSomeGuy

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

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

JustSomeGuy

Bjoern Hoehrmann said:
* 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?
Is there something special about the '?' character in xml?
ie is this legal?

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

Bjoern Hoehrmann

* JustSomeGuy wrote in comp.text.xml:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top