Subject: Re: [xsl] stop the processing of default attributes? From: Dan Vint <dvint@xxxxxxxxx> Date: Thu, 18 Aug 2011 17:45:08 -0700 |
On 18/08/2011 23:22, dvint@xxxxxxxxx wrote:that for-each is a verbose way of writing <xsl:copy-of select="@*"/> (apart from some namespace effects)I think I know the answer to this question, but would like to see if I mssied something.
I;m using the following template in my conversion effort. This si teh default handling for any element that I don't have something specific to do on it:
<xsl:template match="*">
<xsl:element name="{name()}">
<xsl:for-each select="@*">
<xsl:attribute name="{name(.)}"><xsl:value-of select="."/></xsl:attribute>
</xsl:for-each>
<xsl:apply-templates/> </xsl:element> </xsl:template>
This works great except for places where the element has some default value in the schema. So instead of getting<refdm> as output, I get:
you'd need to suppress the schema processing, or at least the defaulting. using a basic rather than a schema-aware processor would work, unless you need the schema aware behaviour elsewhere, or you could use a catalog or entity resolver to switch in a schema that didn't default, or your processor might have an option to suppress defaulting (saxon does for example:
-expand:on|off Expand defaults defined in schema/DTD
)
David
-- google plus: https:/profiles.google.com/d.p.carlisle
--------------------------------------------------------------------------- Danny Vint
Panoramic Photography http://www.dvint.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] stop the processing of de, David Carlisle | Thread | Re: [xsl] stop the processing of de, David Carlisle |
Re: [xsl] redirecting ouput to a di, G. Ken Holman | Date | Re: [xsl] redirecting ouput to a di, Dan Vint |
Month |