Home All Groups Group Topic Archive Search About

About xml:space="preserve"

Author
24 Jul 2006 1:55 PM
Lloyd Dupont
I am "defining" an XML schema.
In fact I'm not really writing any schema but I am writing an XML writer and
reader for my data.
It's all custom XML and I would like it to be XML tool friendly.

I will have an element, lets call it <text/> which will be in the document
in great quantity and it should always have:
xml:space="preserve"
on.

Now, for the sake of clarity and being compact, I would like to omit this
declaration on every <text> tag, but somehow let it be know (without
downloading the unexistant so far XMLNS file).

How do I do that?

Author
24 Jul 2006 2:07 PM
Martin Honnen
Lloyd Dupont wrote:

> I am "defining" an XML schema.
> In fact I'm not really writing any schema but I am writing an XML writer and
> reader for my data.
> It's all custom XML and I would like it to be XML tool friendly.
>
> I will have an element, lets call it <text/> which will be in the document
> in great quantity and it should always have:
> xml:space="preserve"
> on.
>
> Now, for the sake of clarity and being compact, I would like to omit this
> declaration on every <text> tag, but somehow let it be know (without
> downloading the unexistant so far XMLNS file).

You would need a schema or DTD that defines that attribute value as
fixed for that text element. Then you need to make sure the XML
parser(s) used to process the XML support schema or DTD processing and
have it enabled when the XML is parsed (for instance with .NET 2.0 DTD
processing is disabled by default).

--

    Martin Honnen --- MVP XML
    http://JavaScript.FAQTs.com/
Author
25 Jul 2006 12:32 AM
Lloyd Dupont
Thanks Martin!
That's all clear now!

--
Regards,
Lloyd Dupont

NovaMind development team
NovaMind Software
Mind Mapping Software
<www.nova-mind.com>
Show quote
"Martin Honnen" <mahotr***@yahoo.de> wrote in message
news:u%234pBqyrGHA.2464@TK2MSFTNGP03.phx.gbl...
>
>
> Lloyd Dupont wrote:
>
>> I am "defining" an XML schema.
>> In fact I'm not really writing any schema but I am writing an XML writer
>> and reader for my data.
>> It's all custom XML and I would like it to be XML tool friendly.
>>
>> I will have an element, lets call it <text/> which will be in the
>> document in great quantity and it should always have:
>> xml:space="preserve"
>> on.
>>
>> Now, for the sake of clarity and being compact, I would like to omit this
>> declaration on every <text> tag, but somehow let it be know (without
>> downloading the unexistant so far XMLNS file).
>
> You would need a schema or DTD that defines that attribute value as fixed
> for that text element. Then you need to make sure the XML parser(s) used
> to process the XML support schema or DTD processing and have it enabled
> when the XML is parsed (for instance with .NET 2.0 DTD processing is
> disabled by default).
>
> --
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/

AddThis Social Bookmark Button