another newbie question...

J

JustSomeGuy

Is there a difference between these two xml statments?

<stuff>1</stuff>
vs
<stuff>
1
</stuff>

Is there something in the standard that specifies that the data parsers
should stip leading and trailing white space?
Just curious because i'm using the later of the two examples and it seems
like my xml is being rejected and I was
wondering if it was simply the white space around the '1'.

TIA
 
P

Peter Flynn

JustSomeGuy said:
Is there a difference between these two xml statments?

<stuff>1</stuff>
vs
<stuff>
1
</stuff>

Yes. In the first one, the stuff element contains a single digit 1.
In the second, it contains a linebreak, two spaces, a 1, and another
linebreak.

If you are outputting this to a browser, the leading and trailing
linebreaks and spaces are probably absorbed and disappear. But if
you are doing anything else with it, they remain there and need to
be dealt with by your application.
Is there something in the standard that specifies that the data parsers
should strip leading and trailing white space?

Yes, it specifies that they should NOT strip white-space, but instead
pass it through to the application to deal with.
Just curious because i'm using the later of the two examples and it seems
like my xml is being rejected and I was
wondering if it was simply the white space around the '1'.

Quite possibly, but without knowing details of the application and the
software it's not possible to give an exact answer.

///Peter
 

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,780
Messages
2,569,608
Members
45,241
Latest member
Lisa1997

Latest Threads

Top