RE: Prevent expansion of defaulted attributes

Not as elegant, but easier solution: replace the physical DTD with one
that only contains the entity declarations. Post-processing requires
DTD-awareness..

Kind regards,
Geert

-----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
the
inflexions, i.e. to the degree of analysis effected by the language
considered."

Bertrand Russell in a footnote of Principles of Mathematics

Received on Monday, 7 November 2011 12:49:59 UTC