W3C home > Mailing lists > Public > xproc-dev@w3.org > November 2011

RE: Prevent expansion of defaulted attributes

From: Geert Josten <geert.josten@dayon.nl>
Date: Mon, 7 Nov 2011 13:49:27 +0100
Message-ID: <e334efee7ae6f5b0dce831b7655289d8@mail.gmail.com>
To: Alex Milowski <alex@milowski.org>, xproc-dev@w3c.org
Not as elegant, but easier solution: replace the physical DTD with one
that only contains the entity declarations. Post-processing requires

Kind regards,

-----Oorspronkelijk bericht-----
Van: alex@milowski.com [mailto:alex@milowski.com] Namens Alex Milowski
Verzonden: vrijdag 4 november 2011 19:27
Aan: xproc-dev@w3c.org
Onderwerp: Re: Prevent expansion of defaulted attributes

On Thu, Nov 3, 2011 at 3:28 AM, Peet Kester <peetkes@gmail.com> wrote:
> Hi list,
> how can I prevent the expansion of defaulted attributes when I do an
identity step in xproc?
> I have xml files which need to be processed and when I process the xml
files I see that the defaulted attributes are expanded in the output.
> My xml files have a doctype definition pointing to a specific dtd with
the defaulted attributes.

That's the normal behavior for XML.  The parser is providing those
attribute values to Calabash per the XML recommendation.  While the
XML Infoset [1] preserves this information via the [specified] flag,
the XDM [2] does not.  As Calabash uses the XDM internally, the
serializer can't do much about it.

If you don't want them in the output, you'll need to add a step before
serialization that removed the defaulted values.

[1] http://www.w3.org/TR/xml-infoset/
[2] http://www.w3.org/TR/xpath-datamodel/#infoset-mapping-attribute

--Alex Milowski
"The excellence of grammar as a guide is proportional to the paucity of
inflexions, i.e. to the degree of analysis effected by the language

Bertrand Russell in a footnote of Principles of Mathematics
Received on Monday, 7 November 2011 12:49:59 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:17:01 UTC