xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas B. Passin" <tpas...@mitretek.org>
Subject Re: Leaving elements with values open
Date Wed, 18 Apr 2001 14:56:17 GMT
It depends on the content model and whether you are validating or not.  If
you are not validating, the whitespace is part of the content and is
significant.  There's no way for the parser to know if you meant something
else.

If your content model allows mixed content, the linefeed is still
significant since PCDATA includes whitespace.  If your model does not allow
mixed content, then the example is invalid.

If your model requires element-only content, whitespace between elements
isn't significant.  Of course, your example wouldn't be valid, either.

Cheers,

Tom P

<jenny.bourke@nl.ibm.com> asked
>
>
> The question is, is it okay to leave an element that contains a value,
> open, to be closed a few lines later?   ie does the value now contain a
new
> line character or is this new line considered to be whitespace which is
> ignored by XML parsers.
>
> example:
>
> <HW_UPGRADES>
> <HU_FROM_MODEL>250
> <HU_TO_MODEL>270</HU_TO_MODEL>
> <HU_TO_MODEL>280</HU_TO_MODEL>
> </HU_FROM_MODEL>
> </HW_UPGRADES>
>



---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Mime
View raw message