|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] multiple documents, namespaces and the same structure
I have an application that is made up of several small documents that each have a DTD and their own namespace assignments. These documents all work together and are linked via an attribute (href) that has the name of the document file. Within several of these I have a common address structure. Currently, I process each document and address structure vi document() and then use something like commercial:street or alob:street to format these documents. What I want to do is create a standard template that I could pass the whole address structure into and have it format everything. I beleive I'm being hung up on the namespace names. If I take a simple version of the template it would be like this: Here is the call: <xsl:for-each select="//commercial:business/commercial:us.address"> <xsl:call-template name="format.address"> <xsl:with-param name="address.node" select="."/> </xsl:call-template> </xsl:for-each> the template: <xsl:template name="format.address"> <xsl:param name="address.node"/> <xsl:value-of select="$address.node"/> <xsl:value-of select="$address.node/@address.type"/> <xsl:value-of select="$address.node/street"/> </xsl:template> Data looks like: <us.address address.type="street"> <street>222 Kearney St.</street> <street>Suite 500</street> <city>San Francisco</city> <state>CA</state><zip main="94108" sub="1234"/> </us.address> This template will output: 222 Kearney St.Suite 500San FranciscoCA street <<nothing here for the third item>> Any idea on how to set this up? I have other templates that I use generically but I pass in specific values so I don't have the same problem. I suppose I could do that here, but that would require changing every call to this template if a new attribute or element is added to address - workable but not pretty. thanks ..dan XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








