Subject: Re: [xsl] Rebuild an element without copying defaulted attributes? From: "Dan Vint dvint@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Tue, 12 Aug 2014 23:30:22 -0000 |
> I'm looking for a generalized solution so I didn't have to search > the DTD for all defaulted vaules. I just happened to catch > xml:space as I had a different problem that I fixed.
Remember that in XML there is no difference between the defaulted value of the attribute set through the DTD and the same value set explicitly. Also, unless you copy the same DTD to the output, you would lose this default value if you remove it as in the examples shown, which is why the attribute with default value is considered to be present on the <pre> and other elements on which it is defined.
Removing it the way you did, and similar for any other defaults, may alter the way the XML is rendered or interpreted, unless you recreate the same defaults through a DTD. If that is intentional (i.e., if you indeed want to remove any attribute that has a default value), straight XSLT may not be the ideal solution, because this DTD information is not annotated / retained on the nodes, either during processing or in the result.
For automated processing, XML with the explicit or implicit default attribute is the same.
Cheers,
Abel Braaksma Exselt streaming XSLT 3.0 processor http://exselt.net
--------------------------------------------------------------------------- Danny Vint
Panoramic Photography http://www.dvint.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Rebuild an element withou, Abel Braaksma (Exsel | Thread | Re: [xsl] Rebuild an element withou, Eliot Kimber ekimber |
Re: [xsl] Pattern notation for prec, Graydon graydon@xxxx | Date | Re: [xsl] Pattern notation for prec, Abel Braaksma (Exsel |
Month |