xsl-list
[Top] [All Lists]

Re: Maintenance XSL/XML default template. Was: Another XSL Stru cture/Template Problem...

2003-07-31 05:25:24
Hi

Citando "Zink, Juergen" <Juergen(_dot_)Zink(_at_)wuerttembergische(_dot_)de>:

} Hi,
} 
} just consider the following case:
} 3 months later someone wants a new functionality and
} adds a new tag XYZ to the DTD and to the XML.
} What happens in this case for the xsl?
} 
} > ==>HERE             <xsl:apply-templates select="*"/>
} > <xsl:template match="HSDocumentation"/>
} In this case the default template would match the tag XYZ.
} 
} > <xsl:apply-templates select="HSString|HSDate|..."/>
} In this case nothing happens to the output. The tag XYZ is ignored.
} 
} Or <xsl:apply-templates select="*[not(self::HSDocumentation)]"/>
} In this case the default template would match the tag XYZ.
} 
} I prefer the case which the new tag XYZ will be ignored.
} 

Point taken, and if you want to deal with the new tag XYZ you simply add it to 
the 
select.

I just add the latest because in your first example to deal with 
HSDocumentation you'll 
have to use modes because every HSDocumentation, no matter where it might be, 
will be 
ignore. the latest just didn't select it, but if you select it elsewhere it 
will be 
normaly processed. You have three methods to use, the best one depends on what 
you what 
to do and on how is your xml defined.

Regards,
Americo Albuquerque
___________________________________________________________________

O SAPO já está livre de vírus com a Panda Software, fique você também!
Clique em: http://antivirus.sapo.pt


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>