XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 16th, 2004, 07:05 AM
gmillerd gmillerd is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 4 gmillerd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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">
<xslaram 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.

Reply With Quote
  #2  
Old January 16th, 2004, 03:44 PM
fpmurphy fpmurphy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: USA
Posts: 260 fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 23 h 19 m 32 sec
Reputation Power: 6
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

Reply With Quote
  #3  
Old January 16th, 2004, 05:43 PM
gmillerd gmillerd is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 4 gmillerd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally posted by fpmurphy
This is what is known as a dynamic Xpath expression
Do a Google search to find out more.


Fascinating, i must be trying to do something simple in a very complicated way. Thanks

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Small Report XSL/XPATH Template Help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway