|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Small Report XSL/XPATH Template Help
i am trying to make a small report formatting template that i can reuse via xsl:import's and i am having a problem getting started.
I know how to write formatting logic with templates where the XML placement isnt needed or relivant. <xsl:call-template name="NifftyLookingWrapper"> <xsl:with-param name="body"> </xsl:call-template> and the template just makes body look pretty. But now i would like to actually chew on something like this ... <theunknown> <tbl> <row> <cells>...</cells <cells>...</cells </row> <row> <cells>...</cells <cells>...</cells </row> </tbl> </theunknown> .. where the 'unknown' could be anywhere inside a xml document. My would be solution is to do something like this ... <xsl:call-template name="tbl"> <xsl:with-param name="loc"> location of above unknown here </xsl:with-param> </xsl:call-template> <xsl:template name="tbl"> <xsl aram name="loc"/>[begin] <xsl:for-each select="$loc/row"> i've found a row </xsl:for-each> [end] </xsl:template> location of above unknown here ... where i would be able to call the tbl template and give it a $loc and it would transform that appropriately. Basically the same as my NiffyLookingWrapper but it looks at the XML inside of it and processes it. |
|
#2
|
|||
|
|||
|
This is what is known as a dynamic Xpath expression
Do a Google search to find out more. The XSLT1 specification does not support it (nor I understand does XSLT2). However some parsers do support it through an non-standard extension (Saxon, Xalan?) - Finnbarr |
|
#3
|
|||
|
|||
|
Quote:
Fascinating, i must be trying to do something simple in a very complicated way. Thanks |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Small Report XSL/XPATH Template Help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|