XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Tom PattersonSubject: XSLT and Saxon
Author: Tom Patterson
Date: 23 Sep 2004 11:26 AM
I'm a newbie here, only been doing this for about a day or so, so please excuse any ignorance on my part. I am trying to create an XSLT using multiple style sheets for modularized code and multiple xml documents. I have no problem including the xsl documents or the xml documents, but I am having issues trying to use counters. The <xsl:count> element doesn't seem to work properly because the xml document is in multiple files and I can't just use a regular variable because xslt won't let you change them after they have been assigned. So this is what I'm attempting:<br> <br> I have <xsl:variable name="p0ct" saxon:assignable="yes" select="0"/> as the global declaration for this variable. Then later I have:<br> <br> ...<br> <saxon:assign name="p0ct" select="$p0ct + 1"/><br> ...<br> <br> When I run this using the built-in processor with Stylus Studio, instead of updating the variable, it just outputs this in the resulting html document. In the stylesheet declaration, I have<br> <br> xmlns:saxon="<a href="http://saxon.sf.net"">">http://saxon.sf.net"</a> extension-element-prefixes="saxon"<br> <br> I put this in all the stylesheets that have anything to do with saxon, but they don't seem to do anything. I tried changing to the builtin saxon processor, but then I don't get anything for the output. I'm kinda lost as to what to try next. Any ideas?

Postnext
Tony LavinioSubject: XSLT and Saxon
Author: Tony Lavinio
Date: 23 Sep 2004 03:08 PM
First, since saxon:assignable is a Saxon-specific extension, it will be
ignored by any non-Saxon processors, including the internal one.

You didn't say whether you were using Saxon 6.5.x or Saxon 7.x or
Saxon 8.0, but looking at the documentation at
http://www.saxonica.com/documentation/extensions/attributes.html
for saxon:assignable says nothing about having to set
extension-element-prefixes, so just removing that may solve your
problem.

For help with Saxon-specific issues, there is a Saxon mailing list at
SourceForge - http://sourceforge.net/forum/forum.php?forum_id=94027

Postnext
Tom PattersonSubject: XSLT and Saxon
Author: Tom Patterson
Date: 23 Sep 2004 04:38 PM
The version of Stylus Studio I am using comes with a version 6 saxon (it says is internal) and a version 7 saxon (it says is external and won't allow debugging.) If I try to run it with the processor labelled "built-in", then the transformation is completed, but it spits out the saxon elements as if they were html. If I try to use any of the other processors that come with Stylus Studio, they all crash and say that it is an unknown element. Is there another way to have variables that can be changed? I can't use the number of position functions built into xsl because the elements I need to enumerate all exist in different files. I'm am open to any suggestions any may have.

Postnext
Tony LavinioSubject: XSLT and Saxon
Author: Tony Lavinio
Date: 23 Sep 2004 06:26 PM
You did not state if removing the extension-element-prefixes
attributes solved the problem.

Otherwise, for support of Saxon-specific attributes, you're
going to have to pursue this on the Saxon-specific mailing
list.

However, generally, there are ways to handle enumeration that
do not require changing a variable. Perhaps if you posted
your documents, we might be better able to help.

Another good reference for doing things like this is the "XSLT
Cookbook" by Sal Mangago, ISBN 0596003722.

Postnext
Tom PattersonSubject: XSLT and Saxon
Author: Tom Patterson
Date: 24 Sep 2004 09:48 AM
Originally Posted: 24 Sep 2004 09:46 AM
Oops. Sorry. No, it didn't fix it. Here are a couple of thie files I'm working with. Sometimes I think that just a flat file would make things easier. Thanks a lot. This is driving me nuts.


Documentptomm.xsl
Main XSL file

Documentparatom.xsl
XSL file using saxon

DocumentPMC-BICYCLEXXXAAA-U8025-00001_000-01.xml
XML doc linking to other files.

DocumentDMC-BICYCLEXXXAAA-AAA-D00-00-00-0000-043A-A_000-02.xml
XML doc 2

UnknownDMC-BICYCLEXXXAAA-AAA-D00-00-00-0000-041A-A_000-02.xml
XML doc 1

Postnext
Tom PattersonSubject: XSLT and Saxon
Author: Tom Patterson
Date: 29 Sep 2004 08:36 AM
So am I up a creek? Is there anyway to do this?

Postnext
Ivan PedruzziSubject: XSLT and Saxon
Author: Ivan Pedruzzi
Date: 29 Sep 2004 10:36 AM
You forgot to attach figuretom.xsl and tabtomle.xsl
we can't run your sample.

I don't see the need of saxon:assign
$p0ct in only used in the paratom.xsl and never re-assign,
sp1ct could be handled adding some logic rather then using an extension.

Ivan

Postnext
Tom PattersonSubject: XSLT and Saxon
Author: Tom Patterson
Date: 29 Sep 2004 12:02 PM
Wow, I am on the ball today. Besides forgetting the files, I took out the code in paratom.xsl. The para0 template should be:
<xsl:template match="para0">
<saxon:assign name="p0ct" select="$p0ct + 1"/>
<xsl:if test="@id!=''">
<a name="{@id}"/>
</xsl:if>
<xsl:apply-templates/>
</xsl:template>
I tried just using a count, but it kept resetting the counter because of the multiple files.


Documenttabtomle.xsl


Documentfiguretom.xsl

Posttop
Tony LavinioSubject: XSLT and Saxon
Author: Tony Lavinio
Date: 30 Sep 2004 04:23 PM
Again, questions regarding processor-specific extensions
should be posted to a forum specific to that processor.
Michael Kay himself is active on the saxon-list at
http://sourceforge.net/forum/forum.php?forum_id=94027

A good place for general XSLT-specific questions is the
xsl-list at http://www.mulberrytech.com/xsl/xsl-list/index.html

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.