<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0">
  <channel>
    <title>
Altova Mailing List: xsl-list
    </title>
    <link>http://www.altova.com/</link>
    <description>Altova accelerates application development and data management projects with software and solutions that enhance productivity and maximize results. As an innovative, customer-focused company and the creator of XMLSpy and other leading XML, data administration, UML, and Web services tools, Altova is the choice of over 3 million clients worldwide, including virtually every Fortune 500 company. With customers ranging from vast development teams in the worldâ€™s largest organizations to progressive one-person shops, Altovaâ€™s line of software applications fulfills a broad spectrum of business needs. Altova is an active member of the World Wide Web Consortium (W3C) and Object Management Group (OMG) and is committed to delivering standards-based platform-independent solutions that are powerful, affordable, and easy to use. Altova was founded in 1992 and has headquarters in Beverly, Massachusetts and Vienna, Austria.</description>
    <language>en-us</language>
    <copyright>Copyright Â© 2005, 2006, 2007 Altova GmbH. All rights reserved. Altova, XMLSpy, MapForce, StyleVision, SemanticWorks, SchemaAgent, UModel, DiffDog, and Authentic are trademarks and/or registered trademarks of Altova GmbH in the United States and/or other countries. The names of and reference to other companies and products mentioned herein may be the trademarks of their respective owners.</copyright>
    <pubDate>Tue, 03 Jun 2008 10:00:00 EDT</pubDate>
    <lastBuildDate>Tue, 03 Jun 2008 10:00:00 EDT</lastBuildDate>
    <generator>Authentic RSS Editor, visit www.altova.com for details</generator>
    <managingEditor>pr@altova.com</managingEditor>
    <webMaster>webmaster@altova.com</webMaster>
    <image>
      <url>http://www.altova.com/images/logos/altova_right_120.gif</url>
      <title>ALTOVA</title>
      <link>http://www.altova.com/</link>
      <width>120</width>
      <height>24</height>
      <description>Altova Logo</description>
    </image>

<item>
<title>Re: [xsl] removing a specific namespace declaration - 11/8/2009 1:32:00 AM</title>
<description><![CDATA[<pre>At 2009-11-07 16:42 -0800, tom a wrote:
&gt;I'm trying to remove what I believe to be an unused namespace 
&gt;declaration from the output.

Unused namespace declarations are supposed to be benign to processing 
applications.  Why is it you want to remove it?

&gt;eg:
&gt;
&gt;Source:
&gt;&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
&gt;&lt;svg  viewBox=&quot;0 0 360 792&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; 
&gt;xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; xmlns:foo=&quot;http://www.foo.com&quot;&gt;
&gt;&lt;!-- svg content --&gt;
&gt;&lt;/svg&gt;
&gt;
&gt;Becomes:
&gt;&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
&gt;&lt;svg  viewBox=&quot;0 0 360 792&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;
&gt;xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&gt;&lt;!-- svg content --&gt;
&gt;&lt;/svg&gt;
&gt;
&gt;ie, the foo namespace is removed in the transformation.
&gt;
&gt;I've seen many posts on removing all namespaces, but can't figure 
&gt;out how to remove a specific namespace.

In XSLT one neither removes all namespaces nor removes specific namespaces.

In XSLT and in XQuery one is always creating result trees from 
scratch using the information found in source trees.

To achieve what you want you need to reconstitute the elements and 
inhibit the copying of the foo namespace, rather than copying the 
elements, because copying an element has the effect of copying all 
attached namespace nodes.

I hope the example below helps.

. . . . . . . . . Ken

T:\ftemp&gt;type toma.xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
&lt;svg  viewBox=&quot;0 0 360 792&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; 
xmlns:xlink=&quot;http
://www.w3.org/1999/xlink&quot; xmlns:foo=&quot;http://www.foo.com&quot;&gt;
&lt;!-- svg content --&gt;
&lt;/svg&gt;

T:\ftemp&gt;call xslt toma.xml toma.xsl
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;svg 
xmlns=&quot;http://www.w3.org/2000/svg&quot; xm
lns:xlink=&quot;http://www.w3.org/1999/xlink&quot; viewBox=&quot;0 0 360 792&quot;&gt;
&lt;!-- svg content --&gt;
&lt;/svg&gt;
T:\ftemp&gt;type toma.xsl
&lt;?xml version=&quot;1.0&quot; encoding=&quot;US-ASCII&quot;?&gt;
&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
                 version=&quot;1.0&quot;&gt;

&lt;xsl:template match=&quot;*&quot;&gt;
   &lt;xsl:element name=&quot;{name(.)}&quot; namespace=&quot;{namespace-uri(.)}&quot;&gt;
     &lt;xsl:copy-of select=&quot;namespace::*[name(.)!='foo']&quot;/&gt;
     &lt;xsl:copy-of select=&quot;@*&quot;/&gt;
     &lt;xsl:apply-templates/&gt;
   &lt;/xsl:element&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match=&quot;comment()|processing-instruction()|text()&quot;&gt;
   &lt;xsl:copy/&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
T:\ftemp&gt;

--
Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
Interested in other classes?  http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306265.html</link>
</item><item>
<title>[xsl] removing a specific namespace declaration - 11/8/2009 12:43:00 AM</title>
<description><![CDATA[<pre>I'm trying to remove what I believe to be an unused namespace declaration from the output. eg:

Source:
&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
&lt;svg  viewBox=&quot;0 0 360 792&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; xmlns:foo=&quot;http://www.foo.com&quot;&gt;
&lt;!-- svg content --&gt;
&lt;/svg&gt;

Becomes:
&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
&lt;svg  viewBox=&quot;0 0 360 792&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;
xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;!-- svg content --&gt;
&lt;/svg&gt;

ie, the foo namespace is removed in the transformation.

I've seen many posts on removing all namespaces, but can't figure out how to remove a specific namespace.

Any thoughts are greatly appreciated.



      

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306262.html</link>
</item><item>
<title>RE: [xsl] is there a way to output XML with invalid qnames? - 11/7/2009 10:20:00 AM</title>
<description><![CDATA[<pre>&gt; Before I give myself a headache trying to figure it out, I 
&gt; was wondering if anyone could suggest a better approach I 
&gt; should look into.

I would suggest outputting valid XML, and then post-processing it with
non-XML software (e.g. sed/Perl) to generate non-XML output.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306213.html</link>
</item><item>
<title>Re: [xsl] fo:basic-link - 11/7/2009 3:55:00 AM</title>
<description><![CDATA[<pre>At 2009-11-06 19:33 -0800, Mark Wilson wrote:
&gt;I am using FOP and it built the PDF files with internal and external 
&gt;basic links without  using the URI wrapper.

The &lt;uri-specification&gt; syntax is only for external links not 
internal links.  Internal link anchors are simple name tokens.

Note that &lt;uri-specification&gt; is for any external reference, such as 
the src=  attribute in &lt;fo:external-graphic&gt;, in background-image=, 
and in a number of other lesser-used attributes.

Many stylesheet writers forget to use &lt;uri-specification&gt; syntax for src=.

&gt;I got my syntax [without the URI(...)] from an online tutorial. 
&gt;However, I recognize that the proper syntax should be used, and have 
&gt;altered my code accordingly.

Most vendors support the incorrect syntax but I agree with you that 
isn't a reason it should be used.

&gt;The &quot;s.pdf#block1&quot; experiment did not work. I will take my question 
&gt;to an Adobe PDF list, assuming I can find one.

I look forward to hearing of your progress in finding how to do this.

. . . . . . . . . . . Ken

--
Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
Interested in other classes?  http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306192.html</link>
</item><item>
<title>Re: [xsl] fo:basic-link - 11/7/2009 3:34:00 AM</title>
<description><![CDATA[<pre>Hi Ken,
As always, I am amazed at your prompt at pointed help.
I am using FOP and it built the PDF files with internal and external basic 
links without  using the URI wrapper. I got my syntax [without the URI(...)] 
from an online tutorial. However, I recognize that the proper syntax should 
be used, and have altered my code accordingly.

The &quot;s.pdf#block1&quot; experiment did not work. I will take my question to an 
Adobe PDF list, assuming I can find one.
Thanks,
Mark 



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306191.html</link>
</item><item>
<title>Re: [xsl] fo:basic-link - 11/7/2009 2:47:00 AM</title>
<description><![CDATA[<pre>At 2009-11-06 18:26 -0800, Mark Wilson wrote:
&gt;I have been reviewing &lt;fo:basic-link&gt; and have learned how to use 
&gt;the external- and internal- destination properties. Two test code 
&gt;fragments are listed below. Is there a way to make
&gt;    &lt;fo:basic-link external-destination=&quot;s.pdf&quot;&gt;
&gt;take me directly to
&gt;    &lt;xsl:attribute name=&quot;id&quot;&gt;block1&lt;/xsl:attribute&gt;
&gt;
&gt;within the s.pdf document rather than just opening the &quot;s.pdf&quot; document?
&gt;If so, how would I change
&gt;    &lt;fo:basic-link external-destination=&quot;s.pdf&quot;&gt;
&gt;to do that?

First of all, the syntax should be:

   external-destination='url(&quot;----uri-here----&quot;)'

... but that isn't the answer to your question.

The semantics of now to resolve external URI specifications are 
outside of the XSL-FO specification.  Section 7.23.6 reads:

   &quot;How the destination (sub-)resource is used and/or displayed is
    application and implementation-dependent. In typical browsing
    applications, the destination resource is displayed in the
    browser positioned so that some rendered portion resulting from
    the processing of some part of the specific destination
    sub-resource indicated by the fragment identifier is in view.&quot;

Therefore it is up to (a) the vendor's software creating the output 
from your XSL-FO and (b) the software that is engaged by the reader 
that is reading your published XSL-FO to you.  If you are publishing 
to PDF then this would be (a) the vendor of the XSL-FO to PDF 
creation tool and (b) the platform (probably the browser) that is 
engaged when clicking on a link, and I suppose, the reader engaged by 
the browser to catch the link that was clicked.

I would experiment with:

   external-destination='url(&quot;s.pdf#block1&quot;)'

.... but I don't know of any browser/reader that supports such a 
syntax but perhaps your platform combination described above supports 
that (it has been many years since I've tried).

I hope this helps.  I would appreciate anyone on the list who knows 
of a more reliable syntax to relate their own experiences, but I'm 
not sure we'll hear from anyone.

. . . . . . . . . . . Ken


--
Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
Interested in other classes?  http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306190.html</link>
</item><item>
<title>[xsl] fo:basic-link - 11/7/2009 2:27:00 AM</title>
<description><![CDATA[<pre>Hi all,
I have been reviewing &lt;fo:basic-link&gt; and have learned how to use the 
external- and internal- destination properties. Two test code fragments are 
listed below. Is there a way to make
    &lt;fo:basic-link external-destination=&quot;s.pdf&quot;&gt;
take me directly to
    &lt;xsl:attribute name=&quot;id&quot;&gt;block1&lt;/xsl:attribute&gt;

within the s.pdf document rather than just opening the &quot;s.pdf&quot; document?
If so, how would I change
    &lt;fo:basic-link external-destination=&quot;s.pdf&quot;&gt;
to do that?

Thanks,
Mark

Listing fragment 1: set Id
&lt;fo:block xsl:use-attribute-sets=&quot;subject&quot;&gt;
     &lt;xsl:if test=&quot;. eq 'St. Adalbert Association'&quot;&gt;
             &lt;xsl:attribute name=&quot;id&quot;&gt;block1&lt;/xsl:attribute&gt;
     &lt;/xsl:if&gt;
     &lt;xsl:value-of select=&quot;.&quot;/&gt;
     &lt;fo:wrapper xsl:use-attribute-sets=&quot;catalog-numbers&quot;&gt;
          &lt;xsl:call-template name=&quot;catalog-name-and-number&quot;/&gt;
      &lt;/fo:wrapper&gt;
      &lt;xsl:apply-templates select=&quot;../Xref&quot; mode=&quot;set-up&quot;/&gt;
   &lt;/fo:block&gt;

Listing Fragment 2: make link
&lt;xsl:choose&gt;
        &lt;xsl:when test=&quot;Heading eq 'St. Adalbert Association'&quot;&gt;
                &lt;fo:basic-link external-destination=&quot;s.pdf&quot; color=&quot;blue&quot;&gt;
                      &lt;xsl:value-of select=&quot;Heading&quot;/&gt;
               &lt;/fo:basic-link&gt;
        &lt;/xsl:when&gt;
        &lt;xsl:otherwise&gt;
               &lt;xsl:value-of select=&quot;Heading&quot;/&gt;
        &lt;/xsl:otherwise&gt;
&lt;/xsl:choose&gt; 



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306189.html</link>
</item><item>
<title>Re: [xsl] is there a way to output XML with invalid qnames? - 11/7/2009 2:09:00 AM</title>
<description><![CDATA[<pre>At 2009-11-06 16:57 -0800, Jessica Britton wrote:
&gt;I'm trying to format XML files so that I can display them as 
&gt;examples in a wiki. I'd like the element names in the examples to 
&gt;link to other wiki pages, so I'm trying to figure out the best way 
&gt;to take source like this:
&gt;
&gt;&lt;ns:elementName1&gt;
&gt;     &lt;ns:elementName2&gt;value&lt;/ns:elementName2&gt;
&gt;&lt;/ns:elementName1&gt;
&gt;
&gt;
&gt;And get output like this:
&gt;
&gt;&lt;[ns:elementName1|page 1]&gt;
&gt;     &lt;[ns:elementName2|page 2]&gt;value&lt;/ns:elementName2&gt;
&gt;&lt;/ns:elementName1&gt;

This was an interesting challenge!  Especially coming up with 
monotonically increasing page number references for unique element 
names across the instance.

&gt;Of course, &quot;[ns:elementName|page]&quot; isn't a valid qname so just 
&gt;trying to rename the elements in an XML to XML transform doesn't work.
&gt;...
&gt;Before I give myself a headache trying to figure it out, I was 
&gt;wondering if anyone could suggest a better approach I should look into.

I think the example below suits your needs, though I'm making 
guesses.  As a more extensive test I ran the stylesheet through 
itself in order to have a larger test.  This isn't a very rigourous 
test, and I haven't checked nearly all the edge cases but it should 
do a lot for you as it stands and may meet your needs.

I hope this helps.

. . . . . . . . . . . Ken


T:\ftemp&gt;type jessica.xml
&lt;ns:elementName1 xmlns:ns=&quot;urn:X-Jessica&quot;&gt;
     &lt;ns:elementName2&gt;value&lt;/ns:elementName2&gt;
&lt;/ns:elementName1&gt;

T:\ftemp&gt;call xslt jessica.xml xml2wiki.xsl
&lt;[ns:elementName1|page 1] xmlns:ns=&quot;urn:X-Jessica&quot;&gt;
     &lt;[ns:elementName2|page 2]&gt;value&lt;/ns:elementName2&gt;
&lt;/ns:elementName1&gt;
T:\ftemp&gt;type xml2wiki.xsl
&lt;?xml version=&quot;1.0&quot; encoding=&quot;US-ASCII&quot;?&gt;
&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
                 version=&quot;1.0&quot;&gt;

&lt;xsl:output method=&quot;text&quot;/&gt;

&lt;xsl:key name=&quot;names&quot; match=&quot;*&quot; use=&quot;name(.)&quot;/&gt;

&lt;xsl:template match=&quot;*&quot;&gt;
   &lt;!--reconstitute the element start tag--&gt;
   &lt;xsl:text&gt;&amp;lt;[&lt;/xsl:text&gt;
   &lt;xsl:value-of select=&quot;name(.)&quot;/&gt;|page &lt;xsl:text/&gt;
   &lt;!--find the first in document order--&gt;
   &lt;xsl:variable name=&quot;first&quot;
                 select=&quot;key('names',name(.))[1]&quot;/&gt;
   &lt;!--determine its ordinal based on the uniqueness of element names--&gt;
   &lt;xsl:value-of select=&quot;count(
                         ($first/preceding::* | $first/ancestor::*)
                         [generate-id(.)=
                          generate-id(key('names',name(.))[1])]) + 1&quot;/&gt;
   &lt;xsl:text&gt;]&lt;/xsl:text&gt;
   &lt;!--reconstitute the namespaces--&gt;
   &lt;xsl:for-each select=&quot;namespace::*[not(.=../../namespace::*) and
                                      name(.)!='xml']&quot;&gt;
     &lt;xsl:value-of select=&quot;concat(' ','xmlns')&quot;/&gt;
     &lt;xsl:if test=&quot;name(.)&quot;&gt;:&lt;xsl:value-of select=&quot;name(.)&quot;/&gt;&lt;/xsl:if&gt;
     &lt;xsl:value-of select=&quot;concat('=&amp;#x22;',.,'&amp;#x22;')&quot;/&gt;
   &lt;/xsl:for-each&gt;
   &lt;!--reconstitute the attributes--&gt;
   &lt;xsl:for-each select=&quot;@*&quot;&gt;
     &lt;xsl:value-of select=&quot;concat(' ',name(.),'=&amp;#x22;')&quot;/&gt;
     &lt;xsl:call-template name=&quot;do-text&quot;/&gt;
     &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;
   &lt;/xsl:for-each&gt;
   &lt;xsl:choose&gt;
     &lt;xsl:when test=&quot;node()&quot;&gt;
       &lt;!--reconstitute the content--&gt;
       &lt;xsl:text&gt;&amp;gt;&lt;/xsl:text&gt;
       &lt;xsl:apply-templates select=&quot;node()&quot;/&gt;
       &lt;xsl:text&gt;&amp;lt;/&lt;/xsl:text&gt;
       &lt;xsl:value-of select=&quot;name(.)&quot;/&gt;
       &lt;xsl:text&gt;&amp;gt;&lt;/xsl:text&gt;
     &lt;/xsl:when&gt;
     &lt;xsl:otherwise&gt;
       &lt;!--empty element--&gt;
       &lt;xsl:text&gt;/&amp;gt;&lt;/xsl:text&gt;
     &lt;/xsl:otherwise&gt;
   &lt;/xsl:choose&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match=&quot;comment()&quot;&gt;
   &lt;xsl:text&gt;&amp;lt;!--&lt;/xsl:text&gt;
   &lt;xsl:value-of select=&quot;.&quot;/&gt;
   &lt;xsl:text&gt;--&amp;gt;&lt;/xsl:text&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match=&quot;processing-instruction()&quot;&gt;
   &lt;xsl:text&gt;&amp;lt;?&lt;/xsl:text&gt;
   &lt;xsl:value-of select=&quot;concat(name(.),' ',.)&quot;/&gt;
   &lt;xsl:text&gt;?&amp;gt;&lt;/xsl:text&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match=&quot;text()&quot; name=&quot;do-text&quot;&gt;
   &lt;xsl:param name=&quot;rest&quot; select=&quot;.&quot;/&gt;
   &lt;xsl:choose&gt;
     &lt;xsl:when test=&quot;contains($rest,'&amp;lt;')&quot;&gt;
       &lt;xsl:value-of select=&quot;substring-before($rest,'&amp;lt;')&quot;/&gt;
       &lt;xsl:text&gt;&amp;amp;lt;&lt;/xsl:text&gt;
       &lt;xsl:call-template name=&quot;do-text&quot;&gt;
         &lt;xsl:with-param name=&quot;rest&quot; select=&quot;substring-after($rest,'&amp;lt;')&quot;/&gt;
       &lt;/xsl:call-template&gt;
     &lt;/xsl:when&gt;
     &lt;xsl:otherwise&gt;
       &lt;xsl:value-of select=&quot;$rest&quot;/&gt;
     &lt;/xsl:otherwise&gt;
   &lt;/xsl:choose&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;

T:\ftemp&gt;call xslt xml2wiki.xsl xml2wiki.xsl
&lt;[xsl:stylesheet|page 1] 
xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; version=&quot;1.0&quot;&gt;

&lt;[xsl:output|page 2] method=&quot;text&quot;/&gt;

&lt;[xsl:key|page 3] name=&quot;names&quot; match=&quot;*&quot; use=&quot;name(.)&quot;/&gt;

&lt;[xsl:template|page 4] match=&quot;*&quot;&gt;
   &lt;!--reconstitute the element start tag--&gt;
   &lt;[xsl:text|page 5]&gt;&amp;lt;[&lt;/xsl:text&gt;
   &lt;[xsl:value-of|page 6] select=&quot;name(.)&quot;/&gt;|page &lt;[xsl:text|page 5]/&gt;
   &lt;!--find the first in document order--&gt;
   &lt;[xsl:variable|page 7] name=&quot;first&quot; select=&quot;key('names',name(.))[1]&quot;/&gt;
   &lt;!--determine its ordinal based on the uniqueness of element names--&gt;
   &lt;[xsl:value-of|page 6] 
select=&quot;count(                         ($first/preceding::* | 
$first/ancestor::*)                         [generate-id(.)= 
                 generate-id(key('names',name(.))[1])]) + 1&quot;/&gt;
   &lt;[xsl:text|page 5]&gt;]&lt;/xsl:text&gt;
   &lt;!--reconstitute the namespaces--&gt;
   &lt;[xsl:for-each|page 8] 
select=&quot;namespace::*[not(.=../../namespace::*) 
and                                       name(.)!='xml']&quot;&gt;
     &lt;[xsl:value-of|page 6] select=&quot;concat(' ','xmlns')&quot;/&gt;
     &lt;[xsl:if|page 9] test=&quot;name(.)&quot;&gt;:&lt;[xsl:value-of|page 6] 
select=&quot;name(.)&quot;/&gt;&lt;/xsl:if&gt;
     &lt;[xsl:value-of|page 6] select=&quot;concat('=&quot;',.,'&quot;')&quot;/&gt;
   &lt;/xsl:for-each&gt;
   &lt;!--reconstitute the attributes--&gt;
   &lt;[xsl:for-each|page 8] select=&quot;@*&quot;&gt;
     &lt;[xsl:value-of|page 6] select=&quot;concat(' ',name(.),'=&quot;')&quot;/&gt;
     &lt;[xsl:call-template|page 10] name=&quot;do-text&quot;/&gt;
     &lt;[xsl:text|page 5]&gt;&quot;&lt;/xsl:text&gt;
   &lt;/xsl:for-each&gt;
   &lt;[xsl:choose|page 11]&gt;
     &lt;[xsl:when|page 12] test=&quot;node()&quot;&gt;
       &lt;!--reconstitute the content--&gt;
       &lt;[xsl:text|page 5]&gt;&gt;&lt;/xsl:text&gt;
       &lt;[xsl:apply-templates|page 13] select=&quot;node()&quot;/&gt;
       &lt;[xsl:text|page 5]&gt;&amp;lt;/&lt;/xsl:text&gt;
       &lt;[xsl:value-of|page 6] select=&quot;name(.)&quot;/&gt;
       &lt;[xsl:text|page 5]&gt;&gt;&lt;/xsl:text&gt;
     &lt;/xsl:when&gt;
     &lt;[xsl:otherwise|page 14]&gt;
       &lt;!--empty element--&gt;
       &lt;[xsl:text|page 5]&gt;/&gt;&lt;/xsl:text&gt;
     &lt;/xsl:otherwise&gt;
   &lt;/xsl:choose&gt;
&lt;/xsl:template&gt;

&lt;[xsl:template|page 4] match=&quot;comment()&quot;&gt;
   &lt;[xsl:text|page 5]&gt;&amp;lt;!--&lt;/xsl:text&gt;
   &lt;[xsl:value-of|page 6] select=&quot;.&quot;/&gt;
   &lt;[xsl:text|page 5]&gt;--&gt;&lt;/xsl:text&gt;
&lt;/xsl:template&gt;

&lt;[xsl:template|page 4] match=&quot;processing-instruction()&quot;&gt;
   &lt;[xsl:text|page 5]&gt;&amp;lt;?&lt;/xsl:text&gt;
   &lt;[xsl:value-of|page 6] select=&quot;concat(name(.),' ',.)&quot;/&gt;
   &lt;[xsl:text|page 5]&gt;?&gt;&lt;/xsl:text&gt;
&lt;/xsl:template&gt;

&lt;[xsl:template|page 4] match=&quot;text()&quot; name=&quot;do-text&quot;&gt;
   &lt;[xsl:param|page 15] name=&quot;rest&quot; select=&quot;.&quot;/&gt;
   &lt;[xsl:choose|page 11]&gt;
     &lt;[xsl:when|page 12] test=&quot;contains($rest,'&amp;lt;')&quot;&gt;
       &lt;[xsl:value-of|page 6] select=&quot;substring-before($rest,'&amp;lt;')&quot;/&gt;
       &lt;[xsl:text|page 5]&gt;&amp;lt;&lt;/xsl:text&gt;
       &lt;[xsl:call-template|page 10] name=&quot;do-text&quot;&gt;
         &lt;[xsl:with-param|page 16] name=&quot;rest&quot; 
select=&quot;substring-after($rest,'&amp;lt;')&quot;/&gt;
       &lt;/xsl:call-template&gt;
     &lt;/xsl:when&gt;
     &lt;[xsl:otherwise|page 14]&gt;
       &lt;[xsl:value-of|page 6] select=&quot;$rest&quot;/&gt;
     &lt;/xsl:otherwise&gt;
   &lt;/xsl:choose&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
T:\ftemp&gt;rem



--
Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
Interested in other classes?  http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306188.html</link>
</item><item>
<title>[xsl] is there a way to output XML with invalid qnames? - 11/7/2009 12:59:00 AM</title>
<description><![CDATA[<pre>I'm trying to format XML files so that I can display them as examples in a wiki. I'd like the element names in the examples to link to other wiki pages, so I'm trying to figure out the best way to take source like this:

&lt;ns:elementName1&gt;
&#160;&#160;&#160; &lt;ns:elementName2&gt;value&lt;/ns:elementName2&gt;
&lt;/ns:elementName1&gt;


And get output like this:

&lt;[ns:elementName1|page 1]&gt;
&#160;&#160;&#160; &lt;[ns:elementName2|page 2]&gt;value&lt;/ns:elementName2&gt;
&lt;/ns:elementName1&gt;

Of course, &quot;[ns:elementName|page]&quot; isn't a valid qname so just trying to rename the elements in an XML to XML transform doesn't work. 

I've messed around a bit trying to output HTML that looks the way I want it to look, including indentation, eg:

&lt;xsl:for-each select=&quot;rss/channel/title|rss/channel/link|rss/channel/description&quot;&gt;
&#160;&#160;&#160;&#160;&#160; &lt;xsl:variable name=&quot;value&quot; select=&quot;text()&quot; /&gt;
&#160;&#160;&#160;&#160;&#160; &lt;xsl:variable name=&quot;name&quot; select=&quot;name()&quot; /&gt;
&#160;&#160;&#160;&#160;&#160; &lt;xsl:variable name=&quot;newName&quot; select=&quot;concat($open, $name, $linkEnd)&quot; /&gt;
&#160;&#160;&#160;&#160;&#160; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;xsl:value-of select=&quot;$newName&quot;/&gt;&amp;gt;&lt;xsl:value-of select=&quot;$value&quot;/&gt;&amp;lt;/&lt;xsl:value-of select=&quot;$name&quot;/&gt;&amp;gt;&lt;br /&gt;
&lt;/xsl:for-each&gt;

That works fine for simple inline elements, but it I'm not sure how to deal with nodes with children.

Before I give myself a headache trying to figure it out, I was wondering if anyone could suggest a better approach I should look into.

&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 
&#160;&#160;&#160; 



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306183.html</link>
</item><item>
<title>Re: [xsl] The benefits of exact selection - 11/6/2009 4:43:00 PM</title>
<description><![CDATA[<pre>On Fri, Nov 6, 2009 at 4:51 PM, Jesper Tverskov &lt;jesper@tverskov.dk&gt; wrote:
&gt; I would like to know about real life cases where removing not
&gt; necessary wildcard matching improved the transformation speed?

I have experienced to specify exact paths instead of XPath wildcards,
to speed up XPath processing time significantly, when size of XML tree
was quite large, and large number of XML documents were processed in a
batch. In my use case, both these constraints were present.



-- 
Regards,
Mukul Gandhi

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306162.html</link>
</item><item>
<title>Re: [xsl] SOAP extension compatible with AltovaXML - 11/6/2009 4:18:00 PM</title>
<description><![CDATA[<pre>[[ it seems that one never found its way to the list, sorry
   if posted twice... ]]

Fabre Lambeau wrote:

  Hi,

&gt; Has anyone come across (or implemented) a SOAP or http-send
&gt; extension for XSLT 2.0 that would work with the AltovaXML
&gt; processor?

  None that I am aware of.  My first advice would be to see if
you can switch to Saxon 9.

  If you cannot, the implementation (in Java) of the EXPath HTTP
Client is (I think) quite properly decoupled between what's Saxon
specific and the rest (if I remember well, the Apache HTTP Client
stuff is not that well entirely isolated in its own layer.)

  For what I've seen on the AltovaXML doc, it supports calling
Java methods, so if you're really interested, you should be able
to replace the Saxon layer of EXPath HTTP Client (mostly dealing
with parsing the http:request element and serializing the
http:response element.)  They do not say how they pass XDM nodes
to Java though (they only document how atomic types are mapped to
Java types.)

  If you're interested, please join the EXPath mailing list
&lt;http://www.expath.org/lists.html&gt; to ask for more information.

  Regards,

-- 
Florent Georges
http://www.fgeorges.org/






















      


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306161.html</link>
</item><item>
<title>Re: [xsl] The benefits of exact selection - 11/6/2009 4:07:00 PM</title>
<description><![CDATA[<pre>&lt;xsl:value-of select=&quot;/document/colors[1050]/color[140]/dec/@num&quot;/&gt;
is not same as &lt;xsl:value-of select=&quot;//@num&quot;/&gt;

you can`t compare this two XPath`s alone from XML - it is same as
compare &quot;soft with warm&quot; :)

can bet your students high esimate comparing push and pool scheme for
XSLT (also known as data-driven and template-driven models)


2009/11/6 Michael Kay &lt;mike@saxonica.com&gt;:
&gt;&gt;
&gt;&gt; Using Saxon PE from inside Oxygen, I transformed 20 times for each.
&gt;&gt; Here is the average time as reported by Oxygen:
&gt;&gt;
&gt;&gt; 1) Exact selection: 4.1s
&gt;&gt; 2) Wildcard selection: 5.0s
&gt;&gt;
&gt;&gt; That is a difference. But it is also fair to say that for
&gt;&gt; most transformations, on a small dataset, it will be
&gt;&gt; impossible to measure a difference of any importance.
&gt;&gt;
&gt;
&gt; Does your transformation time include document parsing/building time? For a
&gt; small task like this, the parsing time will completely swamp the
&gt; transformation time. If the parsing time is 4.0s, then your figure shows the
&gt; transformation time is different by a factor of 10.
&gt;
&gt; Regards,
&gt;
&gt; Michael Kay
&gt; http://www.saxonica.com/
&gt; http://twitter.com/michaelhkay
&gt;
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive: &#194;&#160;http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306160.html</link>
</item><item>
<title>Re: [xsl] Adding a clickable URL to XSL - 11/6/2009 2:47:00 PM</title>
<description><![CDATA[<pre>Ah, like an image. Thanks!



----- Original Message ----
From: Martin Honnen &lt;Martin.Honnen@gmx.de&gt;
To: xsl-list@lists.mulberrytech.com
Sent: Fri, November 6, 2009 9:30:00 AM
Subject: Re: [xsl] Adding a clickable URL to XSL

Anonymous Anonymous wrote:
&gt; How do I make just the URL element below appear as a clickable link? The ... represents omitted HTML formatting.

&gt;         &lt;td&gt;&lt;xsl:value-of select=&quot;s:Url&quot;/&gt;&lt;/td&gt;

          &lt;td&gt;
            &lt;a href=&quot;{s:Url}&quot;&gt;
              &lt;xsl:value-of select=&quot;s:Url&quot;/&gt;
            &lt;/a&gt;
          &lt;/td&gt;
-- 
    Martin Honnen
    http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--


      

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306154.html</link>
</item><item>
<title>Re: [xsl] Adding a clickable URL to XSL - 11/6/2009 2:30:00 PM</title>
<description><![CDATA[<pre>Anonymous Anonymous wrote:
&gt; How do I make just the URL element below appear as a clickable link? The ... represents omitted HTML formatting.

&gt;         &lt;td&gt;&lt;xsl:value-of select=&quot;s:Url&quot;/&gt;&lt;/td&gt;

           &lt;td&gt;
             &lt;a href=&quot;{s:Url}&quot;&gt;
               &lt;xsl:value-of select=&quot;s:Url&quot;/&gt;
             &lt;/a&gt;
           &lt;/td&gt;
-- 

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306153.html</link>
</item><item>
<title>[xsl] Adding a clickable URL to XSL - 11/6/2009 2:28:00 PM</title>
<description><![CDATA[<pre>How do I make just the URL element below appear as a clickable link? The ... represents omitted HTML formatting.

Thanks,
XML newbie

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

&lt;xsl:stylesheet version=&quot;1.0&quot;&gt;
&lt;xsl:template match=&quot;/&quot;&gt;
&lt;html&gt;
&lt;body&gt;
&lt;table&gt;...

&lt;xsl:for-each select=&quot;s:ResultSet/s:Result&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;xsl:value-of select=&quot;s:Title&quot;/&gt;&lt;/td&gt;
        &lt;td&gt;&lt;xsl:value-of select=&quot;s:Summary&quot;/&gt;&lt;/td&gt;
        &lt;td&gt;&lt;xsl:value-of select=&quot;s:Url&quot;/&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/xsl:for-each&gt;

...&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;



      

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306152.html</link>
</item><item>
<title>Re: [xsl] Trouble digesting grouping - 11/6/2009 2:05:00 PM</title>
<description><![CDATA[<pre>Flanders, Charles E (US SSA) wrote:
&gt; I'm struggling with a grouping problem. I've had some success with simpler structures, but this one has me stumped. This is an XML to XML transform.
&gt; 
&gt; I need to eliminate the parent &lt;para &gt; completely, output the &lt;table&gt; intact, but grab the &lt;graphic&gt; elements, create a single &lt;figure&gt;, then a &lt;subfig&gt; wrapper element for each &lt;graphic&gt;. Then output the structures interspersed with the tables. I can't seem to separate the tables and figures. What I'm ending up with is a single &lt;figure&gt; with all the &lt;subfig&gt;, then the tables. 

This stylesheet

&lt;xsl:stylesheet
   xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
   version=&quot;2.0&quot;&gt;

   &lt;xsl:output indent=&quot;yes&quot;/&gt;

   &lt;xsl:template match=&quot;@* | node()&quot;&gt;
     &lt;xsl:copy&gt;
       &lt;xsl:apply-templates select=&quot;@* | node()&quot;/&gt;
     &lt;/xsl:copy&gt;
   &lt;/xsl:template&gt;

   &lt;xsl:template match=&quot;install/proc&quot;&gt;
     &lt;xsl:apply-templates/&gt;
   &lt;/xsl:template&gt;

   &lt;xsl:template match=&quot;install/para&quot;&gt;
     &lt;xsl:for-each-group select=&quot;*&quot; group-adjacent=&quot;node-name(.)&quot;&gt;
       &lt;xsl:choose&gt;
         &lt;xsl:when test=&quot;current-grouping-key() eq QName('', 'graphic')&quot;&gt;
           &lt;figure&gt;
             &lt;title/&gt;
             &lt;xsl:apply-templates select=&quot;current-group()&quot;/&gt;
           &lt;/figure&gt;
         &lt;/xsl:when&gt;
         &lt;xsl:otherwise&gt;
           &lt;xsl:apply-templates select=&quot;current-group()&quot;/&gt;
         &lt;/xsl:otherwise&gt;
       &lt;/xsl:choose&gt;
     &lt;/xsl:for-each-group&gt;
   &lt;/xsl:template&gt;

   &lt;xsl:template match=&quot;graphic&quot;&gt;
     &lt;subfig&gt;
       &lt;xsl:copy-of select=&quot;.&quot;/&gt;
     &lt;/subfig&gt;
   &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;


when applied to

&lt;install&gt;
    &lt;proc&gt;
      &lt;step1&gt;
         &lt;para&gt;&lt;/para&gt;
&lt;/step1&gt;
&lt;/proc&gt;
&lt;para&gt;
&lt;table&gt;
          All the table stuff
    &lt;/table&gt;
    &lt;graphic/&gt;
    &lt;graphic/&gt;
    &lt;graphic/&gt;
    &lt;table&gt;
         All the table stuff
    &lt;/table&gt;
    &lt;graphic/&gt;
    &lt;graphic/&gt;
    &lt;graphic/&gt;
&lt;/para&gt;
&lt;/install&gt;

outputs

&lt;install&gt;

      &lt;step1&gt;
         &lt;para/&gt;
    &lt;/step1&gt;

    &lt;table&gt;
          All the table stuff
    &lt;/table&gt;
    &lt;figure&gt;
       &lt;title/&gt;
       &lt;subfig&gt;
          &lt;graphic/&gt;
       &lt;/subfig&gt;
       &lt;subfig&gt;
          &lt;graphic/&gt;
       &lt;/subfig&gt;
       &lt;subfig&gt;
          &lt;graphic/&gt;
       &lt;/subfig&gt;
    &lt;/figure&gt;
    &lt;table&gt;
         All the table stuff
    &lt;/table&gt;
    &lt;figure&gt;
       &lt;title/&gt;
       &lt;subfig&gt;
          &lt;graphic/&gt;
       &lt;/subfig&gt;
       &lt;subfig&gt;
          &lt;graphic/&gt;
       &lt;/subfig&gt;
       &lt;subfig&gt;
          &lt;graphic/&gt;
       &lt;/subfig&gt;
    &lt;/figure&gt;
&lt;/install&gt;
-- 

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306151.html</link>
</item><item>
<title>[xsl] Trouble digesting grouping - 11/6/2009 1:42:00 PM</title>
<description><![CDATA[<pre>I'm struggling with a grouping problem. I've had some success with simpler structures, but this one has me stumped. This is an XML to XML transform.

I need to eliminate the parent &lt;para &gt; completely, output the &lt;table&gt; intact, but grab the &lt;graphic&gt; elements, create a single &lt;figure&gt;, then a &lt;subfig&gt; wrapper element for each &lt;graphic&gt;. Then output the structures interspersed with the tables. I can't seem to separate the tables and figures. What I'm ending up with is a single &lt;figure&gt; with all the &lt;subfig&gt;, then the tables. 


&lt;install&gt;
   &lt;proc&gt;
     &lt;step1&gt;
        &lt;para&gt;&lt;/para&gt;
&lt;/step1&gt;
&lt;/proc&gt;
&lt;para&gt;
&lt;table&gt;
         All the table stuff
   &lt;/table&gt;
   &lt;graphic&gt;
   &lt;graphic&gt;
   &lt;graphic&gt;
   &lt;table&gt;
        All the table stuff
   &lt;/table&gt;
   &lt;graphic&gt;
   &lt;graphic&gt;
   &lt;graphic&gt;
&lt;/para&gt;
&lt;/install&gt;

Output that I desire:

&lt;install&gt;
   &lt;step1&gt;
     &lt;para&gt;&lt;/para&gt;
   &lt;step1&gt;
   &lt;table&gt;
      All the table stuff
   &lt;/table&gt;
   &lt;figure&gt;&lt;title/&gt;
     &lt;subfig&gt;&lt;graphic&gt;&lt;/subfig&gt;
     &lt;subfig&gt;&lt;graphic&gt;&lt;/subfig&gt;
      &lt;subfig&gt;&lt;graphic&gt;&lt;/subfig&gt;
   &lt;/figure&gt;
   &lt;table&gt;
      All the table stuff
   &lt;/table&gt;
   &lt;figure&gt;&lt;title/&gt;
     &lt;subfig&gt;&lt;graphic&gt;&lt;/subfig&gt;
     &lt;subfig&gt;&lt;graphic&gt;&lt;/subfig&gt;
      &lt;subfig&gt;&lt;graphic&gt;&lt;/subfig&gt;
   &lt;/figure&gt;
&lt;/install&gt;

Output that I'm getting (and I've tried defining the group in various ways, this is my last iteration).

&lt;install&gt;
   &lt;step1&gt;
      &lt;para&gt;&lt;/para&gt;
   &lt;/step1&gt;
&lt;figure&gt;&lt;title/&gt;
   &lt;subfig&gt;&lt;graphic/&gt;&lt;/subfig&gt;
   &lt;subfig&gt;&lt;graphic/&gt;&lt;/subfig&gt;
   &lt;subfig&gt;&lt;graphic/&gt;&lt;/subfig&gt;
   &lt;subfig&gt;&lt;graphic/&gt;&lt;/subfig&gt;
   &lt;subfig&gt;&lt;graphic/&gt;&lt;/subfig&gt;
   &lt;subfig&gt;&lt;graphic/&gt;&lt;/subfig&gt;
&lt;/figure&gt;
&lt;table&gt;&lt;/table&gt;
&lt;table&gt;&lt;/table&gt;
&lt;/install&gt;

My current templates: (Wendell, my apologies for just not getting this). Using  XSLT 2.0.



&lt;install&gt;
   &lt;xsl:apply-templates select=&quot;descendant::step1&quot;/&gt;
   &lt;xsl:if test=&quot;child::proc/following-sibling::para/(child::table|graphic)&quot;&gt;
      &lt;xsl:apply-templates select=&quot;child::proc/following-sibling::para/child::table | child::para&quot; mode=&quot;install&quot;/&gt;
   &lt;/xsl:if&gt;
&lt;/install&gt;

   &lt;xsl:template match=&quot;table&quot; mode=&quot;install&quot;&gt;
     &lt;table&gt;
     &lt;xsl:apply-templates/&gt;
     &lt;/table&gt;
   &lt;/xsl:template&gt;
   
   &lt;xsl:template match=&quot;install/para&quot; mode=&quot;install&quot;&gt;
     &lt;figure&gt;
   &lt;xsl:for-each-group select=&quot;*&quot; group-starting-with=&quot;graphic&quot;&gt;
     &lt;xsl:for-each select=&quot;current-group()[self::graphic]&quot;&gt;
        &lt;subfig&gt;
           &lt;xsl:copy-of select=&quot;.&quot;/&gt;
        &lt;/subfig&gt;
     &lt;/xsl:for-each&gt;
   &lt;/xsl:for-each-group&gt;
        &lt;/figure&gt;    
   &lt;/xsl:template&gt;

Charles Flanders


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306148.html</link>
</item><item>
<title>RE: [xsl] The benefits of exact selection - 11/6/2009 11:46:00 AM</title>
<description><![CDATA[<pre>&gt; 
&gt; Using Saxon PE from inside Oxygen, I transformed 20 times for each.
&gt; Here is the average time as reported by Oxygen:
&gt; 
&gt; 1) Exact selection: 4.1s
&gt; 2) Wildcard selection: 5.0s
&gt; 
&gt; That is a difference. But it is also fair to say that for 
&gt; most transformations, on a small dataset, it will be 
&gt; impossible to measure a difference of any importance.
&gt; 

Does your transformation time include document parsing/building time? For a
small task like this, the parsing time will completely swamp the
transformation time. If the parsing time is 4.0s, then your figure shows the
transformation time is different by a factor of 10.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306142.html</link>
</item><item>
<title>Re: [xsl] The benefits of exact selection - 11/6/2009 11:38:00 AM</title>
<description><![CDATA[<pre>&gt; 1) Exact selection: 4.1s
&gt; 2) Wildcard selection: 5.0s
&gt; 
&gt; That is a difference. But it is also fair to say that for most
&gt; transformations, on a small dataset, it will be impossible to measure
&gt; a difference of any importance.

Well, the difference may not seem like much in the context of a single
tranformation but think about it in terms of a production system needing
to execute many transformations per second.

I've got a system which is running an average of 191 transformations
per second, and increasing the run-time by 22% in that situation would
be catastrophic for me.


Jim

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
James A. Robinson                       jim.robinson@stanford.edu
Stanford University HighWire Press      http://highwire.stanford.edu/
+1 650 7237294 (Work)                   +1 650 7259335 (Fax)

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306141.html</link>
</item><item>
<title>[xsl] The benefits of exact selection - 11/6/2009 11:22:00 AM</title>
<description><![CDATA[<pre>Hi list

We always hear that we should select as exactly as possible, and that
wildcards are inefficient. It makes sense.

But I'm tired of just telling it to my students so I set out to
construct a little transformation test that can demonstrate it in the
classroom.

I ended up with a million lines subdivided into 1050 children, each
having 140 children, each having 3 children. In what I believe is the
last element in document order, I might be wrong, I added a lonely
attribute with some value.

The two alternative select expressions are as follows:

1)
&lt;xsl:value-of select=&quot;/document/colors[1050]/color[140]/dec/@num&quot;/&gt;
and
2)
&lt;xsl:value-of select=&quot;//@num&quot;/&gt;

Using Saxon PE from inside Oxygen, I transformed 20 times for each.
Here is the average time as reported by Oxygen:

1) Exact selection: 4.1s
2) Wildcard selection: 5.0s

That is a difference. But it is also fair to say that for most
transformations, on a small dataset, it will be impossible to measure
a difference of any importance.

I would like to know about real life cases where removing not
necessary wildcard matching improved the transformation speed?

Cheers
Jesper Tverskov

http://www.xmlkurser.dk
http://www.xmlplease.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306140.html</link>
</item><item>
<title>Re: [xsl] decimal vs double value spaces - 11/6/2009 7:14:00 AM</title>
<description><![CDATA[<pre>On Thu, Nov 5, 2009 at 10:23 PM, C. M. Sperberg-McQueen
&lt;cmsmcq@blackmesatech.com&gt; wrote:
&gt;
&gt; As far as I can tell (but I am not a numerical analyst), every
&gt; number expressible with a finite sequence of binary digits
&gt; can also be expressed with a finite sequence of decimal digits
&gt; (ten being divisible by two), so every number in the value
&gt; space of xs:double also makes an appearance in the value
&gt; space of xs:decimal. (Recall though that for simplicity XSD
&gt; treats all primitive value spaces as disjoint, so a sentence
&gt; like &quot;The value space of xs:double is a subset of the value
&gt; space of xs:decimal&quot; would provoke howls of pain from some
&gt; quarters.)
&gt;

I hope I'm taking this not too far off from this list's topic, but
one should see the point &quot;some quarters&quot; are trying to uphold.
While it is not debatable that the set of real numbers represented
by xs:double is a subset of those represented by xs:decimal, a
distinction must be made w.r.t. their respective value spaces
which happen to be part of different *data type* definitions. In
XML, data typing is associated with representation issues
such as facets; in programming languages distinctions are
being made by different (arithmetic) operations being applicable,
or by conversions, etc.

-W

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306130.html</link>
</item><item>
<title>Re: [xsl] decimal vs double value spaces - 11/5/2009 10:37:00 PM</title>
<description><![CDATA[<pre>&gt; Some numbers are in the decimal space but not in the double space.
&gt; For example, the decimal value space includes the value 0.1 (one
&gt; tenth), because that number can be represented using a finite
&gt; number of decimal digits. The double value space does not include
&gt; that number, because in binary notation the representation of that
&gt; number is a repeating fraction.

But there's a bit more nuance to it than that. 

First, xsd:double (aka an IEEE 754 &quot;double&quot; or &quot;binary64&quot;) has
distinct limits, with an approximate range of +/- 1.8 E 308 (base
10). So if you want to express a number larger than that positive or
smaller than that negative, you're out of luck. (Note that you
probably don't: 1.8 E 308 exceeds the estimate of the number of sub-
atomic particles in the universe by perhaps two hundred orders of
magnitude.)

Also a binary64 has the property of the gaps between representable
numbers being unequal -- they get larger as the numbers get further
from zero. There is actually an interesting formula for calculating
the space between representable numbers, but I don't remember it.

See
http://en.wikipedia.org/wiki/Double_precision_floating-point_format.

The point of the post is, in part, to say that if you want precision,
use xsd:decimal. If you need a (*very*) wide range of values and can
live without some precision, use xsd:double.[1]

Any more about this should probably be taken off-list, as it isn't
really that XSL-specific. (But it is interesting. :-)

Note
----
[1] This is precisely why the TEI data.decimal macro was defined as
    &quot;xsd:decimal | xsd:double&quot;.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306109.html</link>
</item><item>
<title>Re: [xsl] decimal vs double value spaces - 11/5/2009 9:24:00 PM</title>
<description><![CDATA[<pre>On 5 Nov 2009, at 04:28 , Justin Johansson wrote:

&gt; Would someone kindly enlighten me as to the difference in
&gt; the value spaces of xs:decimal's and xs:double's.

The xs:decimal value space contains every number expressible
in decimal notation using a finite number of digits.

The xs:double value space contains every number expressible
using a binary mantissa + exponent representation as
specified by IEEE 754.

Some numbers are in the decimal space but not in the double
space. For example, the decimal value space includes the
value 0.1 (one tenth), because that number can be represented
using a finite number of decimal digits.  The double value
space does not include that number, because in binary
notation the representation of that number is a repeating
fraction.

Some numbers are in neither space, e.g. the fraction 1/3,
which requires an infinitely repeating fraction both in
decimal and in binary.  And of course neither value space
contains any irrational numbers.

As far as I can tell (but I am not a numerical analyst), every
number expressible with a finite sequence of binary digits
can also be expressed with a finite sequence of decimal digits
(ten being divisible by two), so every number in the value
space of xs:double also makes an appearance in the value
space of xs:decimal. (Recall though that for simplicity XSD
treats all primitive value spaces as disjoint, so a sentence
like &quot;The value space of xs:double is a subset of the value
space of xs:decimal&quot; would provoke howls of pain from some
quarters.)

&gt;
&gt; I understand that the former doesn't lexically accept exponent
&gt; notation (E+02 e.g.) but note that some (possibly unfinished/
&gt; possibly naive) Java XPath engines internally represent xs:decimal and
&gt; xs:double as Java doubles thereby reducing the (internal) distinction
&gt; to nought.

I guess they are counting on the difference between the two
value spaces not to make much difference to their users.

Sometimes it doesn't; an implementor might well decide that
finishing the support for the sibling axes (or some other
feature) was more urgent than figuring out how to shift to
BigDecimal so that xs:decimal is supported properly.

If they think the implementation is conforming, though, I
think they are naive.

HTH

-- 
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com
* http://cmsmcq.com/mib
* http://balisage.net
****************************************************************





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306105.html</link>
</item><item>
<title>Re: [xsl] How to code with relative context: &quot;if the next node - 11/5/2009 6:02:00 PM</title>
<description><![CDATA[<pre>Ben Stover wrote:
&gt; I would like to copy something to the target XML doc context (!) depending from the value of a node on the same level.
&gt; 
&gt; It should all look similar to the following pseudo code:
&gt; 
&gt; ...assume we are on level/inside &lt;aaa&gt;&lt;bbb&gt;&lt;ccc&gt;
&gt; &lt;xs:if &lt;ddd&gt;...&lt;/ddd&gt; contains a non-whitespace value then&gt;
&gt;   &lt;mytext&gt;yes value found&lt;mytext&gt;
&gt; &lt;xs:else&gt;
&gt;   &lt;myothertext&gt;no value found&lt;/myothertext&gt;
&gt; &lt;/xs:if&gt;
&gt; ...
&gt; &lt;/ccc&gt;...&lt;/bbb&gt;....&lt;/aaa&gt;
&gt; 
&gt; How can I code this with XSLT ?
&gt; 
&gt; Again: If possible the condition should be context dependent. I don't want to code
&gt; the full XPath  /aaa/bbb/ccc/ddd in the &quot;if&quot; clause.
&gt; Instead the XPath expression should be relative to the current position

Well if you have
   &lt;xsl:template match=&quot;ccc&quot;&gt;
or maybe
   &lt;xsl:template match=&quot;aaa/bbb/ccc&quot;&gt;
then in that template you can certainly use
     &lt;xsl:choose&gt;
       &lt;xsl:when test=&quot;ddd[normalizes-space()]&quot;&gt;
         &lt;mytext&gt;yes value found&lt;mytext&gt;
       &lt;/xsl:when&gt;
       &lt;xsl:otherwise&gt;
         &lt;myothertext&gt;no value found&lt;/myothertext&gt;
       &lt;/xsl:otherwise&gt;
     &lt;/xsl:choose&gt;

-- 

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306098.html</link>
</item><item>
<title>[xsl] How to code with relative context: &quot;if the next node - 11/5/2009 5:57:00 PM</title>
<description><![CDATA[<pre>I would like to copy something to the target XML doc context (!) depending from the value of a node on the same level.

It should all look similar to the following pseudo code:

...assume we are on level/inside &lt;aaa&gt;&lt;bbb&gt;&lt;ccc&gt;
&lt;xs:if &lt;ddd&gt;...&lt;/ddd&gt; contains a non-whitespace value then&gt;
  &lt;mytext&gt;yes value found&lt;mytext&gt;
&lt;xs:else&gt;
  &lt;myothertext&gt;no value found&lt;/myothertext&gt;
&lt;/xs:if&gt;
...
&lt;/ccc&gt;...&lt;/bbb&gt;....&lt;/aaa&gt;

How can I code this with XSLT ?

Again: If possible the condition should be context dependent. I don't want to code
the full XPath  /aaa/bbb/ccc/ddd in the &quot;if&quot; clause.
Instead the XPath expression should be relative to the current position

Thank you 
Ben






--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306095.html</link>
</item><item>
<title>Re: [xsl] Benefits of using xsl:key - 11/5/2009 4:53:00 PM</title>
<description><![CDATA[<pre>Jesper,

At 04:34 AM 11/5/2009, you wrote:
&gt;The above is of cause only one type of dataset, but it shows to me
&gt;that xsl:key can make a big difference and that fine tuning a
&gt;template's match attribute can make a big difference.
&gt;
&gt;But it must all be done carefully, and it is necessary to analyze the
&gt;dataset to find the best approach, and to test different approaches in
&gt;order to find the best one (fast).

This thread is fascinating and informative: thanks for instigating it.

But I hasten to add that your findings are relevant to Saxon and may 
not (probably will not) be the same for other processors. There, use 
of key() may make less or (in many cases) even more of a difference.

This doesn't make the findings useless: on the contrary. But it does 
suggest, once again, that it is easy to overgeneralize when it comes 
to optimization. I can't count the times I have talked with students 
(usually fairly advanced ones) about contortions in their code, 
rationalized on the basis of optimization, which actually offered no 
effective advantages in practice. :-)

Cheers,
Wendell


======================================================================
Wendell Piez                            mailto:wapiez@mulberrytech.com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
   Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306092.html</link>
</item><item>
<title>Re: [xsl] Benefits of using xsl:key - 11/5/2009 4:46:00 PM</title>
<description><![CDATA[<pre>To complete the picture, I followed MK's advice and went to XMark - An
XML Benchmark Project, http://www.xml-benchmark.org/downloads.html,
and downloaded the ready-made-document of a 100 MB to see xsl:key at
work on a more realistic dataset.

To make transformations from inside Oxygen it was necessary to set
-Xmx256m up to -Xmx700m in oxygen.bat.

I used the following stylesheet:

&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; version=&quot;2.0&quot;&gt;
    &lt;!-- List the names of persons and the number of items they bought.
            (joins person, closed_auction) --&gt;
    &lt;xsl:output indent=&quot;yes&quot;/&gt;

       &lt;xsl:template match=&quot;/&quot;&gt;
           &lt;items&gt;
        &lt;xsl:for-each select=&quot;/site/people/person&quot;&gt;
            &lt;xsl:variable name=&quot;a&quot;
                select=&quot;/site/closed_auctions/closed_auction[buyer/@person =
                current()/@id]&quot;/&gt;
            &lt;item person=&quot;{name}&quot;&gt;&lt;xsl:value-of select=&quot;count($a)&quot;/&gt;&lt;/item&gt;
        &lt;/xsl:for-each&gt;
           &lt;/items&gt;
       &lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;

Saxon Home Edtion: 1. test: 876.9s, 2.test: 911.1s
Enterprise Edition: 1. test: 13.2s, 2. test: 13.0s both using
Optimization level 10.
Enterprise Edition: 3. test: 549.5s, 4. test: 556.5s using
Optimization level 1 and 5!

In Saxon's documentation we can read: &quot;currently all values other than
0 results in full optimization but this is likely to change in
future.&quot; I don't understand why optimization level 1 and 5 are not as
good as 10 considering the documentation,  and I don't understand why
someone would want less than full optimization?

I then used the stylesheet below using xsl:key:

Saxon Home Edition: 1. test: 12.8s, 2. test: 13.1
That is: xsl:key in Home Edition is as good as the build in
optimization level 10 in Enterprise Edition making xsl:key not
necessary in EE in most situations.

&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; version=&quot;2.0&quot;&gt;
    &lt;!-- List the names of persons and the number of items they bought.
            (joins person, closed_auction) --&gt;
    &lt;xsl:output indent=&quot;yes&quot;/&gt;
    &lt;xsl:key name=&quot;k&quot; match=&quot;/site/closed_auctions/closed_auction&quot;
use=&quot;buyer/@person&quot;/&gt;

       &lt;xsl:template match=&quot;/&quot;&gt;
           &lt;items&gt;
        &lt;xsl:for-each select=&quot;/site/people/person&quot;&gt;
            &lt;xsl:variable name=&quot;a&quot;
                select=&quot;key('k', @id)&quot;/&gt;
            &lt;item person=&quot;{name}&quot;&gt;&lt;xsl:value-of select=&quot;count($a)&quot;/&gt;&lt;/item&gt;
        &lt;/xsl:for-each&gt;
           &lt;/items&gt;
       &lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;

Cheers,
Jesper Tverskov
http://www.xmlplease.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306091.html</link>
</item><item>
<title>Re: [xsl] how to exclude namespaces from copy-of - 11/5/2009 3:53:00 PM</title>
<description><![CDATA[<pre>Thank you. That makes sense. I took your advice and created this template
    &lt;xsl:template match=&quot;*&quot; mode=&quot;fragment&quot;&gt;
        &lt;xsl:element name=&quot;{local-name()}&quot;&gt;
            &lt;xsl:value-of select=&quot;.&quot; /&gt;
            &lt;xsl:apply-templates select=&quot;*&quot; mode=&quot;fragment&quot; /&gt;
        &lt;/xsl:element&gt;
    &lt;/xsl:template&gt;

Now from another template that processes the atom feed item I call it 
like this:
            &lt;xsl:when test=&quot;@type='xhtml' or @type = 
'application/xhtml+xml'&quot;&gt;
                &lt;fragment&gt;
                        &lt;xsl:apply-templates mode=&quot;fragment&quot; 
select=&quot;xhtml:div&quot; /&gt;  
                &lt;/fragment&gt;
            &lt;/xsl:when&gt;
           &lt;xsl:when test=&quot;@type='html' or @type = 'text/html'&quot;&gt;
                &lt;xsl:value-of select=&quot;.&quot; /&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:otherwise&gt;
                &lt;xsl:value-of select=&quot;normalize-space()&quot; /&gt;
            &lt;/xsl:otherwise&gt;

IT works well now!


Michael Kay wrote:
&gt; Although xsl:copy-of in XSLT 2.0 can exclude unused namespaces
&gt; (copy-namespaces=&quot;no&quot;), it can't remove declarations of namespaces that are
&gt; actually in use. You don't actually want to make a copy of the data, you
&gt; want to transform it by changing the names of the elements. Remember that
&gt; the difference between &lt;rss/&gt; and &lt;rss xmlns=&quot;xyz&quot;/&gt; is not just a namespace
&gt; declaration - the two elements have different names. So you need to do a
&gt; &quot;renaming identity transform&quot; along the lines
&gt;
&gt; &lt;xsl:template match=&quot;*&quot;&gt;
&gt;   &lt;xsl:element name=&quot;{local-name()}&quot;&gt;
&gt;     &lt;xsl:apply-templates select=&quot;*&quot;/&gt;
&gt;   &lt;/xsl:element&gt;
&gt; &lt;/xsl:template&gt;
&gt;
&gt; Regards,
&gt;
&gt; Michael Kay
&gt; http://www.saxonica.com/
&gt; http://twitter.com/michaelhkay  
&gt;
&gt;   
&gt;&gt; -----Original Message-----
&gt;&gt; From: cert21 [mailto:cert21@ptd.net] 
&gt;&gt; Sent: 05 November 2009 15:13
&gt;&gt; To: xsl-list@lists.mulberrytech.com
&gt;&gt; Subject: [xsl] how to exclude namespaces from copy-of
&gt;&gt;
&gt;&gt; Hello!
&gt;&gt;
&gt;&gt; I am trying to parse the atom feed using the xsl template.
&gt;&gt;
&gt;&gt; The item in the feed contains this element: (example) &lt;div 
&gt;&gt; xmlns=&quot;http://www.w3.org/1999/xhtml&quot; 
&gt;&gt; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; 
&gt;&gt; xmlns:thr=&quot;http://purl.org/syndication/thread/1.0&quot;&gt;
&gt;&gt; &lt;p&gt;
&gt;&gt; October and November are busy months for Amazon Web 
&gt;&gt; Services!&lt;/p&gt; &lt;/div&gt;
&gt;&gt;
&gt;&gt; I want to copy the div with all its child elements, so I use 
&gt;&gt; copy-of The problem is that I don't want the 
&gt;&gt; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
&gt;&gt; or xmlns:dc or any other extra data in the div attribute
&gt;&gt;
&gt;&gt; I just want the result to be
&gt;&gt; &lt;div&gt;
&gt;&gt; &lt;p&gt;
&gt;&gt; October and November are busy months for Amazon Web 
&gt;&gt; Services!&lt;/p&gt; &lt;/div&gt;
&gt;&gt;
&gt;&gt; How can I do this?
&gt;&gt;
&gt;&gt; Thank you.
&gt;&gt;
&gt;&gt;     
&gt;


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306088.html</link>
</item><item>
<title>RE: [xsl] how to exclude namespaces from copy-of - 11/5/2009 3:27:00 PM</title>
<description><![CDATA[<pre>Although xsl:copy-of in XSLT 2.0 can exclude unused namespaces
(copy-namespaces=&quot;no&quot;), it can't remove declarations of namespaces that are
actually in use. You don't actually want to make a copy of the data, you
want to transform it by changing the names of the elements. Remember that
the difference between &lt;rss/&gt; and &lt;rss xmlns=&quot;xyz&quot;/&gt; is not just a namespace
declaration - the two elements have different names. So you need to do a
&quot;renaming identity transform&quot; along the lines

&lt;xsl:template match=&quot;*&quot;&gt;
  &lt;xsl:element name=&quot;{local-name()}&quot;&gt;
    &lt;xsl:apply-templates select=&quot;*&quot;/&gt;
  &lt;/xsl:element&gt;
&lt;/xsl:template&gt;

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay  

&gt; -----Original Message-----
&gt; From: cert21 [mailto:cert21@ptd.net] 
&gt; Sent: 05 November 2009 15:13
&gt; To: xsl-list@lists.mulberrytech.com
&gt; Subject: [xsl] how to exclude namespaces from copy-of
&gt; 
&gt; Hello!
&gt; 
&gt; I am trying to parse the atom feed using the xsl template.
&gt; 
&gt; The item in the feed contains this element: (example) &lt;div 
&gt; xmlns=&quot;http://www.w3.org/1999/xhtml&quot; 
&gt; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; 
&gt; xmlns:thr=&quot;http://purl.org/syndication/thread/1.0&quot;&gt;
&gt; &lt;p&gt;
&gt; October and November are busy months for Amazon Web 
&gt; Services!&lt;/p&gt; &lt;/div&gt;
&gt; 
&gt; I want to copy the div with all its child elements, so I use 
&gt; copy-of The problem is that I don't want the 
&gt; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
&gt; or xmlns:dc or any other extra data in the div attribute
&gt; 
&gt; I just want the result to be
&gt; &lt;div&gt;
&gt; &lt;p&gt;
&gt; October and November are busy months for Amazon Web 
&gt; Services!&lt;/p&gt; &lt;/div&gt;
&gt; 
&gt; How can I do this?
&gt; 
&gt; Thank you.
&gt; 
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt; 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306087.html</link>
</item><item>
<title>[xsl] how to exclude namespaces from copy-of - 11/5/2009 3:13:00 PM</title>
<description><![CDATA[<pre>Hello!

I am trying to parse the atom feed using the xsl template.

The item in the feed contains this element: (example)
&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot; 
xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; 
xmlns:thr=&quot;http://purl.org/syndication/thread/1.0&quot;&gt;
&lt;p&gt;
October and November are busy months for Amazon Web Services!&lt;/p&gt;
&lt;/div&gt;

I want to copy the div with all its child elements, so I use copy-of
The problem is that I don't want the xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
or xmlns:dc or any other extra data in the div attribute

I just want the result to be
&lt;div&gt;
&lt;p&gt;
October and November are busy months for Amazon Web Services!&lt;/p&gt;
&lt;/div&gt;

How can I do this?

Thank you.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306086.html</link>
</item><item>
<title>RE: [xsl] decimal vs double value spaces - 11/5/2009 11:49:00 AM</title>
<description><![CDATA[<pre>The value space of xs:double is fully defined in the spec, based on IEEE
specifications.

The value space of xs:decimal isn't fully defined, in that limits on the
number of digits are implementation-defined. However, every value in the
xs:decimal value space is a multiples of 10^-n where n is
implementation-defined, and so long as you're within the expected number of
digits, decimal arithmetic should be exact, whereas double arithmetic in
general will involve rounding on input and output (that is, conversion from
string-&gt;double and from double-&gt;string).

&gt; but note that some (possibly 
&gt; unfinished/ possibly naive) Java XPath engines internally 
&gt; represent xs:decimal and xs:double as Java doubles 

Representing xs:decimal using Java doubles will give completely
non-conformant results which I don't think can be justified by any appeal to
the implementation-defined limits on precision.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306076.html</link>
</item><item>
<title>[xsl] decimal vs double value spaces - 11/5/2009 11:29:00 AM</title>
<description><![CDATA[<pre>Would someone kindly enlighten me as to the difference in
the value spaces of xs:decimal's and xs:double's.

I understand that the former doesn't lexically accept exponent
notation (E+02 e.g.) but note that some (possibly unfinished/
possibly naive) Java XPath engines internally represent xs:decimal and
xs:double as Java doubles thereby reducing the (internal) distinction
to nought.

Thanks for all help,

Justin


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306075.html</link>
</item><item>
<title>Re: [xsl] Benefits of using xsl:key - 11/5/2009 9:35:00 AM</title>
<description><![CDATA[<pre>I think I got MK's idea wrong in the stylesheet I presented in my last
mail, but it is now corrected at the end of this mail, and it works as
I said.

To wrap it all up, I have made two datasets, one with only two
distinct values of 3000 and the other with 2992 distinct values of
3000. These two datasets are only about duplicate values. The test is
only an indication of how xsl:key can be useful with this type of
dataset.

Since optimization in Saxon EE isn't useful for duplicates, I have
only made this test with Saxon HE (Home Edition), formerly known as
Saxon B for &quot;basics&quot;.

far-from-distinct-values.xml
2 distinct out of 3000
1) no key: 13.1s
2) using key: 0.1
3) also key in match: 5.4s

almost-distinct-values.xml
2992 distinct out of 3000
4) no key: 3.6s
5) using key: 3.6
6) also key in match: 0.1s

MK has explained why 2 works better than 3 and why 6 works better than 5.

The above is of cause only one type of dataset, but it shows to me
that xsl:key can make a big difference and that fine tuning a
template's match attribute can make a big difference.

But it must all be done carefully, and it is necessary to analyze the
dataset to find the best approach, and to test different approaches in
order to find the best one (fast).

Here is the corrected example of using xsl:key in the match attribute:

&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; version=&quot;2.0&quot;&gt;
    &lt;xsl:key name=&quot;item-content&quot; match=&quot;item&quot; use=&quot;.&quot;/&gt;

    &lt;xsl:template match=&quot;item[. is key('item-content', current())[1]]&quot;&gt;
        &lt;xsl:copy&gt;
            &lt;xsl:apply-templates select=&quot;@*|node()&quot;/&gt;
        &lt;/xsl:copy&gt;
    &lt;/xsl:template&gt;

    &lt;xsl:template match=&quot;item&quot;&gt;
        &lt;xsl:copy&gt;
            &lt;!-- add attribute and skip content --&gt;
            &lt;xsl:attribute name=&quot;refid&quot; select=&quot;key('item-content', .)[1]/@id&quot;/&gt;
            &lt;xsl:apply-templates select=&quot;@*&quot;/&gt;
        &lt;/xsl:copy&gt;
    &lt;/xsl:template&gt;

    &lt;xsl:template match=&quot;@*|node()&quot;&gt;
        &lt;xsl:copy&gt;
            &lt;xsl:apply-templates select=&quot;@*|node()&quot;/&gt;
        &lt;/xsl:copy&gt;
    &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;

cheers,
Jesper

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306069.html</link>
</item><item>
<title>RE: [xsl] Benefits of using xsl:key - 11/4/2009 9:19:00 PM</title>
<description><![CDATA[<pre>&gt; 
&gt; That the optimization option in Saxon EE often makes it not 
&gt; necessary to use xsl:key 

Correct.

&gt; but that in many situations you can 
&gt; obtain even greater performance by fine tuning the match 
&gt; attribute by hand using xsl:key?

I'd say &quot;some situations&quot;. Particularly those situations where keys are
being used for Muenchian grouping, duplicates elimination etc. Even better
is to rewrite such applications to use xsl:for-each-group or
distinct-values().

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306042.html</link>
</item><item>
<title>Re: [xsl] Benefits of using xsl:key - 11/4/2009 8:20:00 PM</title>
<description><![CDATA[<pre>Have I understood the last example right:

That the optimization option in Saxon EE often makes it not necessary
to use xsl:key but that in many situations you can obtain even greater
performance by fine tuning the match attribute by hand using xsl:key?

Cheers,
Jesper

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306039.html</link>
</item><item>
<title>Re: [xsl] Benefits of using xsl:key - 11/4/2009 7:55:00 PM</title>
<description><![CDATA[<pre>MK  wrote:
&gt; I would suggest one template match=&quot;x[.
&gt; is key('k', current())[1]]&quot; to match the first duplicate, and another
&gt; match=&quot;x&quot; with lower priority to match the remaining duplicates.

It works!

I changed XSLT stylesheet using xsl:key to this:

&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; version=&quot;2.0&quot;&gt;
    &lt;xsl:key name=&quot;value-content&quot; match=&quot;value&quot; use=&quot;.&quot;/&gt;

    &lt;xsl:template match=&quot;value[. is key('value-content', current())[1]]&quot;&gt;
        &lt;xsl:copy&gt;
            &lt;!-- add attribute and skip content --&gt;
            &lt;xsl:attribute name=&quot;refid&quot; select=&quot;key('value-content',
.)[1]/@id&quot;/&gt;
            &lt;xsl:apply-templates select=&quot;@*&quot;/&gt;
        &lt;/xsl:copy&gt;
    &lt;/xsl:template&gt;

    &lt;xsl:template match=&quot;@*|node()&quot;&gt;
        &lt;xsl:copy&gt;
            &lt;xsl:apply-templates select=&quot;@*|node()&quot;/&gt;
        &lt;/xsl:copy&gt;
    &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;

Transformation using xsl:key is now back at 0.1s!!!

Cheers,
Jesper

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306035.html</link>
</item><item>
<title>RE: [xsl] Benefits of using xsl:key - 11/4/2009 7:36:00 PM</title>
<description><![CDATA[<pre>&gt; 
&gt; I have now made a new input file. I transformed the original 
&gt; input fil to a new input file making all the id attribute 
&gt; values unique, and also all the content unique. I then hand 
&gt; edited the new file for 15 of the elements, making the 
&gt; content the same for some other element.
&gt; 
&gt; The transformation with Saxon HE, PE and EE  without using 
&gt; xsl:key is now much faster, 4.5s, but, as a big surprise (to 
&gt; me), the use of xsl:key has no influence on the 
&gt; transformation speed still being 4.5s, and also the 
&gt; optimization option in EE has no effect!

I thought I explained why that should be expected. Your match pattern
match=&quot;x[.=preceding::x]&quot; is intrinsically very inefficient, but by chance
it was performing OK because the distance between duplicates was always
small. You have now increased the distance between duplicates, so the match
pattern becomes more expensive, and gives quadratic performance with
document size. 
&gt; 
&gt; I'm a little confused. My conclusion is that xsl:key can make 
&gt; a transformation faster in some situations. It very much 
&gt; depends on data.
&gt; 

Using keys will only speed things up if you use them in a place where the
performance is critical. You now have very few duplicates, so you are not
executing the body of the template very often, so speeding it up gives very
little benefit. Instead you need to speed up the match pattern, which you
can do by rewriting it to use key(): I would suggest one template match=&quot;x[.
is key('k', current())[1]]&quot; to match the first duplicate, and another
match=&quot;x&quot; with lower priority to match the remaining duplicates.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306034.html</link>
</item><item>
<title>Re: [xsl] Benefits of using xsl:key - 11/4/2009 7:23:00 PM</title>
<description><![CDATA[<pre>I have made a more realistic input file, but it leads to new results
reminding me of my first statement: It is difficult to create a test
example showing that xsl:key can speed up the transformation.

In the original example, three elements were copied and pasted over
and over again to create a file of 3000 lines. This gave an input file
with only two elements having different content. The speed difference
in usig xsl:key or not was close to 1:100. (10s/0.1s).

I have now made a new input file. I transformed the original input fil
to a new input file making all the id attribute values unique, and
also all the content unique. I then hand edited the new file for 15 of
the elements, making the content the same for some other element.

The transformation with Saxon HE, PE and EE  without using xsl:key is
now much faster, 4.5s, but, as a big surprise (to me), the use of
xsl:key has no influence on the transformation speed still being 4.5s,
and also the optimization option in EE has no effect!

I'm a little confused. My conclusion is that xsl:key can make a
transformation faster in some situations. It very much depends on
data.

Question: What is the rule of thumb for data sets where the use of
xsl:key is likely to make a big difference?

Cheers,
Jesper

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306033.html</link>
</item><item>
<title>Re: [xsl] Condition problem - 11/4/2009 6:09:00 PM</title>
<description><![CDATA[<pre>On 4 Nov 2009, at 03:29 , Michael Kay wrote:
&gt; ... First some comments:
&gt;&gt;
&gt;&gt; 	&lt;xsl:when test=&quot;matches(.,'-') or matches(.,'-')&quot;&gt;
&gt;
&gt; Why repeat the condition?

Actually, the two literals being tests are different characters
(here, and elsewhere in the code where there appear at first
glance to be duplicate tests):  hyphen and en-dash.

It looks to me as if in cutting down the problem you omitted
some crucial control structures; I guess your full code contains
one or more for-each constructs to iterate.

Without the code in front of us it's hard to be sure, but from
the sample output you give, my guess is that when generating
the refid attribute your full code first looks for ranges
and supplies the items in the range, and then handles all of
the cr children that are not either the start or the end of
a range.  And (again, judging from your sample input and
output), you want the items mentioned in the refid attribute
to be listed in the order in which they appear (explicitly or
implicitly) in the cr elements in the document.

My first advice would be: replace the contents of

   &lt;xsl:attribute name=&quot;refid&quot;&gt;
    ...
   &lt;/xsl:attribute&gt;

with a call to apply-templates, using a new mode:

   &lt;xsl:attribute name=&quot;refid&quot;&gt;
     &lt;xsl:apply-templates mode=&quot;supply-refid-target-values&quot;  
select=&quot;cr&quot;/&gt;
   &lt;/xsl:attribute&gt;

Then write three templates to handle the three kinds of cr
elements you have:

   (1) a cr element followed by a hyphen or an en-dash; it
       begins a range, so find the end of the range and emit
       the appropriate bibNN tokens, separated by blanks
   (2) a cr element preceded by a hyphen or an en-dash;
       it ends a range, so it has been handled by the
       first template, and should do nothing
   (3) any other cr element (followed by comma or nothing);
       it isn't a range, so just emit its bibNN token and
       a trailing blank

I hope this helps.

Michael Sperberg-McQueen


-- 
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com
* http://cmsmcq.com/mib
* http://balisage.net
****************************************************************





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306030.html</link>
</item><item>
<title>Re: [xsl] good Open source IDE Tool for XSL - 11/4/2009 5:36:00 PM</title>
<description><![CDATA[<pre>On 3 Nov 2009, at 05:20 , Syd Bauman wrote:

&gt;&gt; I am Looking for good Open source IDE Tool for XSL Development.
&gt;&gt; Please suggest me some good tool.
&gt;
&gt; ...
&gt; C. Michael Sperberg-McQueen of Black Mesa technologies gave a talk on
&gt; open source tools for XML development in late summer or early  
&gt; fall. ...


The slides for that talk, given at the XML Summer School in Oxford
organized by Eleven Informatics, are on the Web at

   http://www.blackmesatech.com/2009/09/flossxml

The boundary between XML editors with some useful additional
tools and XML / XSLT IDEs appears fuzzy to me (like a lot of
other category boundaries in this area), so the categorization
of products into groups should not be taken too seriously.

The discussion thread here has mentioned several additional
products not included in my lists; I'll have to add some new
entries ...	

-- 
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com
* http://cmsmcq.com/mib
* http://balisage.net
****************************************************************





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306026.html</link>
</item><item>
<title>Re: [xsl] good Open source IDE Tool for XSL - 11/4/2009 5:23:00 PM</title>
<description><![CDATA[<pre>Syd,

Back in the day, Tony Graham had an Emacs mode for XSLT 1.0, xslide. 
Your search engine will show you more. Tony, are you on this channel?

(Not that I want to lure you away from oXygen, which is worth every 
penny and then some in my experience.)

Cheers,
Wendell

At 11:42 AM 11/4/2009, you wrote:
&gt;It would take a lot to make me switch from oXygen. (It took a lot,
&gt;including the steep academic discount, to get me to use it in the
&gt;first place -- I generally prefer open source applications.) But if
&gt;anyone is interested in writing a powerful Emacs mode for XSLT, I'd
&gt;be interested in joining forces. (Like I have time for that?) The
&gt;most important feature to me is completion, and oXygen does a really
&gt;good job of it (completion w/o requiring use of the mouse for element
&gt;names, attribute names, attribute values, variable names, template
&gt;names, xml:id= values, XPath components, and maybe more). But the
&gt;good news is that's probably not too hard to duplicate in Emacs.



======================================================================
Wendell Piez                            mailto:wapiez@mulberrytech.com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
   Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306025.html</link>
</item><item>
<title>Re: [xsl] good Open source IDE Tool for XSL - 11/4/2009 4:50:00 PM</title>
<description><![CDATA[<pre>-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Syd Bauman wrote:

&gt; BMi&gt; The Eclipse XSL Developer Tools, part of the WST, aren't bad either -  
&gt; BMi&gt; particularly if you are using Eclipse for any other work.
&gt; 
&gt; Don't know anything about them. But I'm not likely to even try
&gt; anything that lists support for schema languages but not RELAX NG.

My student Martin Schmied developed RELAX NG support for Eclipse
recently. But it will take some time to undergo Eclipse process before
being added into Web Tools Project plugin.

http://wiki.eclipse.org/WTP/RelaxNG/Proposal

&gt; also huge plusses. But it's the completion I couldn't live without.
&gt; :-)

Yep, it is hard to beat oXygen in completion.

- --
- ------------------------------------------------------------------
  Jirka Kosek      e-mail: jirka@kosek.cz      http://xmlguru.cz
- ------------------------------------------------------------------
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
- ------------------------------------------------------------------
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
- ------------------------------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrxsKUACgkQzwmSw7n0dR6CjQCguwCcVjL/glxy7WhNWsSnzDBi
AOIAn3VtindgeLg4Wvx7gNsSIMUtewej
=GD4A
-----END PGP SIGNATURE-----

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306022.html</link>
</item><item>
<title>Re: [xsl] good Open source IDE Tool for XSL - 11/4/2009 4:43:00 PM</title>
<description><![CDATA[<pre>I'm glad this question was asked. Although it's off the beaten path
of &quot;how do I accomplish such-and-such&quot;, I've learned a bit I didn't
know in an area that's interesting (to me, at least :-)


BMi&gt; The Eclipse XSL Developer Tools, part of the WST, aren't bad either -  
BMi&gt; particularly if you are using Eclipse for any other work.

Don't know anything about them. But I'm not likely to even try
anything that lists support for schema languages but not RELAX NG.


VCh&gt; How could people forget to mention Marrowsoft Xselerator?

As this is a Windows-only product, I have never seen it, and probably
will never use it no matter how good it is. But you never know ...


BMa&gt; I personally use kate and I'm very happy with it ;-)

I had never heard of kate, as I mostly use GNU/Linux without a
windowing system. But at quick glance it looks like it may be a very
reasonable solution for an XML aware editing environment. It may not
be powerful enough to satisfy Anil Kumar Veeramalli's use case, but
looks like it is certainly worth a try.


It would take a lot to make me switch from oXygen. (It took a lot,
including the steep academic discount, to get me to use it in the
first place -- I generally prefer open source applications.) But if
anyone is interested in writing a powerful Emacs mode for XSLT, I'd
be interested in joining forces. (Like I have time for that?) The
most important feature to me is completion, and oXygen does a really
good job of it (completion w/o requiring use of the mouse for element
names, attribute names, attribute values, variable names, template
names, xml:id= values, XPath components, and maybe more). But the
good news is that's probably not too hard to duplicate in Emacs.

Yes, a good XSLT IDE should also let you run the XSLT with one or two
keystrokes, and let you see the output of the run in the app of your
choice; and having built-in XSLT documentation and XSLT debugger are
also huge plusses. But it's the completion I couldn't live without.
:-)

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306021.html</link>
</item><item>
<title>RE: [xsl] How to concatenate/merge two independent XSLT stylesheets - 11/4/2009 1:52:00 PM</title>
<description><![CDATA[<pre>There are much more efficient ways of creating a pipeline than using &quot;|&quot; on
the command line, but presumably they are ruled out too.

There's no foolproof way of doing this without manually checking for
conflicting names of templates, global variables, keys etc. If you've been
very disciplined then these will all be in namespaces, and it will all be
much easier, but unless you are a very faithful disciple of Ken Holman then
this is unlikely to be the case.

You should change one of the stylesheets (or preferably both) to use named
modes on all template rules and calls of apply-templates.

Then finally you can stitch them together with

&lt;xsl:template match=&quot;/&quot;&gt;
  &lt;xsl:variable name=&quot;temp&quot;&gt;
    &lt;xsl:apply-templates select=&quot;.&quot; mode=&quot;phase1&quot;/&gt;
  &lt;/xsl:variable&gt;
  &lt;xsl:apply-templates select=&quot;$temp&quot; mode=&quot;phase2&quot;/&gt;
&lt;/xsl:template&gt;

Alternatively, if you don't mind a product-specific solution, use
saxon:next-in-chain on the xsl:output element.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay  

&gt; 
&gt; I have two independent XSLT style sheets which work fine when 
&gt; they are executed in two steps:
&gt; 
&gt; mydoc1.xml--&gt;mysheet1.xsl--&gt;mydoc2.xml--&gt;mysheet2.xsl--&gt;mydoc3.xml
&gt; 
&gt; However I would like to avoid the intermediate step (and the 
&gt; creation of mydoc2.xml).
&gt; Is there a way to concatenate the two XSLT stylesheets resp. 
&gt; use the output of the first stylesheet templates as input of 
&gt; second stylesheet templates?
&gt; 
&gt; Due to other requirements a piping with the well known pipe 
&gt; symbol (|) on the console is NOT allowed. The two stylesheets 
&gt; MUST be merged together somehow into ONE physical stylesheet file.
&gt; 
&gt; How can I do this?
&gt; 
&gt; Ben
&gt; 
&gt; 
&gt; 
&gt; 
&gt; 
&gt; 
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt; 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306012.html</link>
</item><item>
<title>Re: [xsl] How to concatenate/merge two independent XSLT stylesheets - 11/4/2009 1:27:00 PM</title>
<description><![CDATA[<pre>Ben Stover wrote:
&gt; I have two independent XSLT style sheets which work fine when they are executed 
&gt; in two steps:
&gt; 
&gt; mydoc1.xml--&gt;mysheet1.xsl--&gt;mydoc2.xml--&gt;mysheet2.xsl--&gt;mydoc3.xml
&gt; 
&gt; However I would like to avoid the intermediate step (and the creation of mydoc2.xml).
&gt; Is there a way to concatenate the two XSLT stylesheets resp. use the output of
&gt; the first stylesheet templates as input of second stylesheet templates?

Saxon has an extension attribute for xsl:output:
http://www.saxonica.com/documentation/extensions/output-extras/next-in-chain.html
so you could use

   &lt;xsl:stylesheet
     xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
     xmlns:saxon=&quot;http://saxon.sf.net/&quot;
     exclude-result-prefixes=&quot;saxon&quot;
     version=&quot;2.0&quot;&gt;

     &lt;xsl:import href=&quot;mysheet1.xsl&quot;/&gt;

     &lt;xsl:output
       saxon:next-in-chain=&quot;mysheet2.xsl&quot;/&gt;


   &lt;/xsl:stylesheet&gt;

-- 

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306011.html</link>
</item><item>
<title>Re: [xsl] How to concatenate/merge two independent XSLT stylesheets - 11/4/2009 1:22:00 PM</title>
<description><![CDATA[<pre>2009/11/4 Ben Stover &lt;bxstover@yahoo.co.uk&gt;:
&gt; I have two independent XSLT style sheets which work fine when they are executed
&gt; in two steps:
&gt;
&gt; mydoc1.xml--&gt;mysheet1.xsl--&gt;mydoc2.xml--&gt;mysheet2.xsl--&gt;mydoc3.xml
&gt;
&gt; However I would like to avoid the intermediate step (and the creation of mydoc2.xml).
&gt; Is there a way to concatenate the two XSLT stylesheets resp. use the output of
&gt; the first stylesheet templates as input of second stylesheet templates?
&gt;
&gt; Due to other requirements a piping with the well known pipe symbol (|) on the console
&gt; is NOT allowed. The two stylesheets MUST be merged together somehow into ONE physical
&gt; stylesheet file.
&gt;
&gt; How can I do this?

In the simplest scenario its just case of creating a &quot;mysheet3.xsl&quot;
that imports the other 2 :

&lt;xsl:import href=&quot;mysheet1.xsl&quot;/&gt;
&lt;xsl:import href=&quot;mysheet2.xsl&quot;/&gt;

&lt;xsl:variable name=&quot;pass1&quot;&gt;
  &lt;xsl:for-each select=&quot;doc('mydoc1.xml')&quot;&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/xsl:for-each&gt;
&lt;xsl:variable&gt;

&lt;xsl:template match=&quot;/&quot;&gt;
  &lt;xsl:apply-templates select=&quot;$pass1/*&quot;/&gt;
&lt;/xsl:template&gt;

However this will only go smoothly if the elements in mydoc1.xml and
the intermediate &quot;mydoc2&quot; are different... if some are the same to
avoid the first pass templates confictling with the second pass (and
vice versa) then you'll need to use modes.


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306010.html</link>
</item><item>
<title>Re: [xsl] How to concatenate/merge two independent XSLT stylesheets - 11/4/2009 1:19:00 PM</title>
<description><![CDATA[<pre>At 2009-11-04 14:12 +0100, Ben Stover wrote:
&gt;I have two independent XSLT style sheets which work fine when they 
&gt;are executed
&gt;in two steps:
&gt;
&gt;mydoc1.xml--&gt;mysheet1.xsl--&gt;mydoc2.xml--&gt;mysheet2.xsl--&gt;mydoc3.xml
&gt;
&gt;However I would like to avoid the intermediate step (and the 
&gt;creation of mydoc2.xml).
&gt;Is there a way to concatenate the two XSLT stylesheets resp. use the output of
&gt;the first stylesheet templates as input of second stylesheet templates?
&gt;
&gt;Due to other requirements a piping with the well known pipe symbol 
&gt;(|) on the console
&gt;is NOT allowed. The two stylesheets MUST be merged together somehow 
&gt;into ONE physical
&gt;stylesheet file.
&gt;
&gt;How can I do this?

You can use modes and, in XSLT 2.0, temporary trees, though it will 
require you to modify the stylesheets and not use them untouched as 
they exist now.  You don't have to use named modes for both steps ... 
you can use the default unnamed mode for one of the two steps.

The pattern would be along the lines of:

   &lt;xsl:variable name=&quot;intermediate&quot;&gt;
     &lt;xsl:apply-templates mode=&quot;step1&quot;/&gt;
   &lt;/xsl:variable&gt;
   &lt;xsl:apply-templates select=&quot;$intermediate&quot;/&gt;

or ....

   &lt;xsl:variable name=&quot;intermediate&quot;&gt;
     &lt;xsl:apply-templates/&gt;
   &lt;/xsl:variable&gt;
   &lt;xsl:apply-templates select=&quot;$intermediate&quot; mode=&quot;step2&quot;/&gt;

... where each stylesheet's template matches are all in the same mode.

Namespace-qualifying your top-level constructs may help too, to avoid 
overriding declarations.

If you have to do this with XSLT 1 then you'll need to use a 
vendor-supported extension to act on the node set of the result tree fragment.

I hope this helps.

. . . . . . . . . . . . . Ken

--
Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
Interested in other classes?  http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306009.html</link>
</item><item>
<title>[xsl] How to concatenate/merge two independent XSLT stylesheets into - 11/4/2009 1:13:00 PM</title>
<description><![CDATA[<pre>I have two independent XSLT style sheets which work fine when they are executed 
in two steps:

mydoc1.xml--&gt;mysheet1.xsl--&gt;mydoc2.xml--&gt;mysheet2.xsl--&gt;mydoc3.xml

However I would like to avoid the intermediate step (and the creation of mydoc2.xml).
Is there a way to concatenate the two XSLT stylesheets resp. use the output of
the first stylesheet templates as input of second stylesheet templates?

Due to other requirements a piping with the well known pipe symbol (|) on the console
is NOT allowed. The two stylesheets MUST be merged together somehow into ONE physical
stylesheet file.

How can I do this?

Ben






--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306008.html</link>
</item><item>
<title>Re: [xsl] SOAP extension compatible with AltovaXML - 11/4/2009 11:06:00 AM</title>
<description><![CDATA[<pre>Fabre Lambeau wrote:

  Hi,

&gt; Has anyone come across (or implemented) a SOAP or http-send
&gt; extension for XSLT 2.0 that would work with the AltovaXML
&gt; processor?

  None that I am aware of.  My first advice would be to see if
you can switch to Saxon 9.

  If you cannot, the implementation (in Java) of the EXPath HTTP
Client is (I think) quite properly decoupled between what's Saxon
specific and the rest (if I remember well, the Apache HTTP Client
stuff is not that well entirely isolated in its own layer.)

  For what I've seen on the AltovaXML doc, it supports calling
Java methods, so if you're really interrested, you should be able
to replace the Saxon layer of EXPath HTTP Client (mostly dealing
with parsing the http:request element and serializing the
http:response element.)  They do not say how they pass XDM nodes
to Java though (they only document how atomic types are mapped to
Java types.)

  If you're interested, please join the EXPath mailing list
&lt;http://www.expath.org/lists.html&gt; to ask for more information.

  Regards,

-- 
Florent Georges
http://www.fgeorges.org/























      


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000306002.html</link>
</item><item>
<title>RE: [xsl] Condition problem - 11/4/2009 10:30:00 AM</title>
<description><![CDATA[<pre>&gt; I am having the following input:

Let's concentrate on the 4th line of input. (It would have made life easier
if you had cut the problem down further)
&gt; 
Input
&gt; 
&gt; &lt;cross-ref&gt;[&lt;cr refid=&quot;MEP_L_bib17&quot;&gt;17&lt;/cr&gt;-&lt;cr
refid=&quot;MEP_L_bib29&quot;&gt;29&lt;/cr&gt;,
   &lt;cr refid=&quot;MEP_L_bib43&quot;&gt;43&lt;/cr&gt;,&lt;cr
refid=&quot;MEP_L_bib44&quot;&gt;44&lt;/cr&gt;]&lt;/cross-ref&gt;
&gt; 
&gt; Actual output:
&gt; 
&gt; &lt;ce:cross-refs refid=&quot;bib43 bib44 bib27 bib28
bib29&quot;&gt;[27&amp;#x02013;29,43,44]&lt;/ce:cross-refs&gt;
&gt; 
&gt; Required output:
&gt; 
&gt; &lt;ce:cross-refs refid=&quot;bib27 bib28 bib29 bib43
bib44&quot;&gt;[27&amp;#x02013;29,43,44]&lt;/ce:cross-refs&gt;
&gt; 
&gt; 
&gt; This the code I have tried.

As Andrew points out, this clearly isn't your code - you've introduced bugs
when cutting it down, and it's difficult to disentangle those bugs from your
original bugs. I'm afraid I really can't see how you expect to get the &quot;27
28 29&quot; sequence from your &quot;17-29&quot; input, or how you actually got it but in
the wrong place. Perhaps your input was actually &quot;27&quot; rather than &quot;17&quot; (Oh
this is fun, thank you for giving us so much pleasure by adding such twists
to the problem.) First some comments:
&gt; 
&gt; 	&lt;xsl:when test=&quot;matches(.,'-') or matches(.,'-')&quot;&gt;

Why repeat the condition?
&gt; 				&lt;xsl:if 
&gt; test=&quot;cr[following-sibling::node()[1]!='-'][preceding-sibling:
&gt; :node()[1]!='-'][following-sibling::node()[1]!='-'][preceding-
&gt; sibling::node()[1]!='-']&quot;&gt;

Why repeat the conditions?
&gt; 					&lt;xsl:value-of
&gt; select=&quot;cr[following-sibling::node()[1]!='-'][preceding-siblin
&gt; g::node()[1]!='-'][following-sibling::node()[1]!='-'][precedin
&gt; g-sibling::node()[1]!='-'][following::text()[contains(current(
&gt; ),'-')]]/substring-after(@refid,'MEP_L_')&quot;/&gt;

(a) Why repeat the conditions?

(b) The use of following-text() rather than following-text()[1] looks
questionable

(c) The use of current() rather than &quot;.&quot; looks questionable

I strongly suspect, though I haven't tested the hypothesis because it would
involve fixing your other bugs first, that when you write

&lt;xsl:if test=&quot;cr/@refid[contains(., 'bib')] and
cr[following-sibling::node()[1]='-']&quot;&gt;

or similar constructs in other places, you are assuming that the two
conditions must apply to the same cr child. That is, you should have written

test=&quot;cr[contains(@refid, 'bib') and following-sibling::node()[1]='-']&quot;&gt;

Similarly, I suspect that when, having tested this condition, you write
something like

&lt;xsl:variable name=&quot;starth&quot;
select=&quot;cr[following-sibling::node()[1]='-']/substring-after(@refid,'MEP_L_b
ib')&quot;/&gt;

you might be imagining that this will inevitably select the same cr element
that satisfied the condition in the &lt;xsl:if&gt;

In fact, the more I look at your code, the more I find it incomprehensible
that anything like this ever worked. You don't seem to be handling the case
where there are multiple ranges in your input at all, and yet you claim to
be handling some such cases correctly.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305999.html</link>
</item><item>
<title>Re: [xsl] Condition problem - 11/4/2009 10:13:00 AM</title>
<description><![CDATA[<pre>2009/11/4 Michael Kay &lt;mike@saxonica.com&gt;:
&gt;&gt; &gt;
&gt;&gt; &gt; I am having the following input:
&gt;&gt; &gt;
&gt;&gt; &gt; &lt;cross-ref&gt;[&lt;cr refid=&quot;MEP_L_bib32&quot;&gt;32&lt;/cr&gt;-&lt;cr
&gt;&gt; &gt; refid=&quot;MEP_L_bib35&quot;&gt;35&lt;/cr&gt;]&lt;/cross-ref&gt;
&gt;&gt; &gt;
&gt;&gt; &gt; &lt;cross-ref&gt;[&lt;cr refid=&quot;MEP_L_bib23&quot;&gt;23&lt;/cr&gt;-&lt;cr
&gt;&gt;
&gt;&gt;
&gt;&gt; That's not well-formed...
&gt;
&gt; It's well-formed if you add a wrapper element. Strange, but well-formed.
&gt;

I guess you are making a point about rootless trees and the possibly
odd requirement there must be single root element?  (as opposed to
pointing out the obvious to me)





-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305998.html</link>
</item><item>
<title>RE: [xsl] Condition problem - 11/4/2009 10:04:00 AM</title>
<description><![CDATA[<pre>&gt; &gt;
&gt; &gt; I am having the following input:
&gt; &gt;
&gt; &gt; &lt;cross-ref&gt;[&lt;cr refid=&quot;MEP_L_bib32&quot;&gt;32&lt;/cr&gt;-&lt;cr 
&gt; &gt; refid=&quot;MEP_L_bib35&quot;&gt;35&lt;/cr&gt;]&lt;/cross-ref&gt;
&gt; &gt;
&gt; &gt; &lt;cross-ref&gt;[&lt;cr refid=&quot;MEP_L_bib23&quot;&gt;23&lt;/cr&gt;-&lt;cr
&gt; 
&gt; 
&gt; That's not well-formed...

It's well-formed if you add a wrapper element. Strange, but well-formed.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305997.html</link>
</item><item>
<title>Re: [xsl] Condition problem - 11/4/2009 9:31:00 AM</title>
<description><![CDATA[<pre>2009/11/4 Ganesh Babu N &lt;nbabuganesh@gmail.com&gt;:
&gt; Dear All,
&gt;
&gt; I am having the following input:
&gt;
&gt; &lt;cross-ref&gt;[&lt;cr refid=&quot;MEP_L_bib32&quot;&gt;32&lt;/cr&gt;–&lt;cr
&gt; refid=&quot;MEP_L_bib35&quot;&gt;35&lt;/cr&gt;]&lt;/cross-ref&gt;
&gt;
&gt; &lt;cross-ref&gt;[&lt;cr refid=&quot;MEP_L_bib23&quot;&gt;23&lt;/cr&gt;–&lt;cr


That's not well-formed...


&gt; This the code I have tried.
&gt;
&gt; &lt;xsl:template match=&quot;cross-ref&quot;&gt;
&gt; &#160; &#160; &#160; &#160;&lt;xsl:when test=&quot;matches(.,'-') or matches(.,'–')&quot;&gt;


Where is xsl:choose?  Surely you get an exception with that...
&lt;rant&gt;You've been on this list for a long time now, you know how to
form a question so why repeatedly post rubbish?&lt;/rant&gt;



-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305994.html</link>
</item><item>
<title>[xsl] Condition problem - 11/4/2009 8:37:00 AM</title>
<description><![CDATA[<pre>Dear All,

I am having the following input:

&lt;cross-ref&gt;[&lt;cr refid=&quot;MEP_L_bib32&quot;&gt;32&lt;/cr&gt;–&lt;cr
refid=&quot;MEP_L_bib35&quot;&gt;35&lt;/cr&gt;]&lt;/cross-ref&gt;

&lt;cross-ref&gt;[&lt;cr refid=&quot;MEP_L_bib23&quot;&gt;23&lt;/cr&gt;–&lt;cr
refid=&quot;MEP_L_bib25&quot;&gt;25&lt;/cr&gt;,&lt;cr refid=&quot;MEP_L_bib32&quot;&gt;32&lt;/cr&gt;–&lt;cr
refid=&quot;MEP_L_bib34&quot;&gt;34&lt;/cr&gt;,&lt;cr refid=&quot;MEP_L_bib55&quot;&gt;55&lt;/cr&gt;–&lt;cr
refid=&quot;MEP_L_bib57&quot;&gt;57&lt;/cr&gt;]&lt;/cross-ref&gt;

&lt;cross-ref&gt;[&lt;cr refid=&quot;MEP_L_bib23&quot;&gt;23&lt;/cr&gt;,&lt;cr
refid=&quot;MEP_L_bib31&quot;&gt;31&lt;/cr&gt;,&lt;cr refid=&quot;MEP_L_bib33&quot;&gt;33&lt;/cr&gt;,&lt;cr
refid=&quot;MEP_L_bib36&quot;&gt;36&lt;/cr&gt;,&lt;cr refid=&quot;MEP_L_bib45&quot;&gt;45&lt;/cr&gt;–&lt;cr
refid=&quot;MEP_L_bib47&quot;&gt;47&lt;/cr&gt;]&lt;/cross-ref&gt;

&lt;cross-ref&gt;[&lt;cr refid=&quot;MEP_L_bib17&quot;&gt;17&lt;/cr&gt;–&lt;cr
refid=&quot;MEP_L_bib29&quot;&gt;29&lt;/cr&gt;,&lt;cr refid=&quot;MEP_L_bib43&quot;&gt;43&lt;/cr&gt;,&lt;cr
refid=&quot;MEP_L_bib44&quot;&gt;44&lt;/cr&gt;]&lt;/cross-ref&gt;

&lt;cross-ref&gt;[&lt;cr refid=&quot;MEP_L_bib23&quot;&gt;23&lt;/cr&gt;,&lt;cr
refid=&quot;MEP_L_bib24&quot;&gt;24&lt;/cr&gt;,&lt;cr refid=&quot;MEP_L_bib29&quot;&gt;29&lt;/cr&gt;–&lt;cr
refid=&quot;MEP_L_bib31&quot;&gt;31&lt;/cr&gt;,&lt;cr refid=&quot;MEP_L_bib33&quot;&gt;33&lt;/cr&gt;,&lt;cr
refid=&quot;MEP_L_bib46&quot;&gt;46&lt;/cr&gt;]&lt;/cross-ref&gt;


This the code I have tried.

&lt;xsl:template match=&quot;cross-ref&quot;&gt;
	&lt;xsl:when test=&quot;matches(.,'-') or matches(.,'–')&quot;&gt;
		&lt;ce:cross-refs&gt;
			&lt;xsl:attribute name=&quot;refid&quot;&gt;
				&lt;xsl:if test=&quot;cr/@refid[contains(., 'bib')] and
cr[following-sibling::node()[1]='-']&quot;&gt;
					&lt;xsl:variable name=&quot;starth&quot;
select=&quot;cr[following-sibling::node()[1]='-']/substring-after(@refid,'MEP_L_bib')&quot;/&gt;
					&lt;xsl:variable name=&quot;endh&quot;
select=&quot;cr[preceding-sibling::node()[1]='-']/substring-after(@refid,'MEP_L_bib')&quot;/&gt;
					&lt;xsl:for-each select=&quot;1 to count($starth)&quot;&gt;
						&lt;xsl:variable name=&quot;tv&quot; select=&quot;.&quot;/&gt;
						&lt;xsl:if test=&quot;$tv != 1&quot;&gt;
							&lt;xsl:text&gt; &lt;/xsl:text&gt;
						&lt;/xsl:if&gt;
						&lt;xsl:value-of select=&quot;for $i in xs:integer($starth[$tv]) to
xs:integer($endh[$tv]) return concat('bib', $i)&quot;/&gt;
					&lt;/xsl:for-each&gt;
				&lt;/xsl:if&gt;
				&lt;xsl:if test=&quot;cr[following-sibling::node()[1]!='–'][preceding-sibling::node()[1]!='–'][following-sibling::node()[1]!='-'][preceding-sibling::node()[1]!='-']&quot;&gt;
					&lt;xsl:value-of
select=&quot;cr[following-sibling::node()[1]!='–'][preceding-sibling::node()[1]!='–'][following-sibling::node()[1]!='-'][preceding-sibling::node()[1]!='-'][following::text()[contains(current(),'–')]]/substring-after(@refid,'MEP_L_')&quot;/&gt;
					&lt;xsl:text&gt; &lt;/xsl:text&gt;
				&lt;/xsl:if&gt;
		        	&lt;xsl:if test=&quot;cr/@refid[contains(., 'bib')] and
cr[following-sibling::node()[1]='–']&quot;&gt;
				&lt;xsl:variable name=&quot;startn&quot;
select=&quot;cr[following-sibling::node()[1]='–']/substring-after(@refid,'MEP_L_bib')&quot;/&gt;
				&lt;xsl:variable name=&quot;endn&quot;
select=&quot;cr[preceding-sibling::node()[1]='–']/substring-after(@refid,'MEP_L_bib')&quot;/&gt;
				&lt;xsl:for-each select=&quot;1 to count($startn)&quot;&gt;
					&lt;xsl:variable name=&quot;tv&quot; select=&quot;.&quot;/&gt;
					&lt;xsl:if test=&quot;$tv != 1&quot;&gt;
						&lt;xsl:text&gt; &lt;/xsl:text&gt;
					&lt;/xsl:if&gt;
					&lt;xsl:value-of select=&quot;for $i in xs:integer($startn[$tv]) to
xs:integer($endn[$tv]) return concat('bib', $i)&quot;/&gt;
				&lt;/xsl:for-each&gt;
			&lt;/xsl:if&gt;
		&lt;/xsl:attribute&gt;
		&lt;xsl:apply-templates/&gt;
	&lt;/ce:cross-refs&gt;
&lt;/xsl:template&gt;

With the above code i am getting the following output:

&lt;ce:cross-refs refid=&quot;bib32 bib33 bib34 bib35&quot;&gt;[32&amp;#x02013;35]&lt;/ce:cross-refs&gt;
&lt;ce:cross-refs refid=&quot;bib23 bib24 bib25 bib32 bib33 bib34 bib55 bib56
bib57&quot;&gt;[23&amp;#x02013;25,32&amp;#x02013;34,55&amp;#x02013;57]&lt;/ce:cross-refs&gt;
&lt;ce:cross-refs refid=&quot;bib23 bib31 bib33 bib36 bib45 bib46
bib47&quot;&gt;[23,31,33,36,45&amp;#x02013;47]&lt;/ce:cross-refs&gt;
&lt;ce:cross-refs refid=&quot;bib43 bib44 bib27 bib28
bib29&quot;&gt;[27&amp;#x02013;29,43,44]&lt;/ce:cross-refs&gt;
&lt;ce:cross-refs refid=&quot;bib23 bib24 bib33 bib46 bib29 bib30
bib31&quot;&gt;[23,24,29&amp;#x02013;31,33,46]&lt;/ce:cross-refs&gt;

Required output is as follows:

&lt;ce:cross-refs refid=&quot;bib32 bib33 bib34 bib35&quot;&gt;[32&amp;#x02013;35]&lt;/ce:cross-refs&gt;
&lt;ce:cross-refs refid=&quot;bib23 bib24 bib25 bib32 bib33 bib34 bib55 bib56
bib57&quot;&gt;[23&amp;#x02013;25,32&amp;#x02013;34,55&amp;#x02013;57]&lt;/ce:cross-refs&gt;
&lt;ce:cross-refs refid=&quot;bib23 bib31 bib33 bib36 bib45 bib46
bib47&quot;&gt;[23,31,33,36,45&amp;#x02013;47]&lt;/ce:cross-refs&gt;
&lt;ce:cross-refs refid=&quot;bib27 bib28 bib29 bib43
bib44&quot;&gt;[27&amp;#x02013;29,43,44]&lt;/ce:cross-refs&gt;
&lt;ce:cross-refs refid=&quot;bib23 bib24 bib29 bib30 bib31 bib33 bib46
&quot;&gt;[23,24,29&amp;#x02013;31,33,46]&lt;/ce:cross-refs&gt;

Refer the last 3 lines of all the XML content.

In line 3: non-range numbers are present on left side of range pair
In line 4: non-range numbers are present on right side of range pair
In line 5: non-range numbers are present on either side of range pair

When there are non-range numbers all the non-ranges numbers are pulled
to the beginning by the current XSL code. We cannot use tokenize
because the numbers are not consistent. you may get year number in
place of number. only ID value is consistent.

I am unable to maintain the order which the present in the input XML.
Please suggest how to achieve this.

Regards,
Ganesh

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305991.html</link>
</item><item>
<title>Re: [xsl] Benefits of using xsl:key - 11/4/2009 8:22:00 AM</title>
<description><![CDATA[<pre>Michael Kay wrote:
&gt; The exact way in which you created this file is probably very important. If
&gt; you did it by naive copy-and-paste, then it's likely that the duplicate
&gt; values in the file are very close to each other and that the distance
&gt; between duplicates is consistently small.

I just pasted the three lines four times, then those lines 10 times,
then those lines 10 times, etc. The data set is admittedly only good
enough to demonstrate in a classroom that xsl:key can be useful, but
it is not fair to use this &quot;dummy&quot; data set to test optimization of an
XSLT processor.

Cheers,
Jesper Tverskov

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305990.html</link>
</item><item>
<title>RE: [xsl] Benefits of using xsl:key - 11/3/2009 10:28:00 PM</title>
<description><![CDATA[<pre>&gt; By modifying the simple example by Michael M&#252;ller-Hillebrand:
&gt; 
&gt; Input.xml
&gt; 
&gt; &lt;Doc&gt;
&gt;     &lt;value oid=&quot;f37&quot;&gt;some text&lt;/value&gt;
&gt;     &lt;value oid=&quot;f61&quot;&gt;some text&lt;/value&gt;
&gt;     &lt;value oid=&quot;f042&quot;&gt;some other text&lt;/value&gt; &lt;/Doc&gt;
&gt; 
&gt; Copy and pasting so we have 3000 lines.

The exact way in which you created this file is probably very important. If
you did it by naive copy-and-paste, then it's likely that the duplicate
values in the file are very close to each other and that the distance
between duplicates is consistently small.

This means that the pattern match=&quot;value[.=preceding::value]&quot; is not nearly
as expensive to evaluate as one might expect: it doesn't involve a search
back to the beginning of the file, only to the nearest duplicate value. I
was initially surprised that introducing keys to this example made so much
difference, given that you left this match pattern unchanged; but the
explanation for this would lie in the predictable data distribution.

By contrast, this code

&gt;             &lt;xsl:attribute name=&quot;xrefid&quot;
&gt; select=&quot;preceding::value[.=current()][last()]/@oid&quot;/&gt;

is looking for the first (i.e. most distant) duplicate, which will in
general be a long search.

I suspect that with most real-life data, evaluating the pattern would be
much more expensive than it is with this synthetic data, and therefore
introducing the key would have less impact.

&gt;I have a feeling that optimization in EE is not for &quot;preceding axis&quot;
problems, but for &quot;standard&quot; transformations of huge input files?

Saxon-EE has many optimizations, but won't optimize this particular
construct. The reason is that the sequence to which the predicate is applied
(preceding::value) is only searched once; it's not worth building an index
to support a search that is only done once. 

I'm always on the look-out for new optimization opportunities (though they
have to occur in constructs that are frequent enough to justify the extra
complexity). I think it would be potentially possible to extend the indexing
optimization to this case by recognizing that one can rewrite
preceding::value[X=Y] as //value[X=Y][.&lt;&lt;current()], which would then be
rewritten to use an index. In fact, I suspect that rewriting preceding::X as
//X[.&lt;&lt;current()] might well be a worthwhile rewrite even without the
indexing, as it would take advantage of the automatic indexing of //X which
occurs even with Saxon-HE: though it needs care because the &quot;natural&quot; order
of the results is different.

It's worth noting that your rewrite of

select=&quot;preceding::value[.=current()][last()]/@oid&quot;

by

select=&quot;key('value-content', .)[1]&quot;

works only because you know (from the semantics of the match pattern for the
template) that the context item cannot be the first in its key-group.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305967.html</link>
</item><item>
<title>Re: [xsl] generating unique ids - 11/3/2009 7:59:00 PM</title>
<description><![CDATA[<pre>Can u paste the XsLT stylesheet you have or atleast the code where you
think there is trouble?
You must understand why keys are used and how generate id is used.
they are meant to be for two different reasons
So send us a  bit of your code.
remember the XSLT Mailing List Guidelines: Try and give as much info
as possible to get as much help as possible.
Vasu

2009/11/3 a kusa &lt;akusa8@gmail.com&gt;:
&gt; Hi
&gt;
&gt; I am using generate-id() function to generate unique ids through out
&gt; my document. But I am having a problem here.
&gt;
&gt; My output looks like this:
&gt; &lt;root&gt;
&gt;
&gt; &lt;step1 id=&quot;idstep_2_566&quot;&gt;
&gt;
&gt; .....
&gt; &lt;step1&gt;
&gt; &lt;step1 id=&quot;idstep_2_566&quot;&gt;
&gt;
&gt;
&gt;
&gt; &lt;/step1&gt;
&gt;
&gt; &lt;/root&gt;
&gt;
&gt; Now in &#160;my xslt for template 'step1' I have a generate-id() function.
&gt; But for some reason it generates the same id for 'step1' elements.
&gt; How do I prevent it from generating the same id that was generated for
&gt; the previous step1 node? Do I have to use &lt;xsl:key&gt;?
&gt;
&gt; Any tips or suggestions will be helpful.
&gt;
&gt; Thanks.
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive: &#160;http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;



-- 
Vasu Chakkera
Numerical Algorithms Group Ltd.
Oxford
www.vasucv.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305959.html</link>
</item><item>
<title>Re: [xsl] generating unique ids - 11/3/2009 6:47:00 PM</title>
<description><![CDATA[<pre>a kusa wrote:

&gt; I am using generate-id() function to generate unique ids through out
&gt; my document. But I am having a problem here.
&gt; 
&gt; My output looks like this:
&gt; &lt;root&gt;
&gt; 
&gt; &lt;step1 id=&quot;idstep_2_566&quot;&gt;
&gt; 
&gt; .....
&gt; &lt;step1&gt;
&gt; &lt;step1 id=&quot;idstep_2_566&quot;&gt;
&gt; 
&gt; 
&gt; 
&gt; &lt;/step1&gt;
&gt; 
&gt; &lt;/root&gt;
&gt; 
&gt; Now in  my xslt for template 'step1' I have a generate-id() function.
&gt; But for some reason it generates the same id for 'step1' elements.
&gt; How do I prevent it from generating the same id that was generated for
&gt; the previous step1 node? Do I have to use &lt;xsl:key&gt;?

generate-id() will give a unique id for the context node. If that is the 
same both times your template is processed then you will get the same id.
So generate-id() is useful if you have e.g.

&lt;list&gt;
   &lt;foo&gt;...&lt;/foo&gt;
   &lt;foo&gt;...&lt;/foo&gt;
   &lt;foo&gt;...&lt;/foo&gt;
&lt;/list&gt;

in your input and then write a template for 'foo' elements in the stylesheet
   &lt;xsl:template match=&quot;foo&quot;&gt;
     &lt;li id=&quot;{generate-id()}&quot;&gt;
       &lt;xsl:apply-templates/&gt;
     &lt;/li&gt;
   &lt;/xsl:template&gt;


-- 

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305955.html</link>
</item><item>
<title>[xsl] SOAP extension compatible with AltovaXML - 11/3/2009 6:43:00 PM</title>
<description><![CDATA[<pre>Hi,

Has anyone come across (or implemented) a SOAP or http-send extension
for XSLT 2.0 that would work with the AltovaXML processor?

-- 
Fabre Lambeau

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305954.html</link>
</item><item>
<title>[xsl] generating unique ids - 11/3/2009 6:36:00 PM</title>
<description><![CDATA[<pre>Hi

I am using generate-id() function to generate unique ids through out
my document. But I am having a problem here.

My output looks like this:
&lt;root&gt;

&lt;step1 id=&quot;idstep_2_566&quot;&gt;

.....
&lt;step1&gt;
&lt;step1 id=&quot;idstep_2_566&quot;&gt;



&lt;/step1&gt;

&lt;/root&gt;

Now in  my xslt for template 'step1' I have a generate-id() function.
But for some reason it generates the same id for 'step1' elements.
How do I prevent it from generating the same id that was generated for
the previous step1 node? Do I have to use &lt;xsl:key&gt;?

Any tips or suggestions will be helpful.

Thanks.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305953.html</link>
</item><item>
<title>Re: [xsl] batch processing using saxon 9 - 11/3/2009 6:31:00 PM</title>
<description><![CDATA[<pre>Hi

Thanks fot all your replies! I had somehow overlooked this option:-(

On Tue, Nov 3, 2009 at 8:29 AM, Martin Honnen &lt;Martin.Honnen@gmx.de&gt; wrote:
&gt; a kusa wrote:
&gt;
&gt;&gt; How do you batch process files in saxon 9 using the command line? I
&gt;&gt; have an input directory with xml files and I want to be able to batch
&gt;&gt; process them. I cannot find the option for saxon 9 command line.
&gt;
&gt; Provide an input directory with -s and an output directory with -o:
&gt;
&gt; java -jar SomePath/saxon9he.jar -s:inputDirectory -o:outputDirectory
&gt; -xsl:sheet.xsl
&gt;
&gt; --
&gt;
&gt; &#160; &#160; &#160; &#160;Martin Honnen
&gt; &#160; &#160; &#160; &#160;http://msmvps.com/blogs/martin_honnen/
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive: &#160;http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305952.html</link>
</item><item>
<title>Re: [xsl] Benefits of using xsl:key - 11/3/2009 4:31:00 PM</title>
<description><![CDATA[<pre>I have tried to do the same test with the new SAXON HE, PE og EE from
inside Oxygen, and with AltovaXML from inside XMLSpy.

The preceding axis is really stressing the XSLT processor!

For Saxon inside Oxygen, it is interesting that with an xml input file
of only 3000 lines (2000 KB), the optimization option in EE is slower
that using xsl:key in HE, PE and EE, being really fast. I have a
feeling that optimization in EE is not for &quot;preceding axis&quot; problems,
but for &quot;standard&quot; transformations of huge input files?

When I tried to make a longer input file of only 10,000 lines,
transformation is still fast in Oxygen when using xsl:key with any of
the three versions, but without xsl:key transformation seems to be
&quot;looping&quot; for ever, and that is also the case when EE is tested in
optimized mode.

XMLSpy using AltovaXML freezes already when I attempted to transform
the file with only 3000 lines! So I didn't manage to test if xsl:key
could speed things up in XMLSpy.

Cheers,
Jesper

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305943.html</link>
</item><item>
<title>Re: [xsl] batch processing using saxon 9 - 11/3/2009 2:30:00 PM</title>
<description><![CDATA[<pre>a kusa wrote:

&gt; How do you batch process files in saxon 9 using the command line? I
&gt; have an input directory with xml files and I want to be able to batch
&gt; process them. I cannot find the option for saxon 9 command line.

Provide an input directory with -s and an output directory with -o:

java -jar SomePath/saxon9he.jar -s:inputDirectory -o:outputDirectory 
-xsl:sheet.xsl

-- 

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305937.html</link>
</item><item>
<title>Re: [xsl] batch processing using saxon 9 - 11/3/2009 2:28:00 PM</title>
<description><![CDATA[<pre>&gt; How do you batch process files in saxon 9 using the command line? I
&gt; have an input directory with xml files and I want to be able to batch
&gt; process them. I cannot find the option for saxon 9 command line.


http://www.saxonica.com/documentation/using-xsl/commandline.html


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305936.html</link>
</item><item>
<title>Re: [xsl] batch processing using saxon 9 - 11/3/2009 2:24:00 PM</title>
<description><![CDATA[<pre>-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Why not making a batch script invoking saxon yourself?
Regards,
Bruno
a kusa wrote:
&gt; Hi
&gt; 
&gt; How do you batch process files in saxon 9 using the command line? I
&gt; have an input directory with xml files and I want to be able to batch
&gt; process them. I cannot find the option for saxon 9 command line.
&gt; 
&gt; Thanks in advance.
&gt; 
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt; 
&gt; 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrwPT8ACgkQaOubDsBUvbvRFgCgqRG8bAh3yqgEWlV+1q1LLrX9
+gEAn3GO3aeOdgSmCyOsBwaW/e8b2Sac
=YGMt
-----END PGP SIGNATURE-----

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305935.html</link>
</item><item>
<title>[xsl] batch processing using saxon 9 - 11/3/2009 2:23:00 PM</title>
<description><![CDATA[<pre>Hi

How do you batch process files in saxon 9 using the command line? I
have an input directory with xml files and I want to be able to batch
process them. I cannot find the option for saxon 9 command line.

Thanks in advance.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305933.html</link>
</item><item>
<title>Re: [xsl] good Open source IDE Tool for XSL - 11/3/2009 2:23:00 PM</title>
<description><![CDATA[<pre>-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I personally use kate and I'm very happy with it ;-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrwPPcACgkQaOubDsBUvbuvDQCfd3NY96O0epwmJ6C3HHUgBuft
FjUAoO6XcCrWT+64scK60Zb/JT4Ft+Qo
=BMFd
-----END PGP SIGNATURE-----

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305934.html</link>
</item><item>
<title>[xsl] Stylesheet compilation with saxon - 11/3/2009 2:20:00 PM</title>
<description><![CDATA[<pre>-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

What are the advantages of compiling a stylesheet with saxon?
I'm searching several ways to fast the xsl transformation process; is a
compiled stylesheet faster than a non-compiled one?
Best regards,
Bruno
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrwPFUACgkQaOubDsBUvbv0XgCfVj07itb2v0/ok0japmmSfkPi
cjoAn128ZPkAWDLSq4ErxDrYchi/M97F
=TUYf
-----END PGP SIGNATURE-----

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305932.html</link>
</item><item>
<title>Re: [xsl] xsl:result-document usage - 11/3/2009 2:17:00 PM</title>
<description><![CDATA[<pre>Thank you!

On Tue, Nov 3, 2009 at 3:12 AM, Andrew Welch &lt;andrew.j.welch@gmail.com&gt; wrote:
&gt; 2009/11/2 a kusa &lt;akusa8@gmail.com&gt;:
&gt;&gt; Hi
&gt;&gt;
&gt;&gt; I am not very clear with the xsl:result-document usage in xslt 2.0.
&gt;&gt; Basically, here is what I want to do.
&gt;&gt;
&gt;&gt; I have an xml file to which I apply my trasnformation style sheet. In
&gt;&gt; my transformation, I calculate what the document number for this input
&gt;&gt; file must be. Now when I run the transformation my &#160;output file must
&gt;&gt; be {document number}.xml.
&gt;&gt;
&gt;&gt; Can I achieve this through xsl:result-document?
&gt;
&gt; yep:
&gt;
&gt; &lt;xsl:template match=&quot;/&quot;&gt;
&gt; &#160;&lt;xsl:result-document href=&quot;{$filename}&quot;&gt;
&gt; &#160;....
&gt;
&gt;
&gt; --
&gt; Andrew Welch
&gt; http://andrewjwelch.com
&gt; Kernow: http://kernowforsaxon.sf.net/
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive: &#160;http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305931.html</link>
</item><item>
<title>Re: [xsl] good Open source IDE Tool for XSL - 11/3/2009 2:13:00 PM</title>
<description><![CDATA[<pre>---------- Forwarded message ----------
From: Vasu Chakkera &lt;vasucv@gmail.com&gt;
Date: 2009/11/3
Subject: Re: [xsl] good Open source IDE Tool for XSL
To: xsl-list@lists.mulberrytech.com


How could people forget to mention Marrowsoft Xselerator?

Home page (SF): http://sourceforge.net/projects/xselerator

Help forum: http://sourceforge.net/forum/forum.php?forum_id=745152

Downloads: http://sourceforge.net/project/showfiles.php?group_id=207860

Enjoy!

Vasu


2009/11/3 Anil Kumar Veeramalli &lt;anil.v@frescoinformatics.com&gt;
&gt;
&gt; Hi,
&gt;
&gt; I am Looking for good &#160;Open source IDE Tool for XSL Development. Please suggest me some good tool.
&gt;
&gt; Thanks,
&gt; Anil
&gt;
&gt;
&gt;
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive: &#160;http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;



--
Vasu Chakkera
Numerical Algorithms Group Ltd.
Oxford
www.vasucv.com




--
Vasu Chakkera
Numerical Algorithms Group Ltd.
Oxford
www.vasucv.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305930.html</link>
</item><item>
<title>Re: [xsl] good Open source IDE Tool for XSL - 11/3/2009 12:24:00 PM</title>
<description><![CDATA[<pre>On 3 Nov 2009, at 12:20, Syd Bauman wrote:

&gt;&gt; I am Looking for good Open source IDE Tool for XSL Development.
&gt;&gt; Please suggest me some good tool.
&gt;
&gt; AFAIK, Emacs is not exactly set up as an XSLT IDE yet, but many of us
&gt; would appreciate it if someone would get on the ball and write one
&gt; up.
&gt;
&gt; Last I saw JEdit was quite reasonable and usable. Netbeans and
&gt; Treebeard supposedly have some built-in IDE-like features, but I've
&gt; never even seen them, let alone used either. All of these should be
&gt; available on Sourceforge.
&gt;
&gt; Although it has the tremendous moral disadvantage of being
&gt; proprietary, I use SyncRO Soft's &lt;oXygen&gt; for 98% of my XSLT editing,
&gt; anyway. (I use Emacs/psgml, Emacs/nxml, oXygen, and occasionally
&gt; JEdit, BBEdit, or a specialized editor for other XML writing tasks;
&gt; but for XSLT, it's almost always oXygen.)

The Eclipse XSL Developer Tools, part of the WST, aren't bad either -  
particularly if you are using Eclipse for any other work.

&gt;
&gt; C. Michael Sperberg-McQueen of Black Mesa technologies gave a talk on
&gt; open source tools for XML development in late summer or early fall. I
&gt; know he covered XML editing, but I don't know if he covered
&gt; specialized XSLT IDEs. info@blackmesa.com.
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;

-- 
Bill Michell
billmichell@gmail.com





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305925.html</link>
</item><item>
<title>Re: [xsl] good Open source IDE Tool for XSL - 11/3/2009 12:21:00 PM</title>
<description><![CDATA[<pre>&gt; I am Looking for good Open source IDE Tool for XSL Development.
&gt; Please suggest me some good tool.

AFAIK, Emacs is not exactly set up as an XSLT IDE yet, but many of us
would appreciate it if someone would get on the ball and write one
up.

Last I saw JEdit was quite reasonable and usable. Netbeans and
Treebeard supposedly have some built-in IDE-like features, but I've
never even seen them, let alone used either. All of these should be
available on Sourceforge.

Although it has the tremendous moral disadvantage of being
proprietary, I use SyncRO Soft's &lt;oXygen&gt; for 98% of my XSLT editing,
anyway. (I use Emacs/psgml, Emacs/nxml, oXygen, and occasionally
JEdit, BBEdit, or a specialized editor for other XML writing tasks;
but for XSLT, it's almost always oXygen.)

C. Michael Sperberg-McQueen of Black Mesa technologies gave a talk on
open source tools for XML development in late summer or early fall. I
know he covered XML editing, but I don't know if he covered
specialized XSLT IDEs. info@blackmesa.com.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305924.html</link>
</item><item>
<title>Re: [xsl] Benefits of using xsl:key - 11/3/2009 11:20:00 AM</title>
<description><![CDATA[<pre>The example works convincingly!

By modifying the simple example by Michael M&#195;&#188;ller-Hillebrand:

Input.xml

&lt;Doc&gt;
    &lt;value oid=&quot;f37&quot;&gt;some text&lt;/value&gt;
    &lt;value oid=&quot;f61&quot;&gt;some text&lt;/value&gt;
    &lt;value oid=&quot;f042&quot;&gt;some other text&lt;/value&gt;
&lt;/Doc&gt;

Copy and pasting so we have 3000 lines.

And modifying his stylesheet to:

&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
version=&quot;2.0&quot;&gt;
    &lt;xsl:output indent=&quot;yes&quot;/&gt;

    &lt;xsl:template match=&quot;value[.=preceding::value]&quot;&gt;
        &lt;xsl:copy&gt;
            &lt;!-- add attribute and skip content --&gt;
            &lt;xsl:apply-templates select=&quot;@*&quot;/&gt;
            &lt;xsl:attribute name=&quot;xrefid&quot;
select=&quot;preceding::value[.=current()][last()]/@oid&quot;/&gt;
        &lt;/xsl:copy&gt;
    &lt;/xsl:template&gt;

    &lt;xsl:template match=&quot;@*|node()&quot;&gt;
        &lt;xsl:copy&gt;
            &lt;xsl:apply-templates select=&quot;@*|node()&quot;/&gt;
        &lt;/xsl:copy&gt;
    &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;

Transformation with an old Saxon-B9 from inside Oxygen takes around 10s.

After using xsl:key and the following stylesheet:

&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; version=&quot;2.0&quot;&gt;
    &lt;xsl:output indent=&quot;yes&quot;/&gt;
    &lt;xsl:key name=&quot;value-content&quot; match=&quot;value&quot; use=&quot;.&quot;/&gt;

    &lt;xsl:template match=&quot;value[.=preceding::value]&quot;&gt;
        &lt;xsl:variable name=&quot;first&quot; select=&quot;key('value-content', .)[1]&quot;/&gt;
        &lt;xsl:copy&gt;
            &lt;xsl:choose&gt;
                &lt;xsl:when test=&quot;. is $first&quot;&gt;
                    &lt;!-- pass through content --&gt;
                    &lt;xsl:apply-templates select=&quot;@*&quot;/&gt;
                    &lt;xsl:apply-templates/&gt;
                &lt;/xsl:when&gt;
                &lt;xsl:otherwise&gt;
                    &lt;!-- add attribute and skip content --&gt;
                    &lt;xsl:attribute name=&quot;xrefid&quot; select=&quot;$first/@oid&quot;/&gt;
                    &lt;xsl:apply-templates select=&quot;@*&quot;/&gt;
                &lt;/xsl:otherwise&gt;
            &lt;/xsl:choose&gt;
        &lt;/xsl:copy&gt;
    &lt;/xsl:template&gt;

    &lt;xsl:template match=&quot;@*|node()&quot;&gt;
        &lt;xsl:copy&gt;
            &lt;xsl:apply-templates select=&quot;@*|node()&quot;/&gt;
        &lt;/xsl:copy&gt;
    &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;

Transformation takes 0.1s, or is 100 times faster!

It turned out to be easy to construct an example after all. Thanks for
the help. Next I will test the nice example provided by MK.

Cheers,
Jesper

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305920.html</link>
</item><item>
<title>Re: [xsl] Break functionality  in XSL - 11/3/2009 10:12:00 AM</title>
<description><![CDATA[<pre>Thanks a lot Martin.
-Anil
Martin Honnen wrote:
&gt;  
&gt; You can define a key on the ROW elements:
&gt;    &lt;xsl:key name=&quot;k1&quot; match=&quot;ROW&quot; use=&quot;COLUMN[@NAME = 'JOBCODE']&quot;/&gt;
&gt; then key('k1', 'P10') gives you a node-set of the ROW elements with 
&gt; that key value, then you can sort that by the date in descending order 
&gt; and only take the description of the first ROW:
&gt;
&gt; &lt;xsl:stylesheet
&gt;   xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
&gt;   xmlns:data=&quot;http://example.com/2009/data&quot;
&gt;   exclude-result-prefixes=&quot;data&quot;
&gt;   version=&quot;1.0&quot;&gt;
&gt;
&gt;   &lt;xsl:param name=&quot;jobcode&quot; select=&quot;'P10'&quot;/&gt;
&gt;
&gt;   &lt;xsl:key name=&quot;k1&quot; match=&quot;ROW&quot; use=&quot;COLUMN[@NAME = 'JOBCODE']&quot;/&gt;
&gt;
&gt;   &lt;xsl:output method=&quot;text&quot;/&gt;
&gt;
&gt;   &lt;data:data xmlns=&quot;&quot;&gt;
&gt;     &lt;month key=&quot;Jan&quot; value=&quot;01&quot;/&gt;
&gt;     &lt;month key=&quot;Feb&quot; value=&quot;02&quot;/&gt;
&gt;     &lt;month key=&quot;Mar&quot; value=&quot;03&quot;/&gt;
&gt;     &lt;month key=&quot;Apr&quot; value=&quot;04&quot;/&gt;
&gt;     &lt;month key=&quot;May&quot; value=&quot;05&quot;/&gt;
&gt;     &lt;month key=&quot;Jun&quot; value=&quot;06&quot;/&gt;
&gt;     &lt;month key=&quot;Jul&quot; value=&quot;07&quot;/&gt;
&gt;     &lt;month key=&quot;Aug&quot; value=&quot;08&quot;/&gt;
&gt;     &lt;month key=&quot;Sep&quot; value=&quot;09&quot;/&gt;
&gt;     &lt;month key=&quot;Oct&quot; value=&quot;10&quot;/&gt;
&gt;     &lt;month key=&quot;Nov&quot; value=&quot;11&quot;/&gt;
&gt;     &lt;month key=&quot;Dec&quot; value=&quot;12&quot;/&gt;
&gt;   &lt;/data:data&gt;
&gt;
&gt;   &lt;xsl:template match=&quot;/&quot;&gt;
&gt;     &lt;xsl:for-each select=&quot;key('k1', $jobcode)&quot;&gt;
&gt;       &lt;xsl:sort select=&quot;concat(
&gt;         substring(COLUMN[@NAME = 'EFFDT'], 8, 4),
&gt;         '-',
&gt;         document('')/xsl:stylesheet/data:data/month[@key = 
&gt; substring(COLUMN[@NAME = 'EFFDT'], 4, 3)]/@value,
&gt;         '-',
&gt;         substring(COLUMN[@NAME = 'EFFDT'], 1, 2))&quot;
&gt;         order=&quot;descending&quot;/&gt;
&gt;       &lt;xsl:if test=&quot;position() = 1&quot;&gt;
&gt;         &lt;xsl:value-of select=&quot;COLUMN[@NAME = 'DESCR']&quot;/&gt;
&gt;       &lt;/xsl:if&gt;
&gt;     &lt;/xsl:for-each&gt;
&gt;   &lt;/xsl:template&gt;
&gt;
&gt; &lt;/xsl:stylesheet&gt;
&gt;
&gt;
&gt; The only problem is dealing with that date format, you can't sort on 
&gt; that directly, you need to extract the components and bring them into 
&gt; a yyyy-mm-dd format that can be sorted as a string. The stylesheet 
&gt; above does that.
&gt;
&gt;
&gt;



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305917.html</link>
</item><item>
<title>RE: [xsl] Benefits of using xsl:key - 11/3/2009 9:31:00 AM</title>
<description><![CDATA[<pre>&gt; 
&gt; We often hear that the use of xsl:key can speed up a 
&gt; transformation many times. But XSLT processors seem so 
&gt; optimized for speed, anyway, these days, that I have found it 
&gt; difficult to construct a test input file and a test XSLT 
&gt; stylesheet demonstrating the dramatic wonders of using xsl:key.
&gt; 
&gt; How big should the input document be?
&gt; How complicated the hierarchy, etc?
&gt; 

Try this query, which is Q8 from the XQuery XMark benchmark translated into
XSLT.

&lt;result xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; xsl:version=&quot;2.0&quot;&gt;
&lt;!-- Q8.  List the names of persons and the number of items they bought.
          (joins person, closed_auction) --&gt;

  &lt;xsl:for-each select=&quot;/site/people/person&quot;&gt;
    &lt;xsl:variable name=&quot;a&quot; 
       select=&quot;/site/closed_auctions/closed_auction[buyer/@person =
current()/@id]&quot;/&gt;
    &lt;item person=&quot;{name}&quot;&gt;&lt;xsl:value-of select=&quot;count($a)&quot;/&gt;&lt;/item&gt;  
  &lt;/xsl:for-each&gt;
  
&lt;/result&gt;  

Run it against different sizes of database from the XMark benchmark. Observe
how with Saxon-HE the performance increases quadradically with database
size, while with Saxon-EE the increase is linear. That's because Saxon-EE
creates a key automatically. Then show how you can achieve the same effect
with Saxon-HE by hand-optimizing using xsl:key: introduce

&lt;xsl:key name=&quot;k&quot; match=&quot;/site/closed_auctions/closed_auction&quot;
use=&quot;buyer/@person&quot;/&gt;

and change the variable initializer to

select=&quot;key('k', @id)&quot;

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305914.html</link>
</item><item>
<title>Re: [xsl] Benefits of using xsl:key - 11/3/2009 9:22:00 AM</title>
<description><![CDATA[<pre>Hi Jesper,

Am 03.11.2009 um 08:55 schrieb Jesper Tverskov:

&gt; We often hear that the use of xsl:key can speed up a transformation
&gt; many times. But XSLT processors seem so optimized for speed, anyway,
&gt; these days, that I have found it difficult to construct a test input
&gt; file and a test XSLT stylesheet demonstrating the dramatic wonders of
&gt; using xsl:key.
&gt;
&gt; How big should the input document be?
&gt; How complicated the hierarchy, etc?
&gt;
&gt; I would like to impress my students with a nice little transformation
&gt; example, instead of just telling them that there can be huge benefits.

about a year ago I had such a situation. With test documents all went  
fine, but the customer used XML files of about 20 MBytes and they  
waited. They complained about it only after months and I was really  
ashamed.

The task was to remove duplicate content from an XML file, to ease the  
translation process. All duplicate elements should be left in the  
result file, but empty and with an extra attribute @xrefid which would  
allow to revert the process after translation.

The input was essentially a list, the original with a lot more  
attributes and of course thousands of entries:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;Doc&gt;
  &lt;value oid=&quot;f37&quot;&gt;some text&lt;/value&gt;
  &lt;value oid=&quot;f61&quot;&gt;some text&lt;/value&gt;
  &lt;value oid=&quot;f042&quot;&gt;some other text&lt;/value&gt;
&lt;/Doc&gt;

The desired result was:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;Doc&gt;
  &lt;value oid=&quot;f37&quot;&gt;some text&lt;/value&gt;
  &lt;value oid=&quot;f61&quot; xrefid=&quot;f37&quot; /&gt;
  &lt;value oid=&quot;f042&quot;&gt;some other text&lt;/value&gt;
&lt;/Doc&gt;

My first take was (I know I should have known better):

&lt;xsl:template match=&quot;value[.=preceding::value]&quot;&gt;
  &lt;xsl:copy&gt;
   &lt;!-- add attribute and skip content --&gt;
   &lt;xsl:apply-templates select=&quot;@*&quot;/&gt;
   &lt;xsl:attribute name=&quot;xrefid&quot; select=&quot;preceding::value[.=current()] 
[last()]/@oid&quot;/&gt;
  &lt;/xsl:copy&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match=&quot;value&quot;&gt;
  &lt;xsl:copy&gt;
   &lt;xsl:apply-templates select=&quot;@*|node()&quot;/&gt;
  &lt;/xsl:copy&gt;
&lt;/xsl:template&gt;


This was really bad with large files, because for every value a look- 
up of all preceding values had to be made. So I changed it to

&lt;xsl:key name=&quot;value-content&quot; match=&quot;value&quot; use=&quot;.&quot;/&gt;

&lt;xsl:template match=&quot;value&quot;&gt;
  &lt;xsl:variable name=&quot;first&quot; select=&quot;key('value-content', .)[1]&quot;/&gt;
  &lt;xsl:copy&gt;
   &lt;xsl:choose&gt;
    &lt;xsl:when test=&quot;. is $first&quot;&gt;
     &lt;!-- pass through content --&gt;
     &lt;xsl:apply-templates select=&quot;@*&quot;/&gt;
     &lt;xsl:apply-templates/&gt;
    &lt;/xsl:when&gt;
    &lt;xsl:otherwise&gt;
      &lt;!-- add attribute and skip content --&gt;
      &lt;xsl:attribute name=&quot;xrefid&quot; select=&quot;$first/@oid&quot;/&gt;
      &lt;xsl:apply-templates select=&quot;@*&quot;/&gt;
    &lt;/xsl:otherwise&gt;
   &lt;/xsl:choose&gt;
  &lt;/xsl:copy&gt;
&lt;/xsl:template&gt;

Now the solution worked like a breeze with really large files.

HTH,

- Michael

PS: Examples have been edited and not tested.

--
_______________________________________________________________
Michael M&#252;ller-Hillebrand: Dokumentations-Technologie
Adobe Certified Expert, FrameMaker
L&#246;sungen und Training, FrameScript, XML/XSL, Unicode
Blog: http://cap-studio.de/ - Tel. +49 (9131) 28747






--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305913.html</link>
</item><item>
<title>Re: [xsl] Benefits of using xsl:key - 11/3/2009 9:21:00 AM</title>
<description><![CDATA[<pre>2009/11/3 Jesper Tverskov &lt;jesper.tverskov@gmail.com&gt;:
&gt; On Tue, Nov 3, 2009 at 9:03 AM, David Carlisle &lt;davidc@nag.co.uk&gt; wrote:
&gt;&gt;However a typical
&gt;&gt; muenchian grouping example can easily be orders of magnitude faster and
&gt;&gt; so measurable on really quite small documents as you are avoiding
&gt;&gt; an order &#160;n^2 along the sibling axis looking for duplicates.
&gt;
&gt; What about XSLT 2.0 then, where we use xsl:for-each-group?
&gt;
&gt; A set of XSLT 2.0 test files demonstrating a dramatic difference would
&gt; really be much appreciated?

Create a large index file along the lines of:

&lt;entry id=&quot;nnn1&quot; value=&quot;vvv1&quot;/&gt;
&lt;entry id=&quot;nnn2&quot; value=&quot;vvv2&quot;/&gt;

then in another stylesheet do multiple lookups into that file:

$entry-doc//entry[@id eq $id]/@value

then use a key instead:

&lt;xsl:key name=&quot;entry-by-id&quot; match=&quot;entry&quot; use=&quot;@id&quot;/&gt;

with

key('entry-by-id', $id, $entry-doc)/@value

Provided the processor doesn't optimize // (such as the paid-for
version of Saxon) then you should see a measurable difference between
the former and the latter.


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305912.html</link>
</item><item>
<title>Re: [xsl] xsl:result-document usage - 11/3/2009 9:13:00 AM</title>
<description><![CDATA[<pre>2009/11/2 a kusa &lt;akusa8@gmail.com&gt;:
&gt; Hi
&gt;
&gt; I am not very clear with the xsl:result-document usage in xslt 2.0.
&gt; Basically, here is what I want to do.
&gt;
&gt; I have an xml file to which I apply my trasnformation style sheet. In
&gt; my transformation, I calculate what the document number for this input
&gt; file must be. Now when I run the transformation my &#160;output file must
&gt; be {document number}.xml.
&gt;
&gt; Can I achieve this through xsl:result-document?

yep:

&lt;xsl:template match=&quot;/&quot;&gt;
  &lt;xsl:result-document href=&quot;{$filename}&quot;&gt;
  ....


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305911.html</link>
</item><item>
<title>Re: [xsl] Benefits of using xsl:key - 11/3/2009 9:01:00 AM</title>
<description><![CDATA[<pre>On Tue, Nov 3, 2009 at 9:03 AM, David Carlisle &lt;davidc@nag.co.uk&gt; wrote:
&gt;However a typical
&gt; muenchian grouping example can easily be orders of magnitude faster and
&gt; so measurable on really quite small documents as you are avoiding
&gt; an order &#194;&#160;n^2 along the sibling axis looking for duplicates.

What about XSLT 2.0 then, where we use xsl:for-each-group?

A set of XSLT 2.0 test files demonstrating a dramatic difference would
really be much appreciated?

Jesper

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305910.html</link>
</item><item>
<title>Re: [xsl] Benefits of using xsl:key - 11/3/2009 8:04:00 AM</title>
<description><![CDATA[<pre>&gt; How big should the input document be?
&gt; How complicated the hierarchy, etc?

It depends on the processor. Saxon for example will recognise certain
xpath expressions and index them automatcally, and if it does that while
compiling the stylesheet then it makes no difference at all how big or
complicated the input is as the &quot;hint&quot; to the processor to index the
construct isn't needed so doesn't have much effect. However a typical
muenchian grouping example can easily be orders of magnitude faster and
so measurable on really quite small documents as you are avoiding 
an order  n^2 along the sibling axis looking for duplicates.

David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305906.html</link>
</item><item>
<title>[xsl] Benefits of using xsl:key - 11/3/2009 7:56:00 AM</title>
<description><![CDATA[<pre>Hi list

We often hear that the use of xsl:key can speed up a transformation
many times. But XSLT processors seem so optimized for speed, anyway,
these days, that I have found it difficult to construct a test input
file and a test XSLT stylesheet demonstrating the dramatic wonders of
using xsl:key.

How big should the input document be?
How complicated the hierarchy, etc?

I would like to impress my students with a nice little transformation
example, instead of just telling them that there can be huge benefits.

Cheers,
Jesper Tverskov

http://www.xmlkurser.dk
http://www.xmlplease.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305903.html</link>
</item><item>
<title>[xsl] good Open source IDE Tool for XSL - 11/3/2009 6:48:00 AM</title>
<description><![CDATA[<pre>Hi,

I am Looking for good  Open source IDE Tool for XSL Development. Please 
suggest me some good tool.

Thanks,
Anil




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305900.html</link>
</item><item>
<title>Re: [xsl] xsl:result-document usage - 11/3/2009 3:48:00 AM</title>
<description><![CDATA[<pre>On Tue, Nov 3, 2009 at 3:29 AM, a kusa &lt;akusa8@gmail.com&gt; wrote:
&gt; Now when I run the transformation my &#194;&#160;output file must
&gt; be {document number}.xml.
&gt;
&gt; Can I achieve this through xsl:result-document?

I think so. If I remember correctly, you might have to specify value
of href attribute of xsl:result-document instruction as follows,
href=&quot;{$document-number}.xml&quot;.


-- 
Regards,
Mukul Gandhi

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305891.html</link>
</item><item>
<title>Re: [xsl] XSLT key() function document argument - 11/3/2009 1:54:00 AM</title>
<description><![CDATA[<pre>Excellent, that helps a lot. Thank you, sir.

G. Ken Holman wrote:
&gt; At 2009-11-02 17:16 -0800, Bill French wrote:
&gt;&gt; I have a stylesheet that initializes some keys based on content in 
&gt;&gt; the input document. Then, the stylesheet applies templates to a node 
&gt;&gt; set variable whose contents come from an external file. For awhile I 
&gt;&gt; was very confused, because the keys weren't accessible from the 
&gt;&gt; templates that were being applied in the different context.
&gt;&gt;
&gt;&gt; &lt;xsl:key name=&quot;c&quot; match=&quot;rm:content&quot; use=&quot;string(@name)&quot;/&gt;
&gt;&gt; &lt;xsl:key name=&quot;l&quot; match=&quot;rm:label&quot; use=&quot;string(@name)&quot;/&gt;
&gt;&gt; &lt;xsl:variable name=&quot;orig-context&quot; select=&quot;/&quot;/&gt;
&gt;&gt;
&gt;&gt; ...
&gt;&gt;
&gt;&gt; &lt;xsl:variable name=&quot;wf&quot;&gt;
&gt;&gt;     &lt;xsl:copy-of select=&quot;document($wf-filepath)&quot;&gt;&lt;/xsl:copy-of&gt;
&gt;&gt; &lt;/xsl:variable&gt;
&gt; 
&gt; I find it interesting you are using &lt;xsl:copy-of/&gt; ... why not just 
&gt; point to the document root node rather than occupying the memory by 
&gt; creating an entire copy of the document:
&gt; 
&gt;    &lt;xsl:variable name=&quot;wf&quot; select=&quot;document($wf-filepath)&quot;/&gt;
&gt; 
&gt;&gt; &lt;xsl:template match=&quot;/rm:contentList&quot;&gt;
&gt;&gt;     &lt;xsl:apply-templates select=&quot;$wf&quot;/&gt;
&gt;&gt; &lt;/xsl:template&gt;
&gt;&gt;
&gt;&gt; &lt;xsl:template match=&quot;rm:insert[@label]&quot;&gt;
&gt;&gt;     &lt;xsl:apply-templates select=&quot;key('l', @label, $orig-context)&quot;/&gt;
&gt;&gt; &lt;/xsl:template&gt;
&gt;&gt;
&gt;&gt; The variable $wf contains the rm:insert elements that are matched by 
&gt;&gt; the final template.
&gt;&gt;
&gt;&gt; Now the question is -- is there a way to reference the &quot;original&quot; 
&gt;&gt; context, i.e., the document that processor originally encounters as 
&gt;&gt; the input tree? I've stored the document in the variable 
&gt;&gt; $orig-context, but this doesn't seem like an efficient or 
&gt;&gt; particularly elegant solution.
&gt; 
&gt; That is exactly how I would do it, with a global:
&gt; 
&gt;    &lt;xsl:variable name=&quot;orig-context&quot; select=&quot;/&quot;/&gt;
&gt; 
&gt; ... and there is nothing inefficient at all about this since it is 
&gt; only storing a single node ... just like in my suggested modification 
&gt; for $wf above.
&gt; 
&gt;&gt; Is there some special syntax to access the original context from a 
&gt;&gt; context created when applying templates to a node set variable?
&gt; 
&gt; Nothing special about applying templates to a node set variable ... 
&gt; keeping the original context in a variable is entirely acceptable and 
&gt; quite common.
&gt; 
&gt; And, with my modification for $wf above you don't have a node set 
&gt; variable, you are just pushing another document through the template 
&gt; rules without incurring the overhead of creating the complete copy in 
&gt; a node set variable.
&gt; 
&gt; Remember that document() returns a document node (formerly called a 
&gt; root node) after reading the XML document into memory ... so the 
&gt; document is in memory somewhere, it just isn't *also* in a variable 
&gt; through your use of &lt;xsl:copy/&gt;.
&gt; 
&gt; I've often used a global variable storing the root node for precisely 
&gt; the purpose you've described.  Not at all inefficient, nor wasteful, 
&gt; nor inelegant in my opinion.
&gt; 
&gt; I hope this helps.
&gt; 
&gt; . . . . . . . . . Ken
&gt; 
&gt; --
&gt; Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
&gt; Interested in other classes?  http://www.CraneSoftwrights.com/s/i/
&gt; Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
&gt; Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
&gt; Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
&gt; Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
&gt; G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
&gt; Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
&gt; Legal business disclaimers:  http://www.CraneSoftwrights.com/legal
&gt; 
&gt; 
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt; 
&gt; 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305888.html</link>
</item><item>
<title>Re: [xsl] XSLT key() function document argument - 11/3/2009 1:28:00 AM</title>
<description><![CDATA[<pre>At 2009-11-02 17:16 -0800, Bill French wrote:
&gt;I have a stylesheet that initializes some keys based on content in 
&gt;the input document. Then, the stylesheet applies templates to a node 
&gt;set variable whose contents come from an external file. For awhile I 
&gt;was very confused, because the keys weren't accessible from the 
&gt;templates that were being applied in the different context.
&gt;
&gt;&lt;xsl:key name=&quot;c&quot; match=&quot;rm:content&quot; use=&quot;string(@name)&quot;/&gt;
&gt;&lt;xsl:key name=&quot;l&quot; match=&quot;rm:label&quot; use=&quot;string(@name)&quot;/&gt;
&gt;&lt;xsl:variable name=&quot;orig-context&quot; select=&quot;/&quot;/&gt;
&gt;
&gt;...
&gt;
&gt;&lt;xsl:variable name=&quot;wf&quot;&gt;
&gt;     &lt;xsl:copy-of select=&quot;document($wf-filepath)&quot;&gt;&lt;/xsl:copy-of&gt;
&gt;&lt;/xsl:variable&gt;

I find it interesting you are using &lt;xsl:copy-of/&gt; ... why not just 
point to the document root node rather than occupying the memory by 
creating an entire copy of the document:

   &lt;xsl:variable name=&quot;wf&quot; select=&quot;document($wf-filepath)&quot;/&gt;

&gt;&lt;xsl:template match=&quot;/rm:contentList&quot;&gt;
&gt;     &lt;xsl:apply-templates select=&quot;$wf&quot;/&gt;
&gt;&lt;/xsl:template&gt;
&gt;
&gt;&lt;xsl:template match=&quot;rm:insert[@label]&quot;&gt;
&gt;     &lt;xsl:apply-templates select=&quot;key('l', @label, $orig-context)&quot;/&gt;
&gt;&lt;/xsl:template&gt;
&gt;
&gt;The variable $wf contains the rm:insert elements that are matched by 
&gt;the final template.
&gt;
&gt;Now the question is -- is there a way to reference the &quot;original&quot; 
&gt;context, i.e., the document that processor originally encounters as 
&gt;the input tree? I've stored the document in the variable 
&gt;$orig-context, but this doesn't seem like an efficient or 
&gt;particularly elegant solution.

That is exactly how I would do it, with a global:

   &lt;xsl:variable name=&quot;orig-context&quot; select=&quot;/&quot;/&gt;

... and there is nothing inefficient at all about this since it is 
only storing a single node ... just like in my suggested modification 
for $wf above.

&gt;Is there some special syntax to access the original context from a 
&gt;context created when applying templates to a node set variable?

Nothing special about applying templates to a node set variable ... 
keeping the original context in a variable is entirely acceptable and 
quite common.

And, with my modification for $wf above you don't have a node set 
variable, you are just pushing another document through the template 
rules without incurring the overhead of creating the complete copy in 
a node set variable.

Remember that document() returns a document node (formerly called a 
root node) after reading the XML document into memory ... so the 
document is in memory somewhere, it just isn't *also* in a variable 
through your use of &lt;xsl:copy/&gt;.

I've often used a global variable storing the root node for precisely 
the purpose you've described.  Not at all inefficient, nor wasteful, 
nor inelegant in my opinion.

I hope this helps.

. . . . . . . . . Ken

--
Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
Interested in other classes?  http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305887.html</link>
</item><item>
<title>[xsl] XSLT key() function document argument - 11/3/2009 1:17:00 AM</title>
<description><![CDATA[<pre>Hi all,

I have a stylesheet that initializes some keys based on content in the 
input document. Then, the stylesheet applies templates to a node set 
variable whose contents come from an external file. For awhile I was 
very confused, because the keys weren't accessible from the templates 
that were being applied in the different context.

&lt;xsl:key name=&quot;c&quot; match=&quot;rm:content&quot; use=&quot;string(@name)&quot;/&gt;
&lt;xsl:key name=&quot;l&quot; match=&quot;rm:label&quot; use=&quot;string(@name)&quot;/&gt;
&lt;xsl:variable name=&quot;orig-context&quot; select=&quot;/&quot;/&gt;

...

&lt;xsl:variable name=&quot;wf&quot;&gt;
     &lt;xsl:copy-of select=&quot;document($wf-filepath)&quot;&gt;&lt;/xsl:copy-of&gt;
&lt;/xsl:variable&gt;

&lt;xsl:template match=&quot;/rm:contentList&quot;&gt;
     &lt;xsl:apply-templates select=&quot;$wf&quot;/&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match=&quot;rm:insert[@label]&quot;&gt;
     &lt;xsl:apply-templates select=&quot;key('l', @label, $orig-context)&quot;/&gt;
&lt;/xsl:template&gt;

The variable $wf contains the rm:insert elements that are matched by the 
final template.

Now the question is -- is there a way to reference the &quot;original&quot; 
context, i.e., the document that processor originally encounters as the 
input tree? I've stored the document in the variable $orig-context, but 
this doesn't seem like an efficient or particularly elegant solution. Is 
there some special syntax to access the original context from a context 
created when applying templates to a node set variable?

Many thanks,

--Bill

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305886.html</link>
</item><item>
<title>[xsl] xsl:result-document usage - 11/2/2009 10:00:00 PM</title>
<description><![CDATA[<pre>Hi

I am not very clear with the xsl:result-document usage in xslt 2.0.
Basically, here is what I want to do.

I have an xml file to which I apply my trasnformation style sheet. In
my transformation, I calculate what the document number for this input
file must be. Now when I run the transformation my  output file must
be {document number}.xml.

Can I achieve this through xsl:result-document?
:

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305871.html</link>
</item><item>
<title>Re: [xsl] Question about variable assignment based on run-time value - 11/2/2009 8:32:00 PM</title>
<description><![CDATA[<pre>&lt;xsl:variable name=&quot;label-nodes&quot;
  select=&quot;rm:label[not(parent::shared) or $page-type = tokenize(@pages,
  '\s*,\s*')]&quot;/&gt;

David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305865.html</link>
</item><item>
<title>RE: [xsl] Question about variable assignment based on run-time value - 11/2/2009 8:30:00 PM</title>
<description><![CDATA[<pre>&gt; I'm trying to capture a sequence of nodes in a variable. The 
&gt; catch is that the nodes I capture can vary based on the 
&gt; local-name() of the element matched by the template.
&gt; 
&gt; I've got:
&gt; 
&gt; &lt;xsl:variable name=&quot;label-nodes&quot;&gt;
&gt;      &lt;xsl:choose&gt;
&gt;          &lt;xsl:when test=&quot;local-name() = 'shared'&quot;&gt;
&gt;              &lt;xsl:value-of select=&quot;rm:label[$page-type = 
&gt; tokenize(@pages, '\s*,\s*')]&quot;/&gt;
&gt;          &lt;/xsl:when&gt;
&gt;          &lt;xsl:otherwise&gt;
&gt;              &lt;xsl:value-of select=&quot;rm:label&quot;/&gt;
&gt;          &lt;/xsl:otherwise&gt;
&gt;      &lt;/xsl:choose&gt;
&gt; &lt;/xsl:variable&gt;
&gt; 
&gt; Instead, I want the sequence of rm:label elements selected by 
&gt; the XPath expression in the xsl:value-of instruction's select 
&gt; attribute. But how do I select a sequence?

Well, the minimum change is:

&gt; &lt;xsl:variable name=&quot;label-nodes&quot;&gt;
&gt;      &lt;xsl:choose&gt;
&gt;          &lt;xsl:when test=&quot;local-name() = 'shared'&quot;&gt;
&gt;              &lt;xsl:sequence select=&quot;rm:label[$page-type = tokenize(@pages,
'\s*,\s*')]&quot;/&gt;
&gt;          &lt;/xsl:when&gt;
&gt;          &lt;xsl:otherwise&gt;
&gt;              &lt;xsl:sequence select=&quot;rm:label&quot;/&gt;
&gt;          &lt;/xsl:otherwise&gt;
&gt;      &lt;/xsl:choose&gt;
&gt; &lt;/xsl:variable&gt;

But I think I would write

&lt;xsl:variable name=&quot;label-nodes&quot;
  select=&quot;rm:label[local-name(current()) ne 'shared' or $page-type =
tokenize(@pages, '\s*,\s*')]&quot;/&gt;

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305864.html</link>
</item><item>
<title>Re: [xsl] Question about variable assignment based on run-time value - 11/2/2009 8:11:00 PM</title>
<description><![CDATA[<pre>Apologies -- I should have specified that I'm using XSLT 2.0.

Bill French wrote:
&gt; Hi all,
&gt; 
&gt; I'm trying to capture a sequence of nodes in a variable. The catch is 
&gt; that the nodes I capture can vary based on the local-name() of the 
&gt; element matched by the template.
&gt; 
&gt; I've got:
&gt; 
&gt; &lt;xsl:variable name=&quot;label-nodes&quot;&gt;
&gt;      &lt;xsl:choose&gt;
&gt;          &lt;xsl:when test=&quot;local-name() = 'shared'&quot;&gt;
&gt;              &lt;xsl:value-of select=&quot;rm:label[$page-type = 
&gt; tokenize(@pages, '\s*,\s*')]&quot;/&gt;
&gt;          &lt;/xsl:when&gt;
&gt;          &lt;xsl:otherwise&gt;
&gt;              &lt;xsl:value-of select=&quot;rm:label&quot;/&gt;
&gt;          &lt;/xsl:otherwise&gt;
&gt;      &lt;/xsl:choose&gt;
&gt; &lt;/xsl:variable&gt;
&gt; 
&gt; Instead, I want the sequence of rm:label elements selected by the XPath 
&gt; expression in the xsl:value-of instruction's select attribute. But how 
&gt; do I select a sequence?
&gt; 
&gt; Many thanks in advance,
&gt; 
&gt; --Bill
&gt; 
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt; 
&gt; 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305863.html</link>
</item><item>
<title>[xsl] Question about variable assignment based on run-time value - 11/2/2009 7:48:00 PM</title>
<description><![CDATA[<pre>Hi all,

I'm trying to capture a sequence of nodes in a variable. The catch is 
that the nodes I capture can vary based on the local-name() of the 
element matched by the template.

I've got:

&lt;xsl:variable name=&quot;label-nodes&quot;&gt;
     &lt;xsl:choose&gt;
         &lt;xsl:when test=&quot;local-name() = 'shared'&quot;&gt;
             &lt;xsl:value-of select=&quot;rm:label[$page-type = 
tokenize(@pages, '\s*,\s*')]&quot;/&gt;
         &lt;/xsl:when&gt;
         &lt;xsl:otherwise&gt;
             &lt;xsl:value-of select=&quot;rm:label&quot;/&gt;
         &lt;/xsl:otherwise&gt;
     &lt;/xsl:choose&gt;
&lt;/xsl:variable&gt;

Instead, I want the sequence of rm:label elements selected by the XPath 
expression in the xsl:value-of instruction's select attribute. But how 
do I select a sequence?

Many thanks in advance,

--Bill

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305858.html</link>
</item><item>
<title>Re: [xsl] Break functionality  in XSL - 11/2/2009 5:02:00 PM</title>
<description><![CDATA[<pre>Anil Kumar Veeramalli wrote:

&gt; this is my sample xml file.
&gt; &lt;TABLE NAME=&quot;PS_JOBCODE_TBL&quot;&gt;
&gt; &lt;ROWS&gt;
&gt; &lt;ROW&gt;
&gt; &lt;COLUMN NAME=&quot;SETID&quot;&gt;&lt;![CDATA[COMMN]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;JOBCODE&quot;&gt;&lt;![CDATA[P10]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;EFFDT&quot;&gt;&lt;![CDATA[01-Jan-1996 00:00:00]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;EFF_STATUS&quot;&gt;&lt;![CDATA[A]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;DESCR&quot;&gt;&lt;![CDATA[yyyyyyyyyyyyyyy]]&gt;&lt;/COLUMN&gt;
&gt; &lt;/ROW&gt;
&gt; &lt;ROW&gt;
&gt; &lt;COLUMN NAME=&quot;SETID&quot;&gt;&lt;![CDATA[COMMN]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;JOBCODE&quot;&gt;&lt;![CDATA[B64]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;EFFDT&quot;&gt;&lt;![CDATA[01-Jan-1900 00:00:00]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;EFF_STATUS&quot;&gt;&lt;![CDATA[A]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;DESCR&quot;&gt;&lt;![CDATA[CONSTR SUPR]]&gt;&lt;/COLUMN&gt;
&gt; &lt;/ROW&gt;
&gt; &lt;ROW&gt;
&gt; &lt;COLUMN NAME=&quot;SETID&quot;&gt;&lt;![CDATA[COMMN]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;JOBCODE&quot;&gt;&lt;![CDATA[B64]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;EFFDT&quot;&gt;&lt;![CDATA[01-Jun-1966 00:00:00]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;EFF_STATUS&quot;&gt;&lt;![CDATA[A]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;DESCR&quot;&gt;&lt;![CDATA[CONSTR SUPR]]&gt;&lt;/COLUMN&gt;
&gt; &lt;/ROW&gt;
&gt; &lt;ROW&gt;
&gt; &lt;COLUMN NAME=&quot;SETID&quot;&gt;&lt;![CDATA[COMMN]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;JOBCODE&quot;&gt;&lt;![CDATA[P10]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;EFFDT&quot;&gt;&lt;![CDATA[16-Jul-1991 00:00:00]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;EFF_STATUS&quot;&gt;&lt;![CDATA[A]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;DESCR&quot;&gt;&lt;![CDATA[CABLE SPLICERS]]&gt;&lt;/COLUMN&gt;
&gt; &lt;/ROW&gt;
&gt; &lt;ROW&gt;
&gt; &lt;COLUMN NAME=&quot;SETID&quot;&gt;&lt;![CDATA[COMMN]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;JOBCODE&quot;&gt;&lt;![CDATA[P10]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;EFFDT&quot;&gt;&lt;![CDATA[16-Jul-1994 00:00:00]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;EFF_STATUS&quot;&gt;&lt;![CDATA[A]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;DESCR&quot;&gt;&lt;![CDATA[XXXXXXXXXXX]]&gt;&lt;/COLUMN&gt;
&gt; &lt;/ROW&gt;
&gt; &lt;/ROWS&gt;
&gt; &lt;/TABLE&gt;
&gt; 
&gt; I need to find out the DESCR. based on JobCode
&gt; 
&gt; *Input :  *Jobcode like P10
&gt; *Process: *find out the all the nodes with  Jobcode  *P10*  and find the 
&gt; latest Effective date (EFFDT) and display corresponding DESCR
&gt; *output: *DESCR with latest Effective date.

You can define a key on the ROW elements:
    &lt;xsl:key name=&quot;k1&quot; match=&quot;ROW&quot; use=&quot;COLUMN[@NAME = 'JOBCODE']&quot;/&gt;
then key('k1', 'P10') gives you a node-set of the ROW elements with that 
key value, then you can sort that by the date in descending order and 
only take the description of the first ROW:

&lt;xsl:stylesheet
   xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
   xmlns:data=&quot;http://example.com/2009/data&quot;
   exclude-result-prefixes=&quot;data&quot;
   version=&quot;1.0&quot;&gt;

   &lt;xsl:param name=&quot;jobcode&quot; select=&quot;'P10'&quot;/&gt;

   &lt;xsl:key name=&quot;k1&quot; match=&quot;ROW&quot; use=&quot;COLUMN[@NAME = 'JOBCODE']&quot;/&gt;

   &lt;xsl:output method=&quot;text&quot;/&gt;

   &lt;data:data xmlns=&quot;&quot;&gt;
     &lt;month key=&quot;Jan&quot; value=&quot;01&quot;/&gt;
     &lt;month key=&quot;Feb&quot; value=&quot;02&quot;/&gt;
     &lt;month key=&quot;Mar&quot; value=&quot;03&quot;/&gt;
     &lt;month key=&quot;Apr&quot; value=&quot;04&quot;/&gt;
     &lt;month key=&quot;May&quot; value=&quot;05&quot;/&gt;
     &lt;month key=&quot;Jun&quot; value=&quot;06&quot;/&gt;
     &lt;month key=&quot;Jul&quot; value=&quot;07&quot;/&gt;
     &lt;month key=&quot;Aug&quot; value=&quot;08&quot;/&gt;
     &lt;month key=&quot;Sep&quot; value=&quot;09&quot;/&gt;
     &lt;month key=&quot;Oct&quot; value=&quot;10&quot;/&gt;
     &lt;month key=&quot;Nov&quot; value=&quot;11&quot;/&gt;
     &lt;month key=&quot;Dec&quot; value=&quot;12&quot;/&gt;
   &lt;/data:data&gt;

   &lt;xsl:template match=&quot;/&quot;&gt;
     &lt;xsl:for-each select=&quot;key('k1', $jobcode)&quot;&gt;
       &lt;xsl:sort select=&quot;concat(
         substring(COLUMN[@NAME = 'EFFDT'], 8, 4),
         '-',
         document('')/xsl:stylesheet/data:data/month[@key = 
substring(COLUMN[@NAME = 'EFFDT'], 4, 3)]/@value,
         '-',
         substring(COLUMN[@NAME = 'EFFDT'], 1, 2))&quot;
         order=&quot;descending&quot;/&gt;
       &lt;xsl:if test=&quot;position() = 1&quot;&gt;
         &lt;xsl:value-of select=&quot;COLUMN[@NAME = 'DESCR']&quot;/&gt;
       &lt;/xsl:if&gt;
     &lt;/xsl:for-each&gt;
   &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;


The only problem is dealing with that date format, you can't sort on 
that directly, you need to extract the components and bring them into a 
yyyy-mm-dd format that can be sorted as a string. The stylesheet above 
does that.



-- 

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305852.html</link>
</item><item>
<title>[xsl] Break functionality  in XSL - 11/2/2009 4:39:00 PM</title>
<description><![CDATA[<pre>Hi martin,

this is my sample xml file.
&lt;TABLE NAME=&quot;PS_JOBCODE_TBL&quot;&gt;
&lt;ROWS&gt;
&lt;ROW&gt;
&lt;COLUMN NAME=&quot;SETID&quot;&gt;&lt;![CDATA[COMMN]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;JOBCODE&quot;&gt;&lt;![CDATA[P10]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;EFFDT&quot;&gt;&lt;![CDATA[01-Jan-1996 00:00:00]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;EFF_STATUS&quot;&gt;&lt;![CDATA[A]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;DESCR&quot;&gt;&lt;![CDATA[yyyyyyyyyyyyyyy]]&gt;&lt;/COLUMN&gt;
&lt;/ROW&gt;
&lt;ROW&gt;
&lt;COLUMN NAME=&quot;SETID&quot;&gt;&lt;![CDATA[COMMN]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;JOBCODE&quot;&gt;&lt;![CDATA[B64]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;EFFDT&quot;&gt;&lt;![CDATA[01-Jan-1900 00:00:00]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;EFF_STATUS&quot;&gt;&lt;![CDATA[A]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;DESCR&quot;&gt;&lt;![CDATA[CONSTR SUPR]]&gt;&lt;/COLUMN&gt;
&lt;/ROW&gt;
&lt;ROW&gt;
&lt;COLUMN NAME=&quot;SETID&quot;&gt;&lt;![CDATA[COMMN]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;JOBCODE&quot;&gt;&lt;![CDATA[B64]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;EFFDT&quot;&gt;&lt;![CDATA[01-Jun-1966 00:00:00]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;EFF_STATUS&quot;&gt;&lt;![CDATA[A]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;DESCR&quot;&gt;&lt;![CDATA[CONSTR SUPR]]&gt;&lt;/COLUMN&gt;
&lt;/ROW&gt;
&lt;ROW&gt;
&lt;COLUMN NAME=&quot;SETID&quot;&gt;&lt;![CDATA[COMMN]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;JOBCODE&quot;&gt;&lt;![CDATA[P10]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;EFFDT&quot;&gt;&lt;![CDATA[16-Jul-1991 00:00:00]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;EFF_STATUS&quot;&gt;&lt;![CDATA[A]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;DESCR&quot;&gt;&lt;![CDATA[CABLE SPLICERS]]&gt;&lt;/COLUMN&gt;
&lt;/ROW&gt;
&lt;ROW&gt;
&lt;COLUMN NAME=&quot;SETID&quot;&gt;&lt;![CDATA[COMMN]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;JOBCODE&quot;&gt;&lt;![CDATA[P10]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;EFFDT&quot;&gt;&lt;![CDATA[16-Jul-1994 00:00:00]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;EFF_STATUS&quot;&gt;&lt;![CDATA[A]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;DESCR&quot;&gt;&lt;![CDATA[XXXXXXXXXXX]]&gt;&lt;/COLUMN&gt;
&lt;/ROW&gt;
&lt;/ROWS&gt;
&lt;/TABLE&gt;

I need to find out the DESCR. based on JobCode

*Input :  *Jobcode like P10
*Process: *find out the all the nodes with  Jobcode  *P10*  and find the 
latest Effective date (EFFDT) and display corresponding DESCR
*output: *DESCR with latest Effective date.

Please suggest me on best of way of doing this.

Thanks,
Anil






--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305848.html</link>
</item><item>
<title>Re: [xsl] Break functionality  in XSL - 11/2/2009 2:38:00 PM</title>
<description><![CDATA[<pre>Anil Kumar Veeramalli wrote:
&gt; in my xml file, I have some duplicate records, so I want to consider 
&gt; only first records. other duplicate records simply want to ignore. That 
&gt; is the reason I need break functionality.

Then use Muenchian grouping, that way you can process only the first 
item of each group of items with the same key value:
http://www.jenitennison.com/xslt/grouping/muenchian.xml

If you need more concrete help then show us a sample of the XML input 
you have and the corresponding transformation result you want to create, 
then we can show you an XSLT way of doing that, without talking about 
loops or breaking out of loops.


-- 

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305841.html</link>
</item><item>
<title>Re: [xsl] Break functionality  in XSL - 11/2/2009 2:33:00 PM</title>
<description><![CDATA[<pre>in my xml file, I have some duplicate records, so I want to consider 
only first records. other duplicate records simply want to ignore. That 
is the reason I need break functionality.

Thanks,
Anil
 
&gt;
&gt; There is no xsl:break and xsl:for-each is not a loop. You might simply 
&gt; want to put your condition into a predicate in the select attribute e.g.
&gt;
&gt; &lt;xsl:for-each
&gt; select=&quot;TABLE[@NAME='XLATTABLE_EMPL_STATUS']/ROWS/ROW/COLUMN[@NAME='STATUS'][. 
&gt; = 'A']&quot;&gt;
&gt;
&gt;



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305840.html</link>
</item><item>
<title>Re: [xsl] Break functionality  in XSL - 11/2/2009 2:27:00 PM</title>
<description><![CDATA[<pre>Anil Kumar Veeramalli wrote:

&gt; I am using XSL1.0 version. I am looking for Break functionally in 
&gt; for-loop, I didn't find correct documentation on that.
&gt; 
&gt; &lt;xsl:for-each select=&quot;employees&quot;&gt;
&gt;   &lt;xsl:for-each select=&quot;employee&quot;&gt;
&gt;   &lt;xsl:if test=&quot;@NAME='STATUS'&quot;&gt;
&gt;       &lt;xsl:variable name=&quot;status&quot; select=&quot;.&quot;/&gt;               
&gt; &lt;xsl:for-each 
&gt; select=&quot;TABLE[@NAME='XLATTABLE_EMPL_STATUS']/ROWS/ROW/COLUMN[@NAME='STATUS']&quot;&gt; 
&gt; 
&gt;                   &lt;xsl:value-of variable=&quot;test&quot; select=&quot;.'&quot;&gt;
&gt;                      &lt;xsl:if test=&quot;$test='A'&quot;&gt;
&gt;                         &lt;/xsl:if&gt;
&gt; ///want to come back from loop once a condition is satisfied and don't 
&gt; want to loop again.
&gt; 
&gt;       &lt;/xsl:for-each&gt;
&gt; 
&gt;   &lt;/xsl:if&gt;
&gt; 
&gt;   &lt;/xsl:for-each&gt;
&gt; &lt;/xsl:for-each&gt;
&gt; &lt;/xsl:template&gt;
&gt; 
&gt; Approaches I tried:
&gt; 1) some were I read that we need to use &lt;xsl:break&gt;, but its not working.

There is no xsl:break and xsl:for-each is not a loop. You might simply 
want to put your condition into a predicate in the select attribute e.g.

&lt;xsl:for-each
select=&quot;TABLE[@NAME='XLATTABLE_EMPL_STATUS']/ROWS/ROW/COLUMN[@NAME='STATUS'][. 
= 'A']&quot;&gt;


-- 

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305839.html</link>
</item><item>
<title>[xsl] Break functionality  in XSL - 11/2/2009 2:21:00 PM</title>
<description><![CDATA[<pre>Hi,

I am using XSL1.0 version. I am looking for Break functionally in 
for-loop, I didn't find correct documentation on that.

&lt;xsl:for-each select=&quot;employees&quot;&gt;
   &lt;xsl:for-each select=&quot;employee&quot;&gt;
   &lt;xsl:if test=&quot;@NAME='STATUS'&quot;&gt;
       &lt;xsl:variable name=&quot;status&quot; select=&quot;.&quot;/&gt;      
          &lt;xsl:for-each 
select=&quot;TABLE[@NAME='XLATTABLE_EMPL_STATUS']/ROWS/ROW/COLUMN[@NAME='STATUS']&quot;&gt; 

                   &lt;xsl:value-of variable=&quot;test&quot; select=&quot;.'&quot;&gt;
                      &lt;xsl:if test=&quot;$test='A'&quot;&gt;
                         &lt;/xsl:if&gt;
///want to come back from loop once a condition is satisfied and don't 
want to loop again.
 
       &lt;/xsl:for-each&gt;

   &lt;/xsl:if&gt;

   &lt;/xsl:for-each&gt;
&lt;/xsl:for-each&gt;
&lt;/xsl:template&gt;

Approaches I tried:
1) some were I read that we need to use &lt;xsl:break&gt;, but its not working.


Thanks,
Anil


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305838.html</link>
</item><item>
<title>Re: [xsl] Backward Navigation Problem - 11/2/2009 11:42:00 AM</title>
<description><![CDATA[<pre>Thanks, Andrew for the clarification.

In this particular problem, since the context node was an element,
therefore ancestor:: axis would certainly have only element nodes. So
ancestor::node() will work for this particular example. You rightly
explained this :)

But I thought, explicitly specifying the kind of nodes (say, with ..,
* or element()) once must search on an XPath axis is a good design
principle with XSLT programs.

On Mon, Nov 2, 2009 at 4:42 PM, Andrew Welch &lt;andrew.j.welch@gmail.com&gt; wrote:
&gt; &lt;pedant&gt;
&gt;
&gt; I agree that in general using node() when really you mean element() is
&gt; a poor choice, however on the ancestor axis it's probably not going to
&gt; make that much difference.... In the vast majority of cases the only
&gt; type of nodes that exist on the ancestor axis are elements (and the
&gt; single document node).
&gt;
&gt; &lt;/pedant&gt;


-- 
Regards,
Mukul Gandhi

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305829.html</link>
</item><item>
<title>Re: [xsl] Backward Navigation Problem - 11/2/2009 11:13:00 AM</title>
<description><![CDATA[<pre>Hi,

&gt;&gt; ancestor::node()/TABLE[@NAME='XLATTABLE_EMPL_STATUS']/ROWS/ROW/COLUMN
&gt;
&gt; frankly I think, accessing the TABLE element using ancestor::node()
&gt; looks a POOR choice to me.
&gt;
&gt; a node() test generally returns true for all XPath data model nodes,
&gt; therefore I think ancestor::node() was not a good choice.

&lt;pedant&gt;

I agree that in general using node() when really you mean element() is
a poor choice, however on the ancestor axis it's probably not going to
make that much difference.... In the vast majority of cases the only
type of nodes that exist on the ancestor axis are elements (and the
single document node).

&lt;/pedant&gt;

:)


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305828.html</link>
</item><item>
<title>Re: [xsl] Backward Navigation Problem - 11/2/2009 11:03:00 AM</title>
<description><![CDATA[<pre>Thanks Mukul. I will try that way.


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305827.html</link>
</item><item>
<title>Re: [xsl] Backward Navigation Problem - 11/2/2009 11:00:00 AM</title>
<description><![CDATA[<pre>On Mon, Nov 2, 2009 at 4:23 PM, Anil Kumar Veeramalli
&lt;anil.v@frescoinformatics.com&gt; &gt; Thanks MK. finally I was able to do
with
&gt; ancestor::node()/TABLE[@NAME='XLATTABLE_EMPL_STATUS']/ROWS/ROW/COLUMN

frankly I think, accessing the TABLE element using ancestor::node()
looks a POOR choice to me.

a node() test generally returns true for all XPath data model nodes,
therefore I think ancestor::node() was not a good choice.

I suggest, you should use the expression which Mike suggested or can
use what I wrote.


-- 
Regards,
Mukul Gandhi

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305824.html</link>
</item><item>
<title>Re: [xsl] Backward Navigation Problem - 11/2/2009 10:53:00 AM</title>
<description><![CDATA[<pre>Thanks MK. finally I was able to do with 
ancestor::node()/TABLE[@NAME='XLATTABLE_EMPL_STATUS']/ROWS/ROW/COLUMN


Thanks,
Anil


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305823.html</link>
</item><item>
<title>RE: [xsl] Backward Navigation Problem - 11/2/2009 10:19:00 AM</title>
<description><![CDATA[<pre>&gt; 
&gt; looks like
&gt; TABLE[@NAME='XLATTABLE_EMPL_STATUS']/ROWS/ROW/COLUMN[@NAME='ST
&gt; ATUS']&quot; is not working.
&gt; 
&gt; Approaches I followed.
&gt; 1)  
&gt; ../TABLE[@NAME='XLATTABLE_EMPL_STATUS']/ROWS/ROW/COLUMN[@NAME=
&gt; 'STATUS']&quot;
&gt; 2)
&gt; parent::node()/TABLE[@NAME='XLATTABLE_EMPL_STATUS']/ROWS/ROW/C
&gt; OLUMN[@NAME='DESCR']
&gt; 

I would write it as a rooted path: /root/TABLE/.....

Your first try doesn't work because TABLE is not a child of the context node
(an employee element).

Your second try doesn't work because TABLE is not a child of the parent of
the context node (an employees element).

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305822.html</link>
</item><item>
<title>Re: [xsl] Backward Navigation Problem - 11/2/2009 10:11:00 AM</title>
<description><![CDATA[<pre>Hi Anil,
  if you are doing, &lt;xsl:for-each select=&quot;employee&quot;&gt;

then to reach to the TABLE node, you need to do as following:
../../TABLE

it seems, you are having trouble determining the context node.

On Mon, Nov 2, 2009 at 3:00 PM, Anil Kumar Veeramalli
&lt;anil.v@frescoinformatics.com&gt; wrote:
&gt; Hi,
&gt;
&gt; My sample XML file lok lilke this
&gt; &lt;root&gt;
&gt; &lt;employees&gt;
&gt; &#194;&#160;&lt;employee hireDate=&quot;04/23/1999&quot;&gt;
&gt; &#194;&#160; &lt;COLUMN NAME=&quot;LAST&quot;&gt;Hilllfrist&lt;/COLUMN&gt; &#194;&#160; &#194;&#160; &lt;COLUMN
&gt; NAME=&quot;STATUS&quot;&gt;&lt;![CDATA[A]]&gt;&lt;/COLUMN&gt;
&gt; &#194;&#160;&lt;/employee&gt;
&gt; &#194;&#160;&lt;employee hireDate=&quot;05/23/1999&quot;&gt;
&gt; &#194;&#160; &lt;COLUMN NAME=&quot;LAST&quot;&gt;raj&lt;/COLUMN&gt; &#194;&#160; &#194;&#160; &lt;COLUMN
&gt; NAME=&quot;STATUS&quot;&gt;&lt;![CDATA[T]]&gt;&lt;/COLUMN&gt;
&gt; &#194;&#160;&lt;/employee&gt;
&gt; &lt;/employees&gt;
&gt; &lt;TABLE NAME=&quot;XLATTABLE_EMPL_STATUS&quot;&gt;
&gt; &lt;ROWS&gt;
&gt; &lt;ROW&gt;
&gt; &lt;COLUMN NAME=&quot;STATUS&quot;&gt;&lt;![CDATA[T]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;DESCR&quot;&gt;&lt;![CDATA[Terminated]]&gt;&lt;/COLUMN&gt;
&gt; &lt;/ROW&gt;
&gt; &lt;ROW&gt;
&gt; &lt;COLUMN NAME=&quot;STATUS&quot;&gt;&lt;![CDATA[A]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;DESCR&quot;&gt;&lt;![CDATA[Active]]&gt;&lt;/COLUMN&gt;
&gt; &lt;/ROW&gt;
&gt; &lt;ROW&gt;
&gt; &lt;/TABLE &gt;
&gt; &lt;/root&gt;
&gt;
&gt; I need to Iterate all the Status values &#194;&#160;and need to fetch the description
&gt; from XLATTABLE_EMPL_STATUS.
&gt;
&gt; Example if the status is A, it has to be displayed as Active, if its T , it
&gt; has to be displayed as Terminated.
&gt;
&gt; My xsl code is as below.
&gt;
&gt; xsl:template match=&quot;root&quot;&gt;
&gt; &#194;&#160;&lt;xsl:for-each select=&quot;employees&quot;&gt;
&gt; &#194;&#160; &lt;xsl:for-each select=&quot;employee&quot;&gt;
&gt; &#194;&#160; &lt;xsl:if test=&quot;@NAME='STATUS'&quot;&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &lt;xsl:variable name=&quot;status&quot; select=&quot;.&quot;/&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &lt;xsl:for-each
&gt; select=&quot;TABLE[@NAME='XLATTABLE_EMPL_STATUS']/ROWS/ROW/COLUMN[@NAME='STATUS']&quot;&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &lt;xsl:value-of
&gt; select=&quot;TABLE[@NAME='XLATTABLE_EMPL_STATUS']/ROWS/ROW/COLUMN[@NAME='DESCR']&quot;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &lt;/xsl:for-each&gt;
&gt;
&gt; &#194;&#160; &lt;/xsl:if&gt;
&gt;
&gt; &#194;&#160; &lt;/xsl:for-each&gt;
&gt; &lt;/xsl:for-each&gt;
&gt; &lt;/xsl:template&gt;
&gt;
&gt; looks like
&gt; TABLE[@NAME='XLATTABLE_EMPL_STATUS']/ROWS/ROW/COLUMN[@NAME='STATUS']&quot; is not
&gt; working.
&gt;
&gt; Approaches I followed.
&gt; 1) &#194;&#160;../TABLE[@NAME='XLATTABLE_EMPL_STATUS']/ROWS/ROW/COLUMN[@NAME='STATUS']&quot;
&gt; 2)
&gt; parent::node()/TABLE[@NAME='XLATTABLE_EMPL_STATUS']/ROWS/ROW/COLUMN[@NAME='DESCR']
&gt;
&gt; Please suggest me on this.
&gt;
&gt;
&gt; Thanks,
&gt; Anil


-- 
Regards,
Mukul Gandhi

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305821.html</link>
</item><item>
<title>[xsl] Backward Navigation Problem - 11/2/2009 9:31:00 AM</title>
<description><![CDATA[<pre>Hi,

My sample XML file lok lilke this
&lt;root&gt;
&lt;employees&gt;
  &lt;employee hireDate=&quot;04/23/1999&quot;&gt;
    &lt;COLUMN NAME=&quot;LAST&quot;&gt;Hilllfrist&lt;/COLUMN&gt;  
    &lt;COLUMN NAME=&quot;STATUS&quot;&gt;&lt;![CDATA[A]]&gt;&lt;/COLUMN&gt;
  &lt;/employee&gt;
  &lt;employee hireDate=&quot;05/23/1999&quot;&gt;
    &lt;COLUMN NAME=&quot;LAST&quot;&gt;raj&lt;/COLUMN&gt;  
    &lt;COLUMN NAME=&quot;STATUS&quot;&gt;&lt;![CDATA[T]]&gt;&lt;/COLUMN&gt;
  &lt;/employee&gt;
&lt;/employees&gt;
&lt;TABLE NAME=&quot;XLATTABLE_EMPL_STATUS&quot;&gt;
&lt;ROWS&gt;
&lt;ROW&gt;
&lt;COLUMN NAME=&quot;STATUS&quot;&gt;&lt;![CDATA[T]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;DESCR&quot;&gt;&lt;![CDATA[Terminated]]&gt;&lt;/COLUMN&gt;
&lt;/ROW&gt;
&lt;ROW&gt;
&lt;COLUMN NAME=&quot;STATUS&quot;&gt;&lt;![CDATA[A]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;DESCR&quot;&gt;&lt;![CDATA[Active]]&gt;&lt;/COLUMN&gt;
&lt;/ROW&gt;
&lt;ROW&gt;
&lt;/TABLE &gt;
&lt;/root&gt;

I need to Iterate all the Status values  and need to fetch the 
description from XLATTABLE_EMPL_STATUS.

Example if the status is A, it has to be displayed as Active, if its T , 
it has to be displayed as Terminated.

My xsl code is as below.

xsl:template match=&quot;root&quot;&gt;
  &lt;xsl:for-each select=&quot;employees&quot;&gt;
    &lt;xsl:for-each select=&quot;employee&quot;&gt;
    &lt;xsl:if test=&quot;@NAME='STATUS'&quot;&gt;
        &lt;xsl:variable name=&quot;status&quot; select=&quot;.&quot;/&gt;        
   
        &lt;xsl:for-each 
select=&quot;TABLE[@NAME='XLATTABLE_EMPL_STATUS']/ROWS/ROW/COLUMN[@NAME='STATUS']&quot;&gt;
                &lt;xsl:value-of 
select=&quot;TABLE[@NAME='XLATTABLE_EMPL_STATUS']/ROWS/ROW/COLUMN[@NAME='DESCR']&quot;
        &lt;/xsl:for-each&gt;

    &lt;/xsl:if&gt;

    &lt;/xsl:for-each&gt;
&lt;/xsl:for-each&gt;
&lt;/xsl:template&gt;

looks like 
TABLE[@NAME='XLATTABLE_EMPL_STATUS']/ROWS/ROW/COLUMN[@NAME='STATUS']&quot; is 
not working.

Approaches I followed.
1)  ../TABLE[@NAME='XLATTABLE_EMPL_STATUS']/ROWS/ROW/COLUMN[@NAME='STATUS']&quot;
2) 
parent::node()/TABLE[@NAME='XLATTABLE_EMPL_STATUS']/ROWS/ROW/COLUMN[@NAME='DESCR']

Please suggest me on this.


Thanks,
Anil





 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305817.html</link>
</item><item>
<title>[xsl] XSL-List Guidelines - 11/1/2009 3:30:00 PM</title>
<description><![CDATA[<pre>This information is posted to the XSL-List (and the XSL-List Digest)
at intervals under the subject line &quot;XSL-List guidelines&quot;.

INTRODUCTION TO XSL-LIST

XSL-List hosts discussion of XSL itself, XSL applications and implementation, and XSL user questions. XSL-List is open to everyone, users and developers, experts and novices alike. There is no restriction to what may be posted on the XSL-List provided it is related to XSL, which is considered to include XSLT (versions 1 and 2), XPath (versions 1 and 2) and XSL Formatting Objects (FO).

XSL-List is not a W3C mailing list, and has no affiliation with W3C (or any official standing with any standards organization). However, XSL-List was established with the encouragement of members of the W3C XSL Working Group, and members of the Working Group are among the subscribers to the list.

Only subscribers can post to XSL-List, but since the goal is to increase the level of XSL knowledge, XSL-List is being archived for everybody to view. The topics being discussed on the XSL-List change as new ideas arise or existing problems are dealt with, but the archive contains all of the ideas and solutions that have been discussed on the list.

XSL-List is provided by Mulberry Technologies, Inc., as a service to the XSL user community. Mulberry is an XML and SGML consultancy specializing in applications that have a text design, processing, interchange, or display component. For more information about Mulberry Technologies, Inc. see http://www.mulberrytech.com 


SUBSCRIBING TO THE XSL-LIST

To subscribe to the list, fill out the form at http://www.mulberrytech.com/xsl/xsl-list/subscribe-unsubscribe.html.


DAILY DIGEST

Daily digests -- copies of a whole days XSL-List messages sent as one email message -- are available. Not only is it a single email message containing all of that day's XSL-List messages, it is also half the size, on average, of the individual messages since it doesn't include the overhead of the mail headers from each message.

To unsubscribe from the list and subscribe to the digest, use the form at http://www.mulberrytech.com/xsl/xsl-list/subscribe-unsubscribe.html.


POSTING GUIDELINES

Only subscribers can post to XSL-List, and only from the exact address they used when they subscribed.

There is no restriction on what may be posted to the XSL-List provided it is related to XSL. Items concerning XML but without a direct connection to XSL should be posted to a XML-related list instead of to the XSL-List. Items related to DSSSL should be posted to the DSSSList.

Do not begin your subject line with &quot;help&quot; or &quot;subscribe&quot; since the list software will bounce the message because it looks like is an administrative request.

It is best to start a new message for a new thread. Do not start a new thread by replying to an unrelated message and just changing the subject line, since the header of your message will contain references to the previous message and your new message will appear in the archive as one of the replies to the original message.

Both subscribers to the full list (xsl-list@lists.mulberrytech.com) and subscribers to the digest (xsl-list-digest@lists.mulberrytech.com) should post their messages to xsl- list@lists.mulberrytech.com; the messages will be received by both subscribers to the list and subscribers to the digest.


BEFORE YOU POST ... DO YOUR HOMEWORK
 - Check that your question isn't already answered in the XSL FAQ at http://www.dpawson.co.uk/.
 - Check that your question isn't already answered in the XSL-List archives at http://www.biglist.com/lists/xsl-list/archives/.
 - If you are asking for help with XSL code, determine which version of the language you are using (plus extensions, if any), and confirm that your XSL processor supports that version and/or extension. (If you are unsure of your processor, this can be determined by using the stylesheet at http://www.mulberrytech.com/xsl/xsl-list/processor-version.xsl on any input, including the stylesheet itself: see http://www.mulberrytech.com/xsl/xsl-list/processor-version.html for more information.) An XSLT 1.0 engine will not process stylesheets written in XSLT 2.0!


IN YOUR POSTING ...

Name the XSL processor, processor version, and version of the language you are using. This information is frequently necessary to diagnose a problem exactly, and always helps respondents give good advice.

If you are replying to a post, trim the quoted message to just the parts to which you are replying.

In addition to following simple rules of net etiquette and common sense, you will improve the chances that you will receive prompt and helpful responses by:
 - Asking questions specific enough that answers are possible. Describe what you are trying to do, how you approached it, what happened, and why you don't like the result you got. Don't simply say &quot;it gave me an error&quot;: paste in the error message (someone else can probably make sense of it).
  -  Illustrating your question with a demonstration of the problem. Well-composed questions frequently include a small XML sample, an XSLT stylesheet, the results received, and the result that was desired - all in miniature, to make it comprehensible to readers new to your problem. (It is also not uncommon to discover what a problem actually is in the process of reducing it to an illustrative version.)


USE INFORMATIVE SUBJECT LINES

When posting to the XSL-List, do not use uninformative subject lines like &quot;Urgent&quot;, &quot;Question&quot;, or &quot;Newbie HELP!!!&quot;, which don't say anything about what your problem is. Instead, use a meaningful subject line that will make sense to the people whose help you are trying to get. It may even get a response from people who normally shy away from &quot;beginner&quot; questions.

Informative subject lines make the XSL-List archive more useful since people with the same problem will more easily find the relevant threads.


DO NOT CROSS-POST

Cross-posting to the XSL-List and to another list, even XML-Dev or the DSSSList, is generally counter-productive. No list's archive will contain the complete thread; cross-posts from non-subscribers continuing the thread will bounce; and XSL-List subscribers who are not also on the other list will only see half the thread, as will those on the other list who are not also reading XSL- List. Subscribers to both lists may see two copies of the message, annoying them as well.


REPLIES GO TO THE LIST

The reply address of XSL-List messages (and of digests) is xsl-list@lists.mulberrytech.com so REPLIES GO TO THE LIST BY DEFAULT. If you want to reply to just the author of a post, you should change the &quot;To:&quot; field in your reply.


USE SHORT QUOTES OF PREVIOUS MESSAGES IN REPLIES

Please do not quote entire messages just to add a few lines at the beginning or end. Instead, quote the parts to which you are directly replying or quote enough to establish the context.

Everybody on the list has already received the message that you are quoting, and anyone searching the archive will find your message and the previous message listed under the same thread.

Subscribers to the XSL-List will just ignore most of the quoted messages and move to the next post, but subscribers to the XSL-List Digest will mostly have to page past the quoted messages to reach the next material in which they are interested in reading.


POSTINGS MUST BE IN PLAIN TEXT ONLY

Postings to XSL-List must be in plain text only. The XSL-List does not allow 
HTML postings because many users cannot display them appropriately, and because 
they are unnecessarily large. 


POSTINGS MAY NOT BE IN BASE 64

Postings to XSL-List may not be in Base 64 because it makes a mess of both the digest and the archive. 


ATTACHMENTS ARE BANNED

Since Mulberry's mailing lists have in the past been unwittingly used for spreading viruses in e-mail attachments, all e-mail attachments are banned from the XSL-List.

XSL stylesheets are XML files, and XML files are text files, so this does not affect the majority of posts to the list since you can include the files' text in the body of your message. If you need to refer to a binary file such as a PDF file, you should put the file on a Web site or FTP site and include the file's URL in your XSL-List post.

If you do include an attachment in your XSL-List post -- even a HTML attachment -- your message will bounce.


YOUR POST WILL BE PERMANENTLY ARCHIVED

Because it is a public resource created by and for the entire XSL
community, we do not edit XSL-List. Therefore, it is responsibility of
list subscribers not to post anything to the list that they do not want
publicly available, possibly for a very long time.

Postings in the list archives will be complete, including: all contents, examples, sample data, code or code fragments, and email header and footer contents. An automated process will obscure the domain portion of email addresses (the part after the @ sign).in the headers and footers of postings, but no guarnantee is made that this process will be completely successfull. Other than this, all postings will be archived in public as received.

Further, we at Mulberry could not, even if we wanted to, edit all of the 
archives of XSL-List. Several third-parties have created unofficial archives of 
XSL-List, often without asking, or even informing, Mulberry. Postings to XSL-List 
will be included in an unknown and ever-changing variety of web publications. If 
you don't want your questions/comments/answers in public view don't post them to 
XSL-List. 


THIRD-PARTY ARCHIVES OF XSL-LIST

Third parties are welcome to create searchable or reference archives of XSL-List
provided they adhere to the following guidelines: 
 - the material is clearly labelled as being from XSL-List, with 
   an acknowledgement of Mulberry's role as provider of XSL-List
 - there is a navigable pointer to the official list page at
   http://www.mulberrytech.com/xsl/xsl-list/ either on every posting 
   or associated with the user interface such that it is visible with 
   the postings
 - list postings are unedited
 - either the entire archive of the list is provided or there is a 
   clearly stated method for selecting the subset of the list that is provided

Mulberry does not provide these third parties with help to create these archives, does not endorse particular third party archives, and has no control over the ways in which they present the material in their systems.

People or organizations that publish the contents of XSL-List without following 
the guidelines above are being very antisocial. Please bookmark either 
the official XSL-List archive or one provided by a service that plays nicely 
in the community and shun those who do not give credit where credit it due.


UNSUBSCRIBING FROM THE XSL-LIST

To unsubscribe from XSL-List, use the form at http://www.mulberrytech.com/xsl/xsl-list/subscribe-unsubscribe.html.


UNSUBSCRIBING FROM THE XSL-LIST DIGEST

To unsubscribe from the XSL-List digest, use the form at http://www.mulberrytech.com/xsl/xsl-list/subscribe-unsubscribe.html.


IF YOU STOP GETTING XSL-LIST MESSAGES

If you stop receiving XSL-List message, you may have been removed because mail to you was bouncing. You are not being picked on, and you can just rejoin the list.


ARCHIVE

XSL-List messages are archived at http://www.biglist.com/lists/xsl-list/archives/.


REPORTING BUGS IN SOFTWARE

Bugs in software should firstly be reported to its author rather than to the XSL List. Questions regarding how to work around bugs are welcome, but the list does not function as a bug-tracking system for any software.


XSL FAQ AND OTHER INFORMATION ON XSL

Dave Pawson's XSL FAQ is at http://www.dpawson.co.uk/.

The W3C information on XSL is at http://www.w3.org/Style/XSL.

An excellent source of information about XSL is the XSL page of Robin Cover's SGML/XML Web Page at http://www.oasis-open.org/cover/xsl.html.

Mulberry's XSLT 1.0 and XPath 1.0 Quick Reference is at http://www.mulberrytech.com/quickref/.


DSSSLIST -- THE DSSSL USERS' MAILING LIST

Mulberry Technologies, Inc., also provides the DSSSList -- the DSSSL Users' Mailing List. For subscription information and the DSSSList archive, see http://www.mulberrytech.com/dsssl/dssslist.


CONTACT

If you have any questions or problems, please contact xsl-list-owner@lists.mulberrytech.com.


ADMINISTRATIVE COMMUNICATIONS

The list administrator will reply to emailed questions relating to the mechanics and administration of XSL-List and to help new users learn to use the list. However, the administrator will not take the time to navigate mazes of any sort in order to do so. If the list owner's messages are rejected by a user's anti-spam system the list owner will not pursue the matter. Similarly, if list-related notices to a subscriber are rejected as spam the subscriber will be unsubscribed. 



CHANGE History

==============
May 5, 2009 - btu. 

  10. Added paragraph clarifying that all content will be archived in 
      public, including text, examples, code, and email headers and 
      footers including names.

==============
February 1, 2008 - btu. 

  9. Policy on third-party archives added. 

  8. Policy banning attachments and postings in Base 64 clarified. 

==============
September 1, 2007 - btu. 

  7. Administrative communication policy clarified.  


==============
October 1, 2005 - btu. 

  6. Mulberry Technologies' relationship to XSL-List clarified. We 
     do the work. We pay the bills. Organizations who post unauthorized 
     copies of the archive without acknowledging Mulberry's contribution 
     are not playing nicely in the community. 

==============
March 2, 2005 - btu. 

  4. Users are asked to identify the version of XSLT and XPath
     they are using for questions that are specific to one version

  5. Clarifying the policy on editing the list archive (we don't edit
     it). 

==============
March 30, 2004 - btu. 

  1. All references to subscribing and unsubscribing have been
     updated to reflect changes in the list management system.

  2. Pointers to the XSL and XPath specification were removed. There
     are now so many specifications and draft specifications relevant
     to XSL that it is more practical to simply point to W3C's XSL
     page. 

  3. A few typographical errors were corrected.


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305778.html</link>
</item><item>
<title>Re: [xsl] Different behaviour for the first item in a    - 11/1/2009 7:31:00 AM</title>
<description><![CDATA[<pre>Ken,
Checked all 378 pages - Perfect!
Thanks to you and Martin for your help.

Mark 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305760.html</link>
</item><item>
<title>Re: [xsl] Different behaviour for the first item in a for-each-group - 11/1/2009 2:47:00 AM</title>
<description><![CDATA[<pre>At 2009-10-31 19:31 -0700, Mark Wilson wrote:
&gt;That seems to be it. I checked 28 of the 200+ pages and all was OK.
&gt;
&gt;Sorry I did not make it clear from the start. Also, somewhere along 
&gt;the line an un-needed for-each crept in.

Then you don't need $group-position ... in what I see in your bit 
below it is totally redundant.

&gt;            &lt;xsl:variable name=&quot;group-position&quot; select=&quot;position()&quot;/&gt;
&gt;                &lt;fo:table-row&gt;
&gt;                    &lt;xsl:if test=&quot;position()=1 and $group-position=1&quot;&gt;

It was there to get the first of the current-group() in the first of 
the groups, so if you aren't walking through the groups then you 
don't need it.  You are acting on only the first member of each 
group, thus I gather you are doing it for de-duping and not for 
classical grouping.

&gt;By the way, you have helped with this very same function three times 
&gt;now over the past year. For the record, here is the actual correct template.

You might want to review taking out $group-position because it isn't 
doing anything for you.

I'm glad things have worked out for you.  And a Happy Hallowe'en to 
you and yours!

. . . . . . . Ken


--
Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
Interested in other classes?  http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305749.html</link>
</item><item>
<title>Re: [xsl] Different behaviour for the first item in a   - 11/1/2009 2:32:00 AM</title>
<description><![CDATA[<pre>Hi Ken,
That seems to be it. I checked 28 of the 200+ pages and all was OK.

Sorry I did not make it clear from the start. Also, somewhere along the line 
an un-needed for-each crept in.

By the way, you have helped with this very same function three times now 
over the past year. For the record, here is the actual correct template.

Thanks again.
Happy Halloween!
Mark

xsl:template name=&quot;format-article&quot;&gt;
        &lt;xsl:for-each-group select=&quot;../Article&quot; group-by=&quot;Title&quot;&gt;
            &lt;xsl:sort select=&quot;Title&quot;/&gt;
            &lt;xsl:sort select=&quot;Year&quot;/&gt;
            &lt;xsl:sort select=&quot;IssueNumber&quot; data-type=&quot;number&quot;/&gt;
            &lt;xsl:sort select=&quot;Page&quot;/&gt;
            &lt;xsl:variable name=&quot;group-position&quot; select=&quot;position()&quot;/&gt;
                &lt;fo:table-row&gt;
                    &lt;xsl:if test=&quot;position()=1 and $group-position=1&quot;&gt;
                        &lt;!--then at the very first of the sorted 
population--&gt;
                        &lt;xsl:attribute 
name=&quot;keep-with-previous&quot;&gt;always&lt;/xsl:attribute&gt;
                    &lt;/xsl:if&gt;
                    &lt;!-- And all the others in a non-&quot;keeping&quot; row --&gt;
                    &lt;fo:table-cell&gt;
                        &lt;fo:block&gt;
                            &lt;xsl:choose&gt;
                                &lt;xsl:when test=&quot;parent::Item&quot;&gt;
                                    &lt;xsl:call-template name=&quot;article0&quot;/&gt;
                                &lt;/xsl:when&gt;
                                &lt;xsl:when test=&quot;parent::Level1&quot;&gt;
                                    &lt;xsl:call-template name=&quot;article1&quot;/&gt;
                                &lt;/xsl:when&gt;
                                &lt;xsl:when test=&quot;parent::Level2&quot;&gt;
                                    &lt;xsl:call-template name=&quot;article2&quot;/&gt;
                                &lt;/xsl:when&gt;
                                &lt;xsl:when test=&quot;parent::Level3&quot;&gt;
                                    &lt;xsl:call-template name=&quot;article3&quot;/&gt;
                                &lt;/xsl:when&gt;
                            &lt;/xsl:choose&gt;
                            &lt;fo:block xsl:use-attribute-sets=&quot;citation&quot;&gt;
                                &lt;fo:wrapper xsl:use-attribute-sets=&quot;title&quot;&gt;
                                    &lt;!--for a given title--&gt;
                                    &lt;xsl:apply-templates select=&quot;Title&quot;/&gt;
                                &lt;/fo:wrapper&gt;
                                &lt;xsl:apply-templates select=&quot;Person&quot;/&gt;
                                &lt;!--and for each citation--&gt;
                                &lt;xsl:apply-templates 
select=&quot;current-group()&quot; mode=&quot;format&quot;/&gt;
                            &lt;/fo:block&gt;
                        &lt;/fo:block&gt;
                    &lt;/fo:table-cell&gt;
                &lt;/fo:table-row&gt;
        &lt;/xsl:for-each-group&gt;
    &lt;/xsl:template&gt;
 



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305748.html</link>
</item><item>
<title>Re: [xsl] Different behaviour for the first item in a for-each-group - 11/1/2009 1:57:00 AM</title>
<description><![CDATA[<pre>At 2009-10-31 15:51 -0700, Mark Wilson wrote:
&gt;I was not careful in the way I described this problem. Each group 
&gt;consists of a single title with one or more citations. What I must 
&gt;have said is that I wanted to set the Title in each group to &quot;keep&quot;. 
&gt;What I *should* have said was, I want to set the only the first 
&gt;group to &quot;keep&quot;. For the input data at the end of this email, that 
&gt;would be the title &quot;Further observations&quot;.

Is it a co-incidence that it is alphabetically the first and 
positioned as first?  I'm assuming because of your use of &lt;xsl:sort&gt; 
that the alphabetical order is important in the determination of first.

&gt;All the rest would not be marked &quot;keep&quot;.

Then I would have worded your request &quot;the first of the sorted 
population&quot; not &quot;the first of the group&quot;.

&gt;Clearly, I do not want (from listing 1):
&gt;                    &lt;xsl:if test=&quot;position()=1&quot;&gt;
&gt;                        &lt;xsl:attribute 
&gt; name=&quot;keep-with-previous&quot;&gt;always&lt;/xsl:attribute&gt;
&gt;                    &lt;/xsl:if&gt;

It wasn't clear to me because you were grouping articles and asked 
for the first of the group.  I believe Martin interpreted it the same way.

I now understand you were grouping the population of articles and 
need a keep on the first of the sorted population.

&gt;However, I do not know XPath well. How do I select only the first 
&gt;group for marking and let the other groups pass without marking them?

   &lt;xsl:for-each-group select=&quot;...population...&quot;&gt;
     &lt;xsl:sort .../&gt;
     &lt;xsl:sort .../&gt;
     &lt;xsl:sort .../&gt;
     &lt;xsl:variable name=&quot;group-position&quot; select=&quot;position()&quot;/&gt;
     &lt;xsl:for-each select=&quot;current-group()&quot;&gt;
        &lt;fo:table-row&gt;
           &lt;xsl:if test=&quot;position()=1 and $group-position=1&quot;&gt;
              &lt;!--then at the very first of the sorted population--&gt;
              &lt;xsl:attribute name=&quot;keep-with-previous&quot;&gt;.....

I hope this helps.

. . . . . . . . . . . . . Ken


--
Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
Interested in other classes?  http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200911/msg1000305745.html</link>
</item><item>
<title>Re: [xsl] Different behaviour for the first item in a  for-each-group - 10/31/2009 10:52:00 PM</title>
<description><![CDATA[<pre>Hi Ken,
I was not careful in the way I described this problem. Each group consists 
of a single title with one or more citations. What I must have said is that 
I wanted to set the Title in each group to &quot;keep&quot;. What I *should* have said 
was, I want to set the only the first group to &quot;keep&quot;. For the input data at 
the end of this email, that would be the title &quot;Further observations&quot;. All 
the rest would not be marked &quot;keep&quot;.

Clearly, I do not want (from listing 1):
                    &lt;xsl:if test=&quot;position()=1&quot;&gt;
                        &lt;xsl:attribute 
name=&quot;keep-with-previous&quot;&gt;always&lt;/xsl:attribute&gt;
                    &lt;/xsl:if&gt;
However, I do not know XPath well. How do I select only the first group for 
marking and let the other groups pass without marking them?

All help appreciated.
Mark

Listing 1:
&lt;xsl:template name=&quot;format-article&quot;&gt;
        &lt;xsl:for-each-group select=&quot;../Article&quot; group-by=&quot;Title&quot;&gt;
            &lt;xsl:sort select=&quot;Title&quot;/&gt;
            &lt;xsl:sort select=&quot;Year&quot;/&gt;
            &lt;xsl:sort select=&quot;IssueNumber&quot; data-type=&quot;number&quot;/&gt;
            &lt;xsl:sort select=&quot;Page&quot;/&gt;
            &lt;xsl:for-each select=&quot;current-group()&quot;&gt;
                &lt;fo:table-row&gt;
                    &lt;!-- Put the first group in a keeping row--&gt;
                    &lt;xsl:if test=&quot;position()=1&quot;&gt;
                        &lt;xsl:attribute 
name=&quot;keep-with-previous&quot;&gt;always&lt;/xsl:attribute&gt;
                    &lt;/xsl:if&gt;
                    &lt;!-- And all the other groups in a non-&quot;keeping&quot; row --&gt;
                    &lt;fo:table-cell&gt;
                        &lt;fo:block&gt;
                            &lt;xsl:choose&gt;
                                &lt;xsl:when test=&quot;parent::Item&quot;&gt;
                                    &lt;xsl:call-template name=&quot;article0&quot;/&gt;
                                &lt;/xsl:when&gt;
                                &lt;xsl:when test=&quot;parent::Level1&quot;&gt;
                                    &lt;xsl:call-template name=&quot;article1&quot;/&gt;
                                &lt;/xsl:when&gt;
                                &lt;xsl:when test=&quot;parent::Level2&quot;&gt;
                                    &lt;xsl:call-template name=&quot;article2&quot;/&gt;
                                &lt;/xsl:when&gt;
                                &lt;xsl:when test=&quot;parent::Level3&quot;&gt;
                                    &lt;xsl:call-template name=&quot;article3&quot;/&gt;
                                &lt;/xsl:when&gt;
                            &lt;/xsl:choose&gt;
                            &lt;fo:block xsl:use-attribute-sets=&quot;citation&quot;&gt;
                                &lt;fo:wrapper xsl:use-attribute-sets=&quot;title&quot;&gt;
                                    &lt;!--for a given title--&gt;
                                    &lt;xsl:apply-templates select=&quot;Title&quot;/&gt;
                                &lt;/fo:wrapper&gt;
                                &lt;xsl:apply-templates select=&quot;Person&quot;/&gt;
                                &lt;!--and for each citation--&gt;
                                &lt;xsl:apply-templates 
select=&quot;current-group()&quot; mode=&quot;format&quot;/&gt;
                            &lt;/fo:block&gt;
                        &lt;/fo:block&gt;
                    &lt;/fo:table-cell&gt;
                &lt;/fo:table-row&gt;
            &lt;/xsl:for-each&gt;
        &lt;/xsl:for-each-group&gt;
    &lt;/xsl:template&gt;

Input data:
&lt;Item&gt;
     &lt;Article&gt;
        &lt;Title&gt;Further observations&lt;/Title&gt;
        &lt;IssueName&gt;Mar/Apr&lt;/IssueName&gt;
        &lt;Year&gt;1999&lt;/Year&gt;
        &lt;Page&gt;34&lt;/Page&gt;
        &lt;IssueNumber&gt;2&lt;/IssueNumber&gt;
    &lt;/Article&gt;
    &lt;Article&gt;
        &lt;Title&gt;Letters to the editor&lt;/Title&gt;
        &lt;IssueName&gt;Nov/Dec&lt;/IssueName&gt;
        &lt;Year&gt;2001&lt;/Year&gt;
        &lt;Page&gt;27&lt;/Page&gt;
        &lt;IssueNumber&gt;6&lt;/IssueNumber&gt;
    &lt;/Article&gt;
    &lt;Article&gt;
        &lt;Title&gt;Philatelic news and views&lt;/Title&gt;
        &lt;IssueName&gt;Sep/Oct&lt;/IssueName&gt;
        &lt;Year&gt;2001&lt;/Year&gt;
        &lt;Page&gt;35&lt;/Page&gt;
        &lt;IssueNumber&gt;5&lt;/IssueNumber&gt;
    &lt;/Article&gt;
    &lt;Article&gt;
        &lt;Title&gt;Philatelic news and views&lt;/Title&gt;
        &lt;IssueName&gt;Sep/Oct&lt;/IssueName&gt;
        &lt;Year&gt;2002&lt;/Year&gt;
        &lt;Page&gt;11&lt;/Page&gt;
        &lt;IssueNumber&gt;5&lt;/IssueNumber&gt;
    &lt;/Article&gt;
    &lt;Article&gt;
        &lt;Title&gt;Philatelic news and views&lt;/Title&gt;
        &lt;IssueName&gt;Nov/Dec&lt;/IssueName&gt;
        &lt;Year&gt;2002&lt;/Year&gt;
        &lt;Page&gt;28&lt;/Page&gt;
        &lt;IssueNumber&gt;6&lt;/IssueNumber&gt;
    &lt;/Article&gt;
    &lt;Article&gt;
        &lt;Title&gt;Philatelic news and views&lt;/Title&gt;
        &lt;IssueName&gt;Jan/Feb&lt;/IssueName&gt;
        &lt;Year&gt;2003&lt;/Year&gt;
        &lt;Page&gt;24&lt;/Page&gt;
        &lt;IssueNumber&gt;1&lt;/IssueNumber&gt;
    &lt;/Article&gt;
    &lt;Article&gt;
        &lt;Title&gt;Philatelic news and views&lt;/Title&gt;
        &lt;IssueName&gt;Nov/Dec&lt;/IssueName&gt;
        &lt;Year&gt;2006&lt;/Year&gt;
        &lt;Page&gt;18&lt;/Page&gt;
        &lt;IssueNumber&gt;6&lt;/IssueNumber&gt;
    &lt;/Article&gt;
&lt;/Item&gt; 



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305736.html</link>
</item><item>
<title>Re: [xsl] Setting a foreign attribute - 10/31/2009 9:50:00 PM</title>
<description><![CDATA[<pre>Hi Ken
Worked again.

I think I only have one problem left (Cell too large to fit on a single 
page). I'll look at that, but the rest of the &quot;keep&quot; problem seems solved: 
pages seem to be ending correctly, but I have almost 200 of them to check 
first.
Thanks,
Mark
 



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305733.html</link>
</item><item>
<title>Re: [xsl] Setting a foreign attribute - 10/31/2009 9:24:00 PM</title>
<description><![CDATA[<pre>At 2009-10-31 14:15 -0700, Mark Wilson wrote:
&gt;FOP does not like this fragment and calls &lt;xsl:use-attribute-sets&gt; a 
&gt;foreign attribute.

Right ... xsl:use-attribute-sets= is recognized by XSLT processors 
and you are putting that attribute into an XSL-FO file which doesn't 
recognize it because it isn't part of the FO vocabulary so FO 
processors rightfully complain.

&gt;                    &lt;fo:block&gt;
&gt;                         &lt;xsl:choose&gt;
&gt;                                &lt;xsl:when test=&quot;parent::Item&quot;&gt;
&gt;                                    &lt;xsl:attribute name=&quot; 
&gt; xsl:use-attribute-sets&quot;&gt;article0&lt;/xsl:attribute&gt;
&gt;                                &lt;/xsl:when&gt;
&gt;                                &lt;xsl:when test=&quot;parent::Level1&quot;&gt;
&gt;                                    &lt;xsl:attribute name=&quot; 
&gt; xsl:use-attribute-sets&quot;&gt;article1&lt;/xsl:attribute&gt;
&gt;                                &lt;/xsl:when&gt;
&gt;                                &lt;xsl:when test=&quot;parent::Level2&quot;&gt;
&gt;                                    &lt;xsl:attribute name=&quot; 
&gt; xsl:use-attribute-sets&quot;&gt;article2&lt;/xsl:attribute&gt;
&gt;                                &lt;/xsl:when&gt;
&gt;                                &lt;xsl:when test=&quot;parent::Level3&quot;&gt;
&gt;                                    &lt;xsl:attribute name=&quot; 
&gt; xsl:use-attribute-sets&quot;&gt;article3&lt;/xsl:attribute&gt;
&gt;                                &lt;/xsl:when&gt;
&gt;                            &lt;/xsl:choose&gt;
&gt;
&gt;                                    .....
&gt;                        &lt;/fo:block&gt;
&gt;
&gt;Is there a way to set &lt;xsl:attribute-sets&gt; similar to my 
&gt;unacceptable construction, or do I have to create all six attributes 
&gt;for each &lt;xsl:when&gt;?

The latter.  You've overlooked what is happening where in the 
process.  xsl:use-attribute-sets= is acted on during the building of 
the result tree and isn't recognized when placed directly in the result tree.

If you change:

   &lt;xsl:attribute-set name=&quot;article0&quot;&gt;
     ...
   &lt;/xsl:attribute-set&gt;

to:

   &lt;xsl:template name=&quot;article0&quot;&gt;
     ...
   &lt;/xsl:template&gt;

Then you can use &lt;xsl:call-template name='article0'/&gt; in order to add 
all of the attributes, but it means that everywhere where you have:

   &lt;fo:block xsl:use-attribute-sets=&quot;article0&quot;&gt;
     ...

you will need to have:

   &lt;fo:block&gt;
     &lt;xsl:call-template name='article0'/&gt;
     ...

But there are features of xsl:use-attribute-sets= that might mean you 
can't just do that everywhere.

I hope this helps.

. . . . . . . . . . Ken

--
Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
Interested in other classes?  http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305732.html</link>
</item><item>
<title>[xsl] Setting a foreign attribute - 10/31/2009 9:16:00 PM</title>
<description><![CDATA[<pre>Hi all,
FOP does not like this fragment and calls &lt;xsl:use-attribute-sets&gt; a foreign 
attribute.

                    &lt;fo:block&gt;
                         &lt;xsl:choose&gt;
                                &lt;xsl:when test=&quot;parent::Item&quot;&gt;
                                    &lt;xsl:attribute name=&quot; 
xsl:use-attribute-sets&quot;&gt;article0&lt;/xsl:attribute&gt;
                                &lt;/xsl:when&gt;
                                &lt;xsl:when test=&quot;parent::Level1&quot;&gt;
                                    &lt;xsl:attribute name=&quot; 
xsl:use-attribute-sets&quot;&gt;article1&lt;/xsl:attribute&gt;
                                &lt;/xsl:when&gt;
                                &lt;xsl:when test=&quot;parent::Level2&quot;&gt;
                                    &lt;xsl:attribute name=&quot; 
xsl:use-attribute-sets&quot;&gt;article2&lt;/xsl:attribute&gt;
                                &lt;/xsl:when&gt;
                                &lt;xsl:when test=&quot;parent::Level3&quot;&gt;
                                    &lt;xsl:attribute name=&quot; 
xsl:use-attribute-sets&quot;&gt;article3&lt;/xsl:attribute&gt;
                                &lt;/xsl:when&gt;
                            &lt;/xsl:choose&gt;

                                    .....
                        &lt;/fo:block&gt;

Is there a way to set &lt;xsl:attribute-sets&gt; similar to my unacceptable 
construction, or do I have to create all six attributes for each &lt;xsl:when&gt;?

Thanks,
Mark 



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305730.html</link>
</item><item>
<title>Re: [xsl] copy attributes, except some - 10/31/2009 9:16:00 PM</title>
<description><![CDATA[<pre>Hi Wendell,

Not all problems can be presented simply.  This one had quite a few 
parameters, including the fact that it was not a single thing but a 
recurring pattern with growing overhead.  It took some time but it works 
out ok, thanks to everyone who contributed.

Has it is a relatively fundamental XML/XSL pattern I just also submit 
that it may be worth giving it a second thought in case, at some point 
in the evolution of XSLT, there is a way to work out a simpler 
solution.  Comparing nodes and comparing node values are quite well 
taken care of, but comparing node names, in a namespace safe way is a 
little trickier.  It is settled for me now and it may have been useful 
for others, so maybe it is fine. I may not be a good judge for the 
relevancy of a more obvious solution, anymore. Maybe better documenting 
it in the reference manuals could be enough.

In any case, thank you again.

Cheers,
ac




&gt; AC,
&gt;
&gt; At 09:02 PM 10/29/2009, you wrote:
&gt;&gt; Hi Wendell,
&gt;&gt;
&gt;&gt; True. The thing that still bothers me with this is that since nodes 
&gt;&gt; and content are compared, a variable like $excepted-attributes has to 
&gt;&gt; be defined for every attribute group, for every tree/subtree that may 
&gt;&gt; get copied which is getting to be quite an overhead here.
&gt;
&gt; Yes, certainly. My suggestion is clean only if the variable can be 
&gt; declared at the top -- that is, if @name1 attributes are always to be 
&gt; excluded. Even then, there are situations where it will be problematic.
&gt;
&gt; This is the problem with posting fragments of problems to the list. As 
&gt; we have noted before (in this thread and elsewhere), without a 
&gt; complete problem spec, we can't really provide a solution. For 
&gt; example, a parameterized approach, in which $exclude-attributes would 
&gt; be passed through templates (using a tunnel parameter) and modified 
&gt; where necessary, might be another thing worth trying.
&gt;
&gt; On the other hand, sometimes our waving flashlights in the dark will 
&gt; lead to an accidental insight which is at least as good, or better, 
&gt; than a solution. If that's the case here, we should call it a success.
&gt;
&gt; Cheers,
&gt; Wendell
&gt;
&gt;
&gt;
&gt; ======================================================================
&gt; Wendell Piez                            mailto:wapiez@mulberrytech.com
&gt; Mulberry Technologies, Inc.                http://www.mulberrytech.com
&gt; 17 West Jefferson Street                    Direct Phone: 301/315-9635
&gt; Suite 207                                          Phone: 301/315-9631
&gt; Rockville, MD  20850                                 Fax: 301/315-8285
&gt; ----------------------------------------------------------------------
&gt;   Mulberry Technologies: A Consultancy Specializing in SGML and XML
&gt; ======================================================================
&gt;
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305731.html</link>
</item><item>
<title>Re: [xsl] Different behaviour for the first item in a  for-each-group - 10/31/2009 6:48:00 PM</title>
<description><![CDATA[<pre>Hi Ken,
As always, sweet!

I am working my way through the &quot;keep&quot; problem we discussed yesterday and I 
think your hint below will let me simplify all of my templates, not just 
this one. I was worried about all the duplication I was putting in. Better 
to keep it clean now than to re-factor later!

Thanks,
Mark

 



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305723.html</link>
</item><item>
<title>Re: [xsl] Different behaviour for the first item in a for-each-group - 10/31/2009 6:40:00 PM</title>
<description><![CDATA[<pre>At 2009-10-31 11:10 -0700, Mark Wilson wrote:
&gt;I have a working template that I need to modify. At the moment, as 
&gt;it iterates through the for-each-group, every group (Title) is 
&gt;treated identically. I need to provide a different behavior The 
&gt;first group will be wrapped by a row/cell with the &quot;keep &quot;property, 
&gt;all others in a non-&quot;keep&quot; property row/cell.  The current template 
&gt;is in Listing 1, my attempt to modify it in listing 2. Before I 
&gt;bollix everything up, would someone look it over and tell me if I 
&gt;have done it right or if there is a better way?

There are better approaches to what you've done that I think will 
help.  Your listing 2 is characterized by a lot of duplication that I 
think is not necessary.

&gt;Listing 2:
&gt;&lt;xsl:template name=&quot;format-article&quot;&gt;
&gt;        &lt;xsl:for-each-group select=&quot;../Article&quot; group-by=&quot;Title&quot;&gt;
&gt;            &lt;xsl:sort select=&quot;Title&quot;/&gt;
&gt;            &lt;xsl:sort select=&quot;Year&quot;/&gt;
&gt;            &lt;xsl:sort select=&quot;IssueNumber&quot; data-type=&quot;number&quot;/&gt;
&gt;            &lt;xsl:sort select=&quot;Page&quot;/&gt;
&gt;            &lt;!-- Put the first citation in a keeping row--&gt;
&gt;            &lt;xsl:for-each select=&quot;current-group()&quot;&gt;
&gt;                &lt;xsl:choose&gt;
&gt;                    &lt;xsl:when test=&quot;current-group()[1]&quot;&gt;

The above test will always be true because you are testing that the 
group exists (in that the first member of the group exists) which is 
going to be true because you just created the group.

&gt;               &lt;fo:table-row keep-with-previous=&quot;always&quot;&gt;

The above attribute appears to be the only difference in the 
behaviour, and that correlates with your description above, so there 
is a better way to address this requirement by only selectively 
adding the attribute:

    &lt;xsl:template name=&quot;format-article&quot;&gt;
        &lt;xsl:for-each-group select=&quot;../Article&quot; group-by=&quot;Title&quot;&gt;
            &lt;xsl:sort select=&quot;Title&quot;/&gt;
            &lt;xsl:sort select=&quot;Year&quot;/&gt;
            &lt;xsl:sort select=&quot;IssueNumber&quot; data-type=&quot;number&quot;/&gt;
            &lt;xsl:sort select=&quot;Page&quot;/&gt;
            &lt;!-- Put the first citation in a keeping row--&gt;
            &lt;xsl:for-each select=&quot;current-group()&quot;&gt;
              &lt;fo:table-row&gt;
                 &lt;xsl:if test=&quot;position()=1&quot;&gt;
                  &lt;xsl:attribute 
name=&quot;keep-with-previous&quot;&gt;always&lt;/xsl:attribute&gt;
                 &lt;/xsl:if&gt;
                 &lt;fo:table-cell&gt;
                   &lt;fo:block xsl:use-attribute-sets=&quot;citation&quot;&gt;
                     &lt;fo:wrapper xsl:use-attribute-sets=&quot;title&quot;&gt;
                       &lt;xsl:apply-templates select=&quot;Title&quot;/&gt;
                     &lt;/fo:wrapper&gt;
                     &lt;xsl:apply-templates select=&quot;Person&quot;/&gt;
                     &lt;xsl:apply-templates select=&quot;current-group()&quot;
                                          mode=&quot;format&quot;/&gt;
                   &lt;/fo:block&gt;
                 &lt;/fo:table-cell&gt;
              &lt;/fo:table-row&gt;
            &lt;/xsl:for-each&gt;
            ...

I hope this helps!

. . . . . . . . . . . . Ken


--
Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
Interested in other classes?  http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305722.html</link>
</item><item>
<title>Re: [xsl] Different behaviour for the first item in a for-each-group - 10/31/2009 6:38:00 PM</title>
<description><![CDATA[<pre>Hi Martin,
Thanks. Yes, position() is what I want.
Mark

 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305721.html</link>
</item><item>
<title>Re: [xsl] Different behaviour for the first item in a for-each-group - 10/31/2009 6:32:00 PM</title>
<description><![CDATA[<pre>Mark Wilson wrote:

&gt; I have a working template that I need to modify. At the moment, as it 
&gt; iterates through the for-each-group, every group (Title) is treated 
&gt; identically. I need to provide a different behavior The first group will 
&gt; be wrapped by a row/cell with the &quot;keep &quot;property, all others in a 
&gt; non-&quot;keep&quot; property row/cell.  The current template is in Listing 1, my 
&gt; attempt to modify it in listing 2. Before I bollix everything up, would 
&gt; someone look it over and tell me if I have done it right or if there is 
&gt; a better way?

&gt; &lt;xsl:template name=&quot;format-article&quot;&gt;
&gt;        &lt;xsl:for-each-group select=&quot;../Article&quot; group-by=&quot;Title&quot;&gt;
&gt;            &lt;xsl:sort select=&quot;Title&quot;/&gt;
&gt;            &lt;xsl:sort select=&quot;Year&quot;/&gt;
&gt;            &lt;xsl:sort select=&quot;IssueNumber&quot; data-type=&quot;number&quot;/&gt;
&gt;            &lt;xsl:sort select=&quot;Page&quot;/&gt;
&gt;            &lt;!-- Put the first citation in a keeping row--&gt;
&gt;            &lt;xsl:for-each select=&quot;current-group()&quot;&gt;
&gt;                &lt;xsl:choose&gt;
&gt;                    &lt;xsl:when test=&quot;current-group()[1]&quot;&gt;
&gt;                        &lt;fo:table-row keep-with-previous=&quot;always&quot;&gt;
&gt;                        &lt;fo:table-cell&gt;
&gt;                            &lt;fo:block xsl:use-attribute-sets=&quot;citation&quot;&gt;
&gt;                                         &lt;fo:wrapper 
&gt; xsl:use-attribute-sets=&quot;title&quot;&gt;
&gt;                                    &lt;xsl:apply-templates select=&quot;Title&quot;/&gt;
&gt;                                &lt;/fo:wrapper&gt;
&gt;                                &lt;xsl:apply-templates select=&quot;Person&quot;/&gt;
&gt;                                &lt;!--and for each citation--&gt;
&gt;                                &lt;xsl:apply-templates 
&gt; select=&quot;current-group()&quot; mode=&quot;format&quot;/&gt;
&gt;                            &lt;/fo:block&gt;
&gt;                        &lt;/fo:table-cell&gt;
&gt;                            &lt;/fo:table-row&gt;
&gt;                    &lt;/xsl:when&gt;
&gt;                    &lt;xsl:otherwise&gt;
&gt;                        &lt;fo:table-row&gt;
&gt;                            &lt;fo:table-cell&gt;
&gt;                                &lt;!--and put all the other citations in 
&gt; one a non-keeping row--&gt;
&gt;                                &lt;fo:block xsl:use-attribute-sets=&quot;citation&quot;&gt;
&gt;                                    &lt;fo:wrapper 
&gt; xsl:use-attribute-sets=&quot;title&quot;&gt;
&gt;                                        &lt;xsl:apply-templates 
&gt; select=&quot;Title&quot;/&gt;
&gt;                                    &lt;/fo:wrapper&gt;
&gt;                                    &lt;xsl:apply-templates select=&quot;Person&quot;/&gt;
&gt;                                    &lt;xsl:apply-templates 
&gt; select=&quot;current-group()&quot; mode=&quot;format&quot;/&gt;
&gt;                                &lt;/fo:block&gt;
&gt;                            &lt;/fo:table-cell&gt;
&gt;                            &lt;/fo:table-row&gt;
&gt;                    &lt;/xsl:otherwise&gt;
&gt;                &lt;/xsl:choose&gt;
&gt;            &lt;/xsl:for-each&gt;
&gt;        &lt;/xsl:for-each-group&gt;
&gt;    &lt;/xsl:template&gt;

Inside of the for-each-group position() will give you the &quot;number&quot; of 
the group being processed thus if you want to treat the first group 
differently then I think you want

&lt;xsl:template name=&quot;format-article&quot;&gt;
        &lt;xsl:for-each-group select=&quot;../Article&quot; group-by=&quot;Title&quot;&gt;
            &lt;xsl:sort select=&quot;Title&quot;/&gt;
            &lt;xsl:sort select=&quot;Year&quot;/&gt;
            &lt;xsl:sort select=&quot;IssueNumber&quot; data-type=&quot;number&quot;/&gt;
            &lt;xsl:sort select=&quot;Page&quot;/&gt;


                &lt;xsl:choose&gt;
                    &lt;xsl:when test=&quot;position() eq 1&quot;&gt;
                        &lt;fo:table-row keep-with-previous=&quot;always&quot;&gt;
                        &lt;fo:table-cell&gt;
                            &lt;fo:block xsl:use-attribute-sets=&quot;citation&quot;&gt;
                                         &lt;fo:wrapper 
xsl:use-attribute-sets=&quot;title&quot;&gt;
                                    &lt;xsl:apply-templates select=&quot;Title&quot;/&gt;
                                &lt;/fo:wrapper&gt;
                                &lt;xsl:apply-templates select=&quot;Person&quot;/&gt;
                                &lt;!--and for each citation--&gt;
                                &lt;xsl:apply-templates 
select=&quot;current-group()&quot; mode=&quot;format&quot;/&gt;
                            &lt;/fo:block&gt;
                        &lt;/fo:table-cell&gt;
                            &lt;/fo:table-row&gt;
                    &lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;
                        &lt;fo:table-row&gt;
                            &lt;fo:table-cell&gt;
                                &lt;!--and put all the other citations in 
one a non-keeping row--&gt;
                                &lt;fo:block xsl:use-attribute-sets=&quot;citation&quot;&gt;
                                    &lt;fo:wrapper 
xsl:use-attribute-sets=&quot;title&quot;&gt;
                                        &lt;xsl:apply-templates 
select=&quot;Title&quot;/&gt;
                                    &lt;/fo:wrapper&gt;
                                    &lt;xsl:apply-templates select=&quot;Person&quot;/&gt;
                                    &lt;xsl:apply-templates 
select=&quot;current-group()&quot; mode=&quot;format&quot;/&gt;
                                &lt;/fo:block&gt;
                            &lt;/fo:table-cell&gt;
                            &lt;/fo:table-row&gt;
                    &lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;

        &lt;/xsl:for-each-group&gt;
    &lt;/xsl:template&gt;

-- 

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305720.html</link>
</item><item>
<title>[xsl] Different behaviour for the first item in a for-each-group - 10/31/2009 6:11:00 PM</title>
<description><![CDATA[<pre>Hi all,
I have a working template that I need to modify. At the moment, as it 
iterates through the for-each-group, every group (Title) is treated 
identically. I need to provide a different behavior The first group will be 
wrapped by a row/cell with the &quot;keep &quot;property, all others in a non-&quot;keep&quot; 
property row/cell.  The current template is in Listing 1, my attempt to 
modify it in listing 2. Before I bollix everything up, would someone look it 
over and tell me if I have done it right or if there is a better way?

Listing 1.
 &lt;xsl:template name=&quot;format-article&quot;&gt;
        &lt;xsl:for-each-group select=&quot;../Article&quot; group-by=&quot;Title&quot;&gt;
            &lt;xsl:sort select=&quot;Title&quot;/&gt;
            &lt;xsl:sort select=&quot;Year&quot;/&gt;
            &lt;xsl:sort select=&quot;IssueNumber&quot; data-type=&quot;number&quot;/&gt;
            &lt;xsl:sort select=&quot;Page&quot;/&gt;
                        &lt;fo:block xsl:use-attribute-sets=&quot;citation&quot;&gt;
                &lt;!--for a given title, put the first group in one block--&gt;
                &lt;fo:wrapper xsl:use-attribute-sets=&quot;title&quot;&gt;
                    &lt;xsl:apply-templates select=&quot;Title&quot;/&gt;
                &lt;/fo:wrapper&gt;
                &lt;xsl:apply-templates select=&quot;Person&quot;/&gt;
                &lt;!--and for each citation--&gt;
                &lt;xsl:apply-templates select=&quot;current-group()&quot; 
mode=&quot;format&quot;/&gt;
            &lt;/fo:block&gt;
        &lt;/xsl:for-each-group&gt;
    &lt;/xsl:template&gt;

Listing 2:
 &lt;xsl:template name=&quot;format-article&quot;&gt;
        &lt;xsl:for-each-group select=&quot;../Article&quot; group-by=&quot;Title&quot;&gt;
            &lt;xsl:sort select=&quot;Title&quot;/&gt;
            &lt;xsl:sort select=&quot;Year&quot;/&gt;
            &lt;xsl:sort select=&quot;IssueNumber&quot; data-type=&quot;number&quot;/&gt;
            &lt;xsl:sort select=&quot;Page&quot;/&gt;
            &lt;!-- Put the first citation in a keeping row--&gt;
            &lt;xsl:for-each select=&quot;current-group()&quot;&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test=&quot;current-group()[1]&quot;&gt;
                        &lt;fo:table-row keep-with-previous=&quot;always&quot;&gt;
                        &lt;fo:table-cell&gt;
                            &lt;fo:block xsl:use-attribute-sets=&quot;citation&quot;&gt;
                                         &lt;fo:wrapper 
xsl:use-attribute-sets=&quot;title&quot;&gt;
                                    &lt;xsl:apply-templates select=&quot;Title&quot;/&gt;
                                &lt;/fo:wrapper&gt;
                                &lt;xsl:apply-templates select=&quot;Person&quot;/&gt;
                                &lt;!--and for each citation--&gt;
                                &lt;xsl:apply-templates 
select=&quot;current-group()&quot; mode=&quot;format&quot;/&gt;
                            &lt;/fo:block&gt;
                        &lt;/fo:table-cell&gt;
                            &lt;/fo:table-row&gt;
                    &lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;
                        &lt;fo:table-row&gt;
                            &lt;fo:table-cell&gt;
                                &lt;!--and put all the other citations in one a 
non-keeping row--&gt;
                                &lt;fo:block xsl:use-attribute-sets=&quot;citation&quot;&gt;
                                    &lt;fo:wrapper 
xsl:use-attribute-sets=&quot;title&quot;&gt;
                                        &lt;xsl:apply-templates 
select=&quot;Title&quot;/&gt;
                                    &lt;/fo:wrapper&gt;
                                    &lt;xsl:apply-templates select=&quot;Person&quot;/&gt;
                                    &lt;xsl:apply-templates 
select=&quot;current-group()&quot; mode=&quot;format&quot;/&gt;
                                &lt;/fo:block&gt;
                            &lt;/fo:table-cell&gt;
                            &lt;/fo:table-row&gt;
                    &lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:for-each&gt;
        &lt;/xsl:for-each-group&gt;
    &lt;/xsl:template&gt;
 



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305719.html</link>
</item><item>
<title>Re: [xsl] Widows and orphans in XSL-FO - 10/31/2009 1:50:00 AM</title>
<description><![CDATA[<pre>Hi Ken,
That is close, but  any of the red elements (including the top level ones) 
may be followed by a back element before one of the lower level red levels 
is encountered.

I think, though, you have given me the general idea. I work on it for 
awhile.

Thanks,
Mark

--------------------------------------------------
From: &quot;G. Ken Holman&quot; &lt;gkholman@CraneSoftwrights.com&gt;
Sent: Friday, October 30, 2009 5:57 PM
To: &lt;xsl-list@lists.mulberrytech.com&gt;
Subject: Re: [xsl] Widows and orphans in XSL-FO

&gt; At 2009-10-30 17:44 -0700, Mark Wilson wrote:
&gt;&gt;Sorry my original post was not clear enough. I have a short output PDF 
&gt;&gt;file that may show better what I mean, but I cannot send it to the list. A 
&gt;&gt;longer copy is on the web at:
&gt;&gt;
&gt;&gt;http://www.knihtisk.org/library/specialist/pdf/a.pdf
&gt;
&gt; That helps a lot.
&gt;
&gt;&gt;Page 1 ends with &quot;Kvapilov&#225;, Hana&quot;
&gt;&gt;
&gt;&gt;In a perfect world, it would have ended with the line above it, &quot;New 
&gt;&gt;issues: Czech Republic. Jan/Feb 1996 p.23.&quot; which is an &lt;Article&gt; element 
&gt;&gt;and Kvapilov&#225;, Hana&quot; ( a &lt;SubDiv1&gt; element), would have been pushed to the 
&gt;&gt;next page.
&gt;&gt;
&gt;&gt;The rule I want to enforce is:
&gt;&gt;&quot;A page may only end with one or more renditions of &lt;Article&gt; elements.&quot; 
&gt;&gt;(Visually: a page may only end with a black rendition, never a red 
&gt;&gt;rendition).
&gt;&gt;
&gt;&gt;The bottom of page 3 shows how pages should end. There, a list of 
&gt;&gt;&lt;Article&gt; elements extends from the bottom of page 3 to the top of page 4
&gt;&gt;
&gt;&gt;I did get a lead on &quot;blind tables&quot; with my Google search and am attempting 
&gt;&gt;to see if that will work for me. The &quot;keep-&quot; properties seems more in line 
&gt;&gt;with my needs than the &quot;break-&quot; properties, but I am not sure.
&gt;
&gt; How about for your top-level entries (e.g. &quot;Actors&quot;) you don't use a keep.
&gt;
&gt; Then for their first-level children (i.e. starting with &quot;-&quot;) and 
&gt; second-level grandchildren (i.e. starting with &quot;- - &quot;) use 
&gt; keep-with-next.within-column=&quot;always&quot;.
&gt;
&gt; Then for the black lines, use keep-with-previous.within-column=&quot;always&quot;. 
&gt; This handles the two lines of the &quot;Velehrad&quot; entry.
&gt;
&gt; That way you'll get no page breaks between your red and black lines.  Nor 
&gt; will you get a break between *adjacent* red lines.  If you don't want a 
&gt; break before &quot;Strahovaska Madona&quot; then add 
&gt; keep-with-previous.within-column=&quot;always&quot; to the &quot;- - &quot; grandchildren.
&gt;
&gt; Page breaks should put first-level children at the top of the column, 
&gt; except between the first child of a top-level entry.
&gt;
&gt; I think that will get you real close and perhaps meet all of your 
&gt; requirements as I understand them.
&gt;
&gt; I hope this helps.
&gt;
&gt; . . . . . . . . . . . . . Ken
&gt;
&gt; --
&gt; Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
&gt; Interested in other classes?  http://www.CraneSoftwrights.com/s/i/
&gt; Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
&gt; Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
&gt; Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
&gt; Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
&gt; G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
&gt; Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
&gt; Legal business disclaimers:  http://www.CraneSoftwrights.com/legal
&gt;
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;
&gt; 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305682.html</link>
</item><item>
<title>Re: [xsl] Widows and orphans in XSL-FO - 10/31/2009 12:58:00 AM</title>
<description><![CDATA[<pre>At 2009-10-30 17:44 -0700, Mark Wilson wrote:
&gt;Sorry my original post was not clear enough. I 
&gt;have a short output PDF file that may show 
&gt;better what I mean, but I cannot send it to the 
&gt;list. A longer copy is on the web at:
&gt;
&gt;http://www.knihtisk.org/library/specialist/pdf/a.pdf

That helps a lot.

&gt;Page 1 ends with &quot;Kvapilov&#225;, Hana&quot;
&gt;
&gt;In a perfect world, it would have ended with the 
&gt;line above it, &quot;New issues: Czech Republic. 
&gt;Jan/Feb 1996 p.23.&quot; which is an &lt;Article&gt; 
&gt;element and Kvapilov&#225;, Hana&quot; ( a &lt;SubDiv1&gt; 
&gt;element), would have been pushed to the next page.
&gt;
&gt;The rule I want to enforce is:
&gt;&quot;A page may only end with one or more renditions 
&gt;of &lt;Article&gt; elements.&quot; (Visually: a page may 
&gt;only end with a black rendition, never a red rendition).
&gt;
&gt;The bottom of page 3 shows how pages should end. 
&gt;There, a list of &lt;Article&gt; elements extends from 
&gt;the bottom of page 3 to the top of page 4
&gt;
&gt;I did get a lead on &quot;blind tables&quot; with my 
&gt;Google search and am attempting to see if that 
&gt;will work for me. The &quot;keep-&quot; properties seems 
&gt;more in line with my needs than the &quot;break-&quot; properties, but I am not sure.

How about for your top-level entries (e.g. &quot;Actors&quot;) you don't use a keep.

Then for their first-level children (i.e. 
starting with &quot;-&quot;) and second-level grandchildren 
(i.e. starting with &quot;- - &quot;) use keep-with-next.within-column=&quot;always&quot;.

Then for the black lines, use 
keep-with-previous.within-column=&quot;always&quot;.  This 
handles the two lines of the &quot;Velehrad&quot; entry.

That way you'll get no page breaks between your 
red and black lines.  Nor will you get a break 
between *adjacent* red lines.  If you don't want 
a break before &quot;Strahovaska Madona&quot; then add 
keep-with-previous.within-column=&quot;always&quot; to the &quot;- - &quot; grandchildren.

Page breaks should put first-level children at 
the top of the column, except between the first child of a top-level entry.

I think that will get you real close and perhaps 
meet all of your requirements as I understand them.

I hope this helps.

. . . . . . . . . . . . . Ken

--
Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
Interested in other classes?  http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305677.html</link>
</item><item>
<title>Re: [xsl] Widows and orphans in XSL-FO - 10/31/2009 12:45:00 AM</title>
<description><![CDATA[<pre>Hi Ken,
Sorry my original post was not clear enough. I have a short output PDF file 
that may show better what I mean, but I cannot send it to the list. A longer 
copy is on the web at:

 http://www.knihtisk.org/library/specialist/pdf/a.pdf

Page 1 ends with &quot;Kvapilov&#225;, Hana&quot;

In a perfect world, it would have ended with the line above it, &quot;New issues: 
Czech Republic. Jan/Feb 1996 p.23.&quot; which is an &lt;Article&gt; element and 
Kvapilov&#225;, Hana&quot; ( a &lt;SubDiv1&gt; element), would have been pushed to the next 
page.

The rule I want to enforce is:
&quot;A page may only end with one or more renditions of &lt;Article&gt; elements.&quot; 
(Visually: a page may only end with a black rendition, never a red 
rendition).

The bottom of page 3 shows how pages should end. There, a list of &lt;Article&gt; 
elements extends from the bottom of page 3 to the top of page 4

I did get a lead on &quot;blind tables&quot; with my Google search and am attempting 
to see if that will work for me. The &quot;keep-&quot; properties seems more in line 
with my needs than the &quot;break-&quot; properties, but I am not sure.
Mark 



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305676.html</link>
</item><item>
<title>Re: [xsl] Widows and orphans in XSL-FO - 10/30/2009 11:52:00 PM</title>
<description><![CDATA[<pre>At 2009-10-30 15:33 -0700, Mark Wilson wrote:
&gt;I looked at that function and am not sure if it would be useful or 
&gt;not. However, a Google search on it did lead me to within-page. The 
&gt;article warned that FOP (which I am using) did not support this, but 
&gt;found me a free download of XEP.
&gt;When I tried to run my stylesheet, XEP failed on the current-time() 
&gt;function from XSLT. I could get along without that, but then it 
&gt;failed on the base-uri(/) function,

You are not obliged to use the XSLT processor in XEP ... just use any 
XSLT 2.0 processor (I have great success with Saxon) to produce your 
XSL-FO from your XML, and then pass the raw XSL-FO to XEP for formatting.

&gt;which is necessary, so that XEP seems dead unless there is a way to 
&gt;get XEP to recognize these functions. I'll look around for an XEP list.

http://xep.xattic.com/lists/xep-support/
mailto:xep-support-request@renderx.com?body=subscribe

&gt;Thanks again, even though my problem is still unresolved.

Your original post wasn't clear enough for me to understand, even 
with your bit at the bottom of the message.

&gt;&gt;On Fri, Oct 30 2009 18:19:34 +0000, mark@knihtisk.org wrote:
&gt;&gt;&gt;I am compiling a journal index. The output is generated via XSLT and
&gt;&gt;&gt;XSL-FO. I have been looking for a way to deal with widows and orphans
&gt;&gt;&gt;in XSL-FO, but all of the information I have found seems to be focused
&gt;&gt;&gt;on breaks *within* an &lt;fo:block&gt;rather than *between*
&gt;&gt;&gt;different&lt;fo:block&gt;s. My problem is that I only want to end a page if
&gt;&gt;&gt;the processor has started rendering (or has completed rendering), a
&gt;&gt;&gt;specific &lt;fo:block&gt;,

That to me sounds like a keep constraint, which correlates with your 
own discovery of the &quot;within-page&quot;:

   keep.together.within-column=&quot;always&quot;

... is what I tell my XSL-FO students to use.  If you have only one 
column then you get the page behaviour you need, and if you have more 
than one column then you don't get a column break in the middle.

Note that you should not do:

   keep.together=&quot;always&quot;

... because that sets the property at the line level as well.

I hope this helps.

. . . . . . . . . . Ken

p.s. for readers: one seat remains open for Monday's XSLT/XQuery 
class in DC ... more room available for the XSL-FO class starting on the 9th:

   http://www.CraneSoftwrights.com/index.html#Crane200910IAD



--
Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
Interested in other classes?  http://www.CraneSoftwrights.com/f/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/f/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/f/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305672.html</link>
</item><item>
<title>Re: [xsl] Widows and orphans in XSL-FO - 10/30/2009 10:33:00 PM</title>
<description><![CDATA[<pre>Hi Tony,
I looked at that function and am not sure if it would be useful or not. 
However, a Google search on it did lead me to within-page. The article 
warned that FOP (which I am using) did not support this, but found me a free 
download of XEP.
When I tried to run my stylesheet, XEP failed on the current-time() function 
from XSLT. I could get along without that, but then it failed on the 
base-uri(/) function, which is necessary, so that XEP seems dead unless 
there is a way to get XEP to recognize these functions. I'll look around for 
an XEP list.

Thanks again, even though my problem is still unresolved.
Mark

--------------------------------------------------
From: &quot;Tony Graham&quot; &lt;Tony.Graham@MenteithConsulting.com&gt;
Sent: Friday, October 30, 2009 12:38 PM
To: &lt;xsl-list@lists.mulberrytech.com&gt;
Subject: Re: [xsl] Widows and orphans in XSL-FO

&gt; On Fri, Oct 30 2009 18:19:34 +0000, mark@knihtisk.org wrote:
&gt;&gt; I am compiling a journal index. The output is generated via XSLT and
&gt;&gt; XSL-FO. I have been looking for a way to deal with widows and orphans
&gt;&gt; in XSL-FO, but all of the information I have found seems to be focused
&gt;&gt; on breaks *within* an &lt;fo:block&gt;rather than *between*
&gt;&gt; different&lt;fo:block&gt;s. My problem is that I only want to end a page if
&gt;&gt; the processor has started rendering (or has completed rendering), a
&gt;&gt; specific &lt;fo:block&gt;, one containing the content from an &lt;Article&gt;
&gt;&gt; element.  Is there a mechanism for forcing a page to end with, or
&gt;&gt; within, a specific &lt;fo:block&gt;type?
&gt;
&gt; Have you looked at break-after [1], specifically, break-after=&quot;page&quot;?
&gt;
&gt; Regards,
&gt;
&gt;
&gt; Tony Graham                         Tony.Graham@MenteithConsulting.com
&gt; Director                                  W3C XSL FO SG Invited Expert
&gt; Menteith Consulting Ltd                               XML Guild member
&gt; XML, XSL and XSLT consulting, programming and training
&gt; Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
&gt; Registered in Ireland - No. 428599   http://www.menteithconsulting.com
&gt;  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
&gt; xmlroff XSL Formatter                               http://xmlroff.org
&gt; xslide Emacs mode                  http://www.menteith.com/wiki/xslide
&gt; Unicode: A Primer                               urn:isbn:0-7645-4625-2
&gt;
&gt; [1] http://www.w3.org/TR/xsl11/#break-after
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;
&gt; 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305669.html</link>
</item><item>
<title>[xsl] Widows and orphans in XSL-FO - 10/30/2009 6:20:00 PM</title>
<description><![CDATA[<pre>Hello all,
I am compiling a journal index. The output is generated via XSLT and XSL-FO. 
I have been looking for a way to deal with widows and orphans in XSL-FO, but 
all of the information I have found seems to be focused on breaks *within* 
an &lt;fo:block&gt;rather than *between* different&lt;fo:block&gt;s. My problem is that 
I only want to end a page if the processor has started rendering (or has 
completed rendering), a specific &lt;fo:block&gt;, one containing the content from 
an &lt;Article&gt; element.  Is there a mechanism for forcing a page to end with, 
or within, a specific &lt;fo:block&gt;type?

The index itself may be seen at 
http://www.knihtisk.org/library/specialist/index.htm.

Thanks,
Mark

Pictures explain better than words. As you might imagine, the actual XSL-FO 
style sheet is quite complex. Thus, rather than supplying the style sheet 
itself, the seven possible problem configurations are shown below. Each of 
the five elements is rendered in its own &lt;fo:block&gt;:

&lt;Heading&gt; page 1
&lt;Article&gt; page 2

&lt;Heading&gt; page 1
&lt;SubDiv1&gt; page 2

&lt;Heading&gt; page 1
&lt;SubDiv1&gt; page 1
&lt;Article&gt;    page 2

&lt;Heading&gt; page 1
&lt;SubDiv1&gt; page 1
&lt;SubDiv2&gt; page 2

&lt;Heading&gt; page 1
&lt;SubDiv1&gt; page 1
&lt;SubDiv2&gt; page 1
&lt;Article&gt;    page 2

&lt;Heading&gt; page 1
&lt;SubDiv1&gt; page 1
&lt;SubDiv2&gt; page 1
&lt;SubDiv3&gt; Page 2

&lt;Heading&gt; page 1
&lt;SubDiv1&gt; page 1
&lt;SubDiv2&gt; page 1
&lt;SubDiv3&gt; page 1
&lt;Article&gt;    page 2



 



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305660.html</link>
</item><item>
<title>Re: [xsl] axis specifier issue - 10/30/2009 5:21:00 PM</title>
<description><![CDATA[<pre>a kusa wrote:
&gt; What I want is that any &lt;note&gt; element that is below &lt;desc&gt; and before&lt;prt2&gt;
&gt; to be pushed under &lt;prt2&gt;.

With XSLT 2.0 you can achieve that as follows:

&lt;xsl:stylesheet
   xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
   version=&quot;2.0&quot;&gt;

   &lt;xsl:template match=&quot;@* | node()&quot;&gt;
     &lt;xsl:copy&gt;
       &lt;xsl:apply-templates select=&quot;@*, node()&quot;/&gt;
     &lt;/xsl:copy&gt;
   &lt;/xsl:template&gt;

   &lt;xsl:template match=&quot;prt1&quot;&gt;
     &lt;xsl:copy&gt;
       &lt;xsl:apply-templates select=&quot;@*, node() except note[. &amp;gt;&amp;gt; 
current()/desc[1] and . &amp;lt;&amp;lt; current()/prt2[1]]&quot;/&gt;
     &lt;/xsl:copy&gt;
   &lt;/xsl:template&gt;

   &lt;xsl:template match=&quot;prt2&quot;&gt;
     &lt;xsl:copy&gt;
       &lt;xsl:apply-templates select=&quot;@*, preceding-sibling::note[. 
&amp;gt;&amp;gt; current()/preceding-sibling::desc[1]], node()&quot;/&gt;
     &lt;/xsl:copy&gt;
   &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;

-- 

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305654.html</link>
</item><item>
<title>Re: [xsl] axis specifier issue - 10/30/2009 3:42:00 PM</title>
<description><![CDATA[<pre>What I want is that any &lt;note&gt; element that is below &lt;desc&gt; and before&lt;prt2&gt;
to be pushed under &lt;prt2&gt;.



On 10/29/09, David Carlisle &lt;davidc@nag.co.uk&gt; wrote:
&gt;
&gt; You are ot giving us many clues as to what criterion you are trying to
&gt; encode which decides which notes to move, but note the
&gt; preeeeceding-sibling axis selcts all preceding siblings, perhaps you
&gt; just want the closest, so that's
&gt;
&gt; preceding-sibling::*[1]
&gt; or, if you just want the closest sibling if it is a note,
&gt; preceding-sibling*[1][self::note]
&gt;
&gt; David
&gt;
&gt;
&gt;
&gt; ________________________________________________________________________
&gt; The Numerical Algorithms Group Ltd is a company registered in England
&gt; and Wales with company number 1249803. The registered office is:
&gt; Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
&gt;
&gt; This e-mail has been scanned for all viruses by Star. The service is
&gt; powered by MessageLabs.
&gt; ________________________________________________________________________
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305647.html</link>
</item><item>
<title>Re: [xsl] copy attributes, except some - 10/30/2009 1:41:00 PM</title>
<description><![CDATA[<pre>AC,

At 09:02 PM 10/29/2009, you wrote:
&gt;Hi Wendell,
&gt;
&gt;True. The thing that still bothers me with this is that since nodes 
&gt;and content are compared, a variable like $excepted-attributes has 
&gt;to be defined for every attribute group, for every tree/subtree that 
&gt;may get copied which is getting to be quite an overhead here.

Yes, certainly. My suggestion is clean only if the variable can be 
declared at the top -- that is, if @name1 attributes are always to be 
excluded. Even then, there are situations where it will be problematic.

This is the problem with posting fragments of problems to the list. 
As we have noted before (in this thread and elsewhere), without a 
complete problem spec, we can't really provide a solution. For 
example, a parameterized approach, in which $exclude-attributes would 
be passed through templates (using a tunnel parameter) and modified 
where necessary, might be another thing worth trying.

On the other hand, sometimes our waving flashlights in the dark will 
lead to an accidental insight which is at least as good, or better, 
than a solution. If that's the case here, we should call it a success.

Cheers,
Wendell



======================================================================
Wendell Piez                            mailto:wapiez@mulberrytech.com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
   Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305642.html</link>
</item><item>
<title>[xsl] [ANN] XML Prague 2010 Call for Participation (CFP) - 10/30/2009 12:45:00 PM</title>
<description><![CDATA[<pre>XML Prague 2010 Call for Papers

XML Prague 2010 is now welcoming submissions for presentations on the
following topics:

&#160; &#160;* XML lifecycle (diffing, merging, change tracking, etc.)
&#160; &#160;* Efficiency and performance in XML (verbosity, processing, overuse)
&#160; &#160;* Hypermedia in XML (SMIL, SVG animations)
&#160; &#160;* Spatial data and XML (WGS84, microformats)
&#160; &#160;* XML all the time (XRX, XQuery web applications)

All proposals will be submitted for review by a peer review panel made
up of the XML Prague Organizing Committee. Submissions will be chosen
based on interest, applicability, technical merit, and technical
correctness.

Accepted Papers will be included inside the published conference proceedings.

Authors should strive to contain original material and belong in the
topics previously listed. Submissions which can be construed as
product or service descriptions (adverts) will probably be deemed
inappropriate. Other approaches such as using case studies are welcome
but must be clearly related to conference topics.

Selected presenters must submit an full paper (on time) and give their
presentation and answer questions in English, as well as follow the
XML Prague 2010 conference guidelines.
Important Dates:

&#160; &#160;* December 21st - End of CFP (extended abstract or full paper)
&#160; &#160;* January 6th - Notification of acceptance/rejection of paper to authors
&#160; &#160;* January 22nd - Final paper

How to Submit:

All submissions must be done using the conference management system
available at

https://cmt.research.microsoft.com/XML2010/

If you have never used this system before for other conferences, you
will have to sign-up first and create new account for yourself.

After logging onto conference management system you will be able to
submit your paper and edit this submission before deadline. You can
also review the status of your paper as well as review comments from
review process.

You may submit an abstract or a full paper. We recommend to provide as
much information as possible to give the reviewers the best chance to
judge your submission.
Submission Guidelines:

All submissions must be in English and paper should not exceed 15
pages in length. Papers for review can be submitted in any common
format. However, we remind people that if your paper is accepted that
we will be asking for the final version to be submitted in DocBook XML
format.

If you have any question regarding submission process please contact
Jirka Kosek at jirka.kosek@xmlprague.cz.

on behalf,
XML Prague Committee

-------------------------
Jim Fuller
http://www.xmlprague.cz



-- 
cheers, Jim

-------------------------
XML Prague
http://www.xmlprague.cz

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305639.html</link>
</item><item>
<title>[xsl] [ANN] XML Prague 2010 and registration is now open - 10/30/2009 10:43:00 AM</title>
<description><![CDATA[<pre>[ANN] XML Prague 2010, March 13th &amp; 14th ' Temporal XML'

XML Prague is a conference on XML for developers, markup geeks,
information managers,
and students, in its 5th year. To obtain more information or register
please visit the website

http://www.xmlprague.cz

----------------------------------------
Important Dates
----------------------------------------

* Oct 2009 - Topics Announced, Registration Opens

* Oct 2009 - Call for Papers

* March 13th &amp; 14th 2010 - XML Prague Conference

A separate email will go out today with CFP details.

----------------------------------------
Topics
----------------------------------------

XML Prague 2010 will focus on core and emerging XML technologies with
this year's
special focus given on temporal aspects of XML.

&#194;&#160; &#194;&#160;* XML Lifecycle (diffing, merging, change tracking, etc.)

&#194;&#160; &#194;&#160;* Efficiency and performance in XML (verbosity, processing, overuse)

&#194;&#160; &#194;&#160;* Hypermedia in XML (SMIL, SVG animations)

&#194;&#160; &#194;&#160;* Spatial data and XML (WGS84, microformats)

&#194;&#160; &#194;&#160;* XML all the time (XRX, XQuery web applications)

Special panel discussion: Editing XML (open to sponsors)

If you have any questions please email us at info@xmlprague.cz.

----------------------------------------
Pricing
----------------------------------------

* Conference Pass (25 EUR, 30 EUR on site):*
- Access to all XML Prague 2009 conference sessions (13 - 14 March).
- Coffee and light refreshments during coffee-breaks (4 times).
- A copy of conference proceedings.

* Full Pass (60 EUR):*
- All included in the Conference package,
- plus two lunches (13 - 14 March) and the social dinner (13 March).

*Social Dinner (20 EUR)*
- the social dinner (13 March) for accompanying person.

----------------------------------------
Location
----------------------------------------

The conference is held in Prague, Czech Republic.

&#194;&#160;Lesser Town Campus of Charles University
&#194;&#160;Malostransk&#195;&#169; n&#195;&#161;m&#196;›st&#195;&#173; 25, Prague, Czech Republic


----------------------------------------
How to Participate
----------------------------------------

If you are planning to attend the conference and would be
interested in participating, please review the available options.

&#194;&#160;* Poster: Submit a 'poster' submission which if we have time may
also mean giving a 5 minute Lightening Talk.

&#194;&#160;* Workshops: As we have limited resources please contact
us early to discuss the possibility of holding a workshop.

Submit your ideas to ideas@xmlprague.cz

----------------------------------------
XML Prague 2009 Organizing Committee
----------------------------------------

Petr Cimprich, Unity Mobile
Tom&#195;&#161;&#197;&#161; Kaiser, University of West Bohemia, Pilsen
Jaroslav Ne&#197;&#161;et&#197;™il, Charles University, Prague
James Fuller, http://www.webcomposite.com
Jirka Kosek, xmlguru.cz &amp; University of Economics, Prague
Mohamed Zergaoui, Innovimax
Pavel Kroh, Independent Consultant
Martin &#197;&#189;&#195;&#161;k
Vit Janota

----------------------------------------

Hope to see everyone there.

XML Prague Committee

-------------------------
Jim Fuller
XML Prague 2010
http://www.xmlprague.cz

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305633.html</link>
</item><item>
<title>RE: [xsl] Lookup kind of Functionality with XSL - 10/30/2009 9:40:00 AM</title>
<description><![CDATA[<pre>&gt; 
&gt; I have a requirement like this.
&gt; 
&gt; &lt;employee hireDate=&quot;09/01/1998&quot;&gt;
&gt;     &lt;COLUMN NAME=&quot;LAST&quot;&gt;Herbert three&lt;/COLUMN&gt;
&gt;     &lt;COLUMN NAME=&quot;FIRST&quot;&gt;Johnny&lt;/COLUMN&gt;
&gt;     &lt;COLUMN NAME=&quot;ANL_RATE&quot;&gt;&lt;![CDATA[26525.8500]]&gt;&lt;/COLUMN&gt;
&gt;     &lt;COLUMN NAME=&quot;STATUS&quot;&gt;&lt;![CDATA[A]]&gt;&lt;/COLUMN&gt;
&gt;   &lt;/employee&gt;
&gt; 
&gt; another piece of XML is
&gt; &lt;DESC_TABLE&gt;
&gt; &lt;COLUMN NAME=&quot;STATUS&quot;&gt;&lt;![CDATA[A]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;DESCR&quot;&gt;&lt;![CDATA[Active]]&gt;&lt;/COLUMN&gt;
&gt; &lt;/ROW&gt;
&gt; &lt;/DESC_TABLE&gt;
&gt; 
&gt; 
&gt; while reading STATUS (status A), I need to look up the 
&gt; corresponding Description ('Active').

Assuming that the &lt;employee&gt; element is bound to variable $emp, and the
&lt;DESC_TABLE&gt; element to variable $table, and that there is a &lt;ROW&gt; start tag
carelessly omitted from the sample XML, you want

$table/ROW[COLUMN[@name='DESCR'][.=$emp/COLUMN[@name='STATUS']]/COLUMN[@NAME
='DESCR']

As I suggested in a response to a previous post, this would all become a lot
easier if you first transform this verbose representation of your data into
something cleaner, like

&lt;statusCodes&gt;
  &lt;status code=&quot;A&quot; description=&quot;Active&quot;/&gt;
  ...
&lt;/statusCodes&gt;

so the logic would become

$statusCodes/status[@code=$emp/status]/@description

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305628.html</link>
</item><item>
<title>Re: [xsl] Lookup kind of Functionality with XSL - 10/30/2009 8:57:00 AM</title>
<description><![CDATA[<pre>you can use the XSLT 'document' function to achieve this (ref,
http://www.w3.org/TR/xslt#document).

On Fri, Oct 30, 2009 at 2:20 PM, Anil Kumar Veeramalli
&lt;anil.v@frescoinformatics.com&gt; wrote:
&gt; Hi,
&gt;
&gt; I have a requirement like this.
&gt;
&gt; &lt;employee hireDate=&quot;09/01/1998&quot;&gt;
&gt; &#194;&#160; &lt;COLUMN NAME=&quot;LAST&quot;&gt;Herbert three&lt;/COLUMN&gt;
&gt; &#194;&#160; &lt;COLUMN NAME=&quot;FIRST&quot;&gt;Johnny&lt;/COLUMN&gt;
&gt; &#194;&#160; &lt;COLUMN NAME=&quot;ANL_RATE&quot;&gt;&lt;![CDATA[26525.8500]]&gt;&lt;/COLUMN&gt;
&gt; &#194;&#160; &lt;COLUMN NAME=&quot;STATUS&quot;&gt;&lt;![CDATA[A]]&gt;&lt;/COLUMN&gt;
&gt; &#194;&#160;&lt;/employee&gt;
&gt;
&gt; another piece of XML is
&gt; &lt;DESC_TABLE&gt;
&gt; &lt;COLUMN NAME=&quot;STATUS&quot;&gt;&lt;![CDATA[A]]&gt;&lt;/COLUMN&gt;
&gt; &lt;COLUMN NAME=&quot;DESCR&quot;&gt;&lt;![CDATA[Active]]&gt;&lt;/COLUMN&gt;
&gt; &lt;/ROW&gt;
&gt; &lt;/DESC_TABLE&gt;
&gt;
&gt;
&gt; while reading STATUS (status A), I need to look up the corresponding
&gt; Description ('Active').
&gt;
&gt; I will have to use only XSL 1.0 version, javascript and XALAN (if required)
&gt;
&gt; how can I achieve this in XSL.
&gt;
&gt; Thanks,
&gt; Anil



-- 
Regards,
Mukul Gandhi

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305625.html</link>
</item><item>
<title>[xsl] Lookup kind of Functionality with XSL - 10/30/2009 8:51:00 AM</title>
<description><![CDATA[<pre>Hi,

I have a requirement like this.

&lt;employee hireDate=&quot;09/01/1998&quot;&gt;
    &lt;COLUMN NAME=&quot;LAST&quot;&gt;Herbert three&lt;/COLUMN&gt;
    &lt;COLUMN NAME=&quot;FIRST&quot;&gt;Johnny&lt;/COLUMN&gt;
    &lt;COLUMN NAME=&quot;ANL_RATE&quot;&gt;&lt;![CDATA[26525.8500]]&gt;&lt;/COLUMN&gt;
    &lt;COLUMN NAME=&quot;STATUS&quot;&gt;&lt;![CDATA[A]]&gt;&lt;/COLUMN&gt;
  &lt;/employee&gt;

another piece of XML is
&lt;DESC_TABLE&gt;
&lt;COLUMN NAME=&quot;STATUS&quot;&gt;&lt;![CDATA[A]]&gt;&lt;/COLUMN&gt;
&lt;COLUMN NAME=&quot;DESCR&quot;&gt;&lt;![CDATA[Active]]&gt;&lt;/COLUMN&gt;
&lt;/ROW&gt;
&lt;/DESC_TABLE&gt;


while reading STATUS (status A), I need to look up the corresponding 
Description ('Active').

I will have to use only XSL 1.0 version, javascript and XALAN (if required)

how can I achieve this in XSL.

Thanks,
Anil



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305624.html</link>
</item><item>
<title>Re: [xsl] copy attributes, except some - 10/30/2009 1:03:00 AM</title>
<description><![CDATA[<pre>Hi Wendell,

True. The thing that still bothers me with this is that since nodes and 
content are compared, a variable like $excepted-attributes has to be 
defined for every attribute group, for every tree/subtree that may get 
copied which is getting to be quite an overhead here.  The situation is 
more or less the same for the attribute() approach. Comparing attribute 
names is really what I require but is trickier in a namespace safe way.

Consequently, by first declaring a variable with a &quot;dummy&quot; set of 
attributes to exclude, like
    &lt;xsl:variable name=&quot;dummy-attributes&quot;&gt;&lt;xx name1=&quot;&quot; name2=&quot;&quot; name3=&quot;&quot; 
name4=&quot;&quot;/&gt;&lt;/xsl:variable&gt;
I can now declare:
    &lt;xsl:variable name=&quot;excepted-attributes&quot; 
select=&quot;$dummy-attributes//@*/node-name(.)&quot;/&gt;
and later use:
    &lt;xsl:copy-of select=&quot;@*[not(node-name(.) = $excepted-attributes)]&quot;/&gt;
on as many trees as I need, bringing the variable overhead down to two 
per excepted attribute set, independently of the number of tree/subtree 
that need copying, which is a lot in this case.

Also note that the example here copies attributes from the context node 
which implies, especially with many trees/subtrees and many excluded 
attributes that you would want to use a lot of &lt;xsl:for-each 
select=&quot;$this-tree-or-subtree&quot;&gt; elements to set those context nodes.  
With an attribute name-based approach one can also spare most of these 
context setting instructions, just simply using the tree variable 
reference once, per tree. Again, it seems, quite a saving in a setting 
with many trees/subtrees.

The solution still does not seem perfectly elegant, especially as it is 
a little twisted, but it seems like the best possible, and it works.

Mind you, in a context where elements can have dynamic attribute sets 
from a wide potential range, from multiple namespaces, which I think 
should be casual with XML, it may be interesting to consider how this 
could be made more elegant.

It works for now and I thank you, and everyone who contributed, for the 
insight.

Cheers,
ac


&gt; ac,
&gt;
&gt; At 02:37 AM 10/29/2009, you wrote:
&gt;&gt; Hi,
&gt;&gt;
&gt;&gt; Sorry for noise again, but David did provide a possibly better option 
&gt;&gt; as in:
&gt;&gt; &lt;xsl:copy-of select=&quot;@* except (attribute(name1), attribute(name2), 
&gt;&gt; attribute(name3), attribute(name4))&quot;/&gt;
&gt;
&gt; Also (syntax errors aside), if you wanted to drive this from the top:
&gt;
&gt; &lt;xsl:variable name=&quot;excepted-attributes&quot; select=&quot;//@name1 | //@name2 | 
&gt; //@name3&quot;/&gt;
&gt;
&gt; ... and then ...
&gt;
&gt; &lt;xsl:copy-of select=&quot;@* except $excepted-attributes&quot;/&gt;
&gt;
&gt; Cheers,
&gt; Wendell
&gt;
&gt;
&gt; ======================================================================
&gt; Wendell Piez                            mailto:wapiez@mulberrytech.com
&gt; Mulberry Technologies, Inc.                http://www.mulberrytech.com
&gt; 17 West Jefferson Street                    Direct Phone: 301/315-9635
&gt; Suite 207                                          Phone: 301/315-9631
&gt; Rockville, MD  20850                                 Fax: 301/315-8285
&gt; ----------------------------------------------------------------------
&gt;   Mulberry Technologies: A Consultancy Specializing in SGML and XML
&gt; ======================================================================
&gt;
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305607.html</link>
</item><item>
<title>Re: [xsl] axis specifier issue - 10/29/2009 11:30:00 PM</title>
<description><![CDATA[<pre>You are ot giving us many clues as to what criterion you are trying to
encode which decides which notes to move, but note the
preeeeceding-sibling axis selcts all preceding siblings, perhaps you
just want the closest, so that's

preceding-sibling::*[1]
or, if you just want the closest sibling if it is a note,
preceding-sibling*[1][self::note]

David



________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305600.html</link>
</item><item>
<title>[xsl] axis specifier issue - 10/29/2009 10:31:00 PM</title>
<description><![CDATA[<pre>Hi:

I have an input file like this:

&lt;prt1&gt;
&lt;note&gt;this is a sample note&lt;/note&gt;
&lt;desc&gt;sample desc&lt;/desc&gt;
&lt;note&gt;note at the end of desc &lt;/note&gt;
      &lt;prt2&gt;
           &lt;text&gt;sample text&lt;/text&gt;
      &lt;/prt2&gt;
&lt;/prt1&gt;

Now I want to transform this so that the &lt;note&gt; &lt;note&gt;note at the end
of desc &lt;/note&gt; comes right under &lt;prt2&gt;.

So:

&lt;prt1&gt;
&lt;note&gt;this is a sample note&lt;/note&gt;
&lt;desc&gt;sample desc&lt;/desc&gt;
      &lt;prt2&gt;
&lt;note&gt;note at the end of desc &lt;/note&gt;
           &lt;text&gt;sample text&lt;/text&gt;
      &lt;/prt2&gt;
&lt;/prt1&gt;

But when I use preceding-sibling, it pulls &lt;note&gt;this is a sample note&lt;/note&gt;
into &lt;prt2&gt; as well.

Can anybody help me here?

Thanks in advance.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305595.html</link>
</item><item>
<title>Re: [xsl] reading a text file and putting out an xml file using xslt - 10/29/2009 10:27:00 PM</title>
<description><![CDATA[<pre>Thanks! I will take a look at the documentation again.

On 10/29/09, David Carlisle &lt;davidc@nag.co.uk&gt; wrote:
&gt;
&gt; &gt; Can you please tell me what I am doing wrong here?
&gt;
&gt; &gt; &gt; a directory with all the xml files and images.
&gt;
&gt; I think you'll find saxon's directory input feature applies teh
&gt; stylesheet to all the files in teh directory, so you'll get xml parse
&gt; errors on the images.
&gt;
&gt; Instead of doing that you can use the collection() function and just select the xml
&gt; files with  a URL ending with directory-name/?select=*.xml
&gt; see the saxon documentation.
&gt;
&gt; David
&gt;
&gt;
&gt; ________________________________________________________________________
&gt; The Numerical Algorithms Group Ltd is a company registered in England
&gt; and Wales with company number 1249803. The registered office is:
&gt; Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
&gt;
&gt; This e-mail has been scanned for all viruses by Star. The service is
&gt; powered by MessageLabs.
&gt; ________________________________________________________________________
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305594.html</link>
</item><item>
<title>Re: [xsl] copy attributes, except some - 10/29/2009 9:51:00 PM</title>
<description><![CDATA[<pre>ac,

At 02:37 AM 10/29/2009, you wrote:
&gt;Hi,
&gt;
&gt;Sorry for noise again, but David did provide a possibly better option as in:
&gt;&lt;xsl:copy-of select=&quot;@* except (attribute(name1), attribute(name2), 
&gt;attribute(name3), attribute(name4))&quot;/&gt;

Also (syntax errors aside), if you wanted to drive this from the top:

&lt;xsl:variable name=&quot;excepted-attributes&quot; select=&quot;//@name1 | //@name2 
| //@name3&quot;/&gt;

... and then ...

&lt;xsl:copy-of select=&quot;@* except $excepted-attributes&quot;/&gt;

Cheers,
Wendell


======================================================================
Wendell Piez                            mailto:wapiez@mulberrytech.com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
   Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305590.html</link>
</item><item>
<title>Re: Re: [xsl] Create word elements from a string - 10/29/2009 9:51:00 PM</title>
<description><![CDATA[<pre>Larry,

At 02:58 AM 10/29/2009, you wrote:
&gt;Thanks for the help. I was able to get something working in XSL 1.0
&gt;using what you all provided. Although I think it's time to switch to
&gt;2.0 with tokenize!
&gt;
&gt;I did run into a problem with:
&gt;
&gt;&lt;xsl:when test=&quot;contains($str, ' ')&quot;&gt;
&gt;
&gt;The test always returns true even when I only have one word in the
&gt;text. I don't particularly understand why, but when I change it to
&gt;this, everything works fine:
&gt;
&gt;&lt;xsl:when test=&quot;contains(normalize-space($str), ' ')&quot;&gt;
&gt;
&gt;Why does it return true when normalize-space is not there? I would
&gt;think with only one word, there wouldn't be any spaces.

Single words can, of course, be preceded or followed by spaces, and 
remain single words. Could this have been the case?

normalize-space() will strip leading and trailing whitespace, as well 
as collapsing runs of spaces within a string.

Cheers,
Wendell



======================================================================
Wendell Piez                            mailto:wapiez@mulberrytech.com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
   Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305591.html</link>
</item><item>
<title>[xsl] [ANN] Altova announces v2010 of the MissionKit tool suite - 10/29/2009 9:09:00 PM</title>
<description><![CDATA[<pre>Altova is pleased to announce general availability version 2010 of its
MissionKit XML, database, and UML tools. v2010 is our MOST WANTED
release and includes over 70 new customer-requested features. Just a few
of these include: 

* Support for WSDL 2.0, JSON, and SysML technologies
* New stylesheet design paradigm with advanced support for electronic
form design
* Enhanced XBRL functionality
* Database schema comparison
* And much more 

More info and screenshots are available at
&lt;http://www.altova.com/whatsnew.html&gt; 

Download a fully functional free trial at
&lt;http://www.altova.com/download.html&gt; 

Best regards,
Liz

Liz Andrews
Technical Marketing Manager
Altova, Inc.
www.altova.com


This e-mail and any attachments are intended only for the person/entity
to which they are addressed and may contain confidential and/or
privileged material. If you received this in error, please notify the
sender and delete the message.



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305589.html</link>
</item><item>
<title>Re: [xsl] reading a text file and putting out an xml file using xslt - 10/29/2009 5:37:00 PM</title>
<description><![CDATA[<pre>&gt; Can you please tell me what I am doing wrong here?

&gt; &gt; a directory with all the xml files and images.

I think you'll find saxon's directory input feature applies teh
stylesheet to all the files in teh directory, so you'll get xml parse
errors on the images.

Instead of doing that you can use the collection() function and just select the xml
files with  a URL ending with directory-name/?select=*.xml
see the saxon documentation.

David


________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305575.html</link>
</item><item>
<title>RE: [xsl] reading a text file and putting out an xml file using xslt - 10/29/2009 5:33:00 PM</title>
<description><![CDATA[<pre>&gt; 
&gt; Can someone please let me know if I am doing something wrong here?

This isn't an XSLT problem, it's an XML problem. Saxon is telling you quite
clearly that the error comes from the XML parser.

&gt; &gt; SXXP0003: Error reported by XML parser: Content is not allowed in
prolog.
&gt; &gt; While processing bk1-im1.tif: Run-time errors were reported

It looks as if the XML parser is trying to parse the content of bk1-im1.tif
as XML and failing. Perhaps that's because you have an entity reference
&amp;im1; somewhere in your source - that's not allowed with unparsed entities.
However, I can only speculate.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 
&gt; 
&gt; On Wed, Oct 28, 2009 at 2:23 PM, a kusa &lt;akusa8@gmail.com&gt; wrote:
&gt; &gt; Thank you. This worked.
&gt; &gt;
&gt; &gt; But I have anther problem. I am applying a transformation 
&gt; style sheets 
&gt; &gt; to another set of xml files to generate another xml output.
&gt; &gt; These files have images as entities in beginning:
&gt; &gt;
&gt; &gt; &lt;!DOCTYPE books[
&gt; &gt; &lt;!NOTATION ccitt4 PUBLIC '-//USA-DOD//NOTATION CCITT Group4 
&gt; &gt; Facsimile//EN' &gt; &lt;!ENTITY im1 SYSTEM &quot;bk1-im1.tif&quot; NDATA ccitt4&gt; 
&gt; &gt; &lt;!ENTITY im2 SYSTEM &quot;bk1-im2.tif&quot; NDATA ccitt4&gt; ]&gt;
&gt; &gt;


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305574.html</link>
</item><item>
<title>Re: [xsl] reading a text file and putting out an xml file using xslt - 10/29/2009 5:26:00 PM</title>
<description><![CDATA[<pre>Can someone please let me know if I am doing something wrong here?

On Wed, Oct 28, 2009 at 2:23 PM, a kusa &lt;akusa8@gmail.com&gt; wrote:
&gt; Thank you. This worked.
&gt;
&gt; But I have anther problem. I am applying a transformation style sheets
&gt; to another set of xml files to generate another xml output.
&gt; These files have images as entities in beginning:
&gt;
&gt; &lt;!DOCTYPE books[
&gt; &lt;!NOTATION ccitt4 PUBLIC '-//USA-DOD//NOTATION CCITT Group4 Facsimile//EN' &gt;
&gt; &lt;!ENTITY im1 SYSTEM &quot;bk1-im1.tif&quot; NDATA ccitt4&gt;
&gt; &lt;!ENTITY im2 SYSTEM &quot;bk1-im2.tif&quot; NDATA ccitt4&gt;
&gt; ]&gt;
&gt;
&gt; I am using saxon9 to run this in a batch mode. So my source points to
&gt; a directory with all the xml files and images.
&gt; java net.sf.saxon.Transform -s:c:\sampleset -xsl:test.xsl -o:c:\output
&gt;
&gt; But I get this error on running it in batch mode.
&gt;
&gt; SXXP0003: Error reported by XML parser: Content is not allowed in prolog.
&gt; While processing bk1-im1.tif: Run-time errors were reported
&gt;
&gt; Can you please tell me what I am doing wrong here?
&gt;
&gt;
&gt; On Wed, Oct 28, 2009 at 10:40 AM, Michael Kay &lt;mike@saxonica.com&gt; wrote:
&gt;&gt;
&gt;&gt;&gt; Thank you. I have saxon9 downloaded. But I am not sure how to
&gt;&gt;&gt; run a transformation on the command line for a text input.
&gt;&gt;&gt; Any help?
&gt;&gt;&gt;
&gt;&gt;
&gt;&gt; Typically
&gt;&gt;
&gt;&gt; java net.sf.saxon.Transform -xsl:stylesheet.xsl -it:main
&gt;&gt;
&gt;&gt; or you might want to supply the name of the unparsed text file as a
&gt;&gt; parameter:
&gt;&gt;
&gt;&gt; java net.sf.saxon.Transform -xsl:stylesheet.xsl -it:main input=text.xml
&gt;&gt;
&gt;&gt; with
&gt;&gt;
&gt;&gt; &lt;xsl:param name=&quot;input&quot;/&gt;
&gt;&gt;
&gt;&gt; and
&gt;&gt;
&gt;&gt; select=&quot;unparsed-text($input)&quot;
&gt;&gt;
&gt;&gt; Regards,
&gt;&gt;
&gt;&gt; Michael Kay
&gt;&gt; http://www.saxonica.com/
&gt;&gt; http://twitter.com/michaelhkay
&gt;&gt;
&gt;&gt;
&gt;&gt; --~------------------------------------------------------------------
&gt;&gt; XSL-List info and archive: &#160;http://www.mulberrytech.com/xsl/xsl-list
&gt;&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt;&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt;&gt; --~--
&gt;&gt;
&gt;&gt;
&gt;

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305573.html</link>
</item><item>
<title>RE: [xsl] nodes() before and after a string delimiter - 10/29/2009 11:30:00 AM</title>
<description><![CDATA[<pre>Martin,

Thanks for the quick reply and solution. This is definitely one for the toolbox.

Marijan (Mario) Madunic
Publishing Specialist
New Flyer Industries

-----Original Message-----
From: Martin Honnen [mailto:Martin.Honnen@gmx.de] 
Sent: Wednesday, October 28, 2009 2:53 PM
To: xsl-list@lists.mulberrytech.com
Subject: Re: [xsl] nodes() before and after a string delimiter

Mario Madunic wrote:
&gt; I have the following element (I'm using Saxon9 and XSLT2)
&gt; 
&gt; &lt;p&gt;Crazing &#226;€“ Hairline cracking of the resin, giving it an opaque, &lt;q&gt;frosty&lt;/q&gt; appearance.&lt;/p&gt;
&gt; 
&gt; I need to break it into two halves like the following based on the &#226;€“ (space en dash space) and only the first  &#226;€“ (space en dash space).
&gt; 
&gt; &lt;p&gt;
&gt;    &lt;term&gt;Crazing&lt;/term&gt;
&gt;    &lt;definition&gt;Hairline cracking of the resin, giving it an opaque, &lt;q&gt;frosty&lt;/q&gt; appearance.&lt;/definition&gt;
&gt; &lt;/p&gt;

This stylesheet

&lt;xsl:stylesheet
   xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
   version=&quot;2.0&quot;&gt;

   &lt;xsl:output indent=&quot;yes&quot;/&gt;

   &lt;xsl:template match=&quot;@* | node()&quot;&gt;
     &lt;xsl:copy&gt;
       &lt;xsl:apply-templates select=&quot;@* | node()&quot;/&gt;
     &lt;/xsl:copy&gt;
   &lt;/xsl:template&gt;

   &lt;xsl:template match=&quot;p&quot;&gt;
     &lt;xsl:copy&gt;
       &lt;xsl:variable name=&quot;this&quot; select=&quot;.&quot;/&gt;
       &lt;xsl:variable name=&quot;t&quot; select=&quot;text()[1]&quot;/&gt;
       &lt;xsl:analyze-string select=&quot;$t&quot; regex=&quot;(.*) &#226;€“ (.*)&quot;&gt;
         &lt;xsl:matching-substring&gt;
           &lt;term&gt;&lt;xsl:value-of select=&quot;regex-group(1)&quot;/&gt;&lt;/term&gt;
           &lt;definition&gt;
             &lt;xsl:value-of select=&quot;regex-group(2)&quot;/&gt;
             &lt;xsl:apply-templates select=&quot;$t/following-sibling::node()&quot;/&gt;
           &lt;/definition&gt;
         &lt;/xsl:matching-substring&gt;
         &lt;xsl:non-matching-substring&gt;
           &lt;xsl:apply-templates select=&quot;$this/node()&quot;/&gt;
         &lt;/xsl:non-matching-substring&gt;
       &lt;/xsl:analyze-string&gt;
     &lt;/xsl:copy&gt;
   &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;

does that but I have not tested against anything but your input sample.
-- 

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--


--------------------------------------------------------------------
Please consider the environment before printing this e-mail.

CONFIDENTIALITY STATEMENT: This communication (and  any and all information or material transmitted with this communication) is confidential, may be privileged and is intended only for the use of the intended recipient. If you are not the intended recipient, any review, retransmission, circulation, distribution, reproduction, conversion to hard copy, copying or other use of this communication, information or material is strictly prohibited and may be illegal. If you received this communication in error or if it is forwarded to you without the express authorization of New Flyer, please notify us immediately by telephone or by return email and permanently delete the communication, information and material from any computer, disk drive, diskette or other storage device or media. Thank you.


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305560.html</link>
</item><item>
<title>RE: [xsl] nodes() before and after a string delimiter - 10/29/2009 11:29:00 AM</title>
<description><![CDATA[<pre>Michael,

Thank you very much.

This is a simple and elegant solution. I did not know that I could use substring-before and after in such a way. Guess I was stuck on the 'string' part of the function name.

Once again thanks.

Marijan (Mario) Madunic
Publishing Specialist
New Flyer Industries

-----Original Message-----
From: Michael Kay [mailto:mike@saxonica.com] 
Sent: Wednesday, October 28, 2009 4:57 PM
To: xsl-list@lists.mulberrytech.com
Subject: RE: [xsl] nodes() before and after a string delimiter

First find the text node containing the dash:

&lt;xsl:variable name=&quot;textNode&quot; select=&quot;text()[contains(.,' - ')][1] &quot;/&gt;

Create a &lt;term&gt; element containing all nodes preceding this text node, plus
the part of the text node before the dash:

&lt;term&gt;
   &lt;xsl:copy-of select=&quot;$textNode/preceding-sibling::node()&quot;/&gt;
   &lt;xsl:value-of select=&quot;substring-before($textNode, ' - ')&quot;/&gt;
&lt;/term&gt;

Create a &lt;definition&gt; element containing everything that follows the dash:

&lt;definition&gt;
   &lt;xsl:value-of select=&quot;substring-after($textNode, ' - ')&quot;/&gt; 
   &lt;xsl:copy-of select=&quot;$textNode/following-sibling::node()&quot;/&gt;
&lt;/definition&gt;

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay  

&gt; -----Original Message-----
&gt; From: Mario Madunic [mailto:Mario_Madunic@newflyer.com] 
&gt; Sent: 28 October 2009 19:25
&gt; To: xsl-list@lists.mulberrytech.com
&gt; Subject: [xsl] nodes() before and after a string delimiter
&gt; 
&gt; I have the following element (I'm using Saxon9 and XSLT2)
&gt; 
&gt; &lt;p&gt;Crazing - Hairline cracking of the resin, giving it an 
&gt; opaque, &lt;q&gt;frosty&lt;/q&gt; appearance.&lt;/p&gt;
&gt; 
&gt; I need to break it into two halves like the following based 
&gt; on the - (space en dash space) and only the first  - (space 
&gt; en dash space).
&gt; 
&gt; &lt;p&gt;
&gt;    &lt;term&gt;Crazing&lt;/term&gt;
&gt;    &lt;definition&gt;Hairline cracking of the resin, giving it an 
&gt; opaque, &lt;q&gt;frosty&lt;/q&gt; appearance.&lt;/definition&gt; &lt;/p&gt;
&gt; 
&gt; I'm used to breaking strings on delimiters and not worrying 
&gt; about any inline elements, but his time the inline elements matter. 
&gt; Is this a for-each-group solution? Break it into two 
&gt; for-each-groups and in the first test for a 
&gt; following-sibling[. = '-'] and the second test for the 
&gt; following-sibling[. = '-']. 
&gt; 
&gt; No need to apply templates at this point a copy-of will suffice.
&gt; 
&gt; Any insight would be appreciated.
&gt; 
&gt; Thanks
&gt; 
&gt; Marijan (Mario) Madunic
&gt; Publishing Specialist
&gt; New Flyer Industries
&gt; 
&gt; --------------------------------------------------------------------
&gt; Please consider the environment before printing this e-mail.
&gt; 
&gt; CONFIDENTIALITY STATEMENT: This communication (and  any and 
&gt; all information or material transmitted with this 
&gt; communication) is confidential, may be privileged and is 
&gt; intended only for the use of the intended recipient. If you 
&gt; are not the intended recipient, any review, retransmission, 
&gt; circulation, distribution, reproduction, conversion to hard 
&gt; copy, copying or other use of this communication, information 
&gt; or material is strictly prohibited and may be illegal. If you 
&gt; received this communication in error or if it is forwarded to 
&gt; you without the express authorization of New Flyer, please 
&gt; notify us immediately by telephone or by return email and 
&gt; permanently delete the communication, information and 
&gt; material from any computer, disk drive, diskette or other 
&gt; storage device or media. Thank you.
&gt; 
&gt; 
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt; 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--


--------------------------------------------------------------------
Please consider the environment before printing this e-mail.

CONFIDENTIALITY STATEMENT: This communication (and  any and all information or material transmitted with this communication) is confidential, may be privileged and is intended only for the use of the intended recipient. If you are not the intended recipient, any review, retransmission, circulation, distribution, reproduction, conversion to hard copy, copying or other use of this communication, information or material is strictly prohibited and may be illegal. If you received this communication in error or if it is forwarded to you without the express authorization of New Flyer, please notify us immediately by telephone or by return email and permanently delete the communication, information and material from any computer, disk drive, diskette or other storage device or media. Thank you.


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305559.html</link>
</item><item>
<title>[xsl] convert String to date format and sort - 10/29/2009 9:42:00 AM</title>
<description><![CDATA[<pre>Hi,

1) my current date format is 28-Oct-1987(dd-mmm-yyyy), want to convert it yyyy-mm-dd format.
2) sort the dates

XML code:
&lt;Employee 
startdate=&quot;11/20/1999&quot;&gt;
&lt;name&gt;John&lt;/name&gt;
&lt;/Employee&gt;
&lt;Employee 
startdate=&quot;07/06/2001&quot;&gt;
&lt;name&gt;John&lt;/name&gt;
&lt;/Employee&gt;
&lt;Employee 
startdate=&quot;04/23/1999&quot;&gt;
&lt;name&gt;John&lt;/name&gt;
&lt;/Employee&gt;

xslt 
code to sort by date:
&lt;xsl:template 
match=&quot;Employee&quot;&gt;
&lt;xsl:apply-templates&gt;
&lt;xsl:sort 
select=&quot;substring(@startdate,7,4)&quot;/&gt; &lt;!-- year sort --&gt;
&lt;xsl:sort 
select=&quot;substring(@startdate,1,2)&quot;/&gt; &lt;!-- day sort --&gt;
&lt;xsl:sort 
select=&quot;substring(@startdate,4,2)&quot;/&gt; &lt;!-- month sort 
--&gt;
&lt;/xsl:apply-templates&gt;
&lt;/xsl:apply-templates&gt;


sorting this way is good approach or do we have any better approach.



Thanks,
Anil



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305554.html</link>
</item><item>
<title>RE: [xsl] attribute based sorting - 10/29/2009 9:16:00 AM</title>
<description><![CDATA[<pre>&gt; 
&gt;  
&gt; &lt;COLUMN NAME=&quot;Join_date&quot;&gt;28-Oct-1987&lt;/COLUMN&gt;
&gt; 
&gt; date format will be in DD-MMM-DDDD, what is the good approach 
&gt; to sort this kind of dates.
&gt; 

This seems to be a classic case where you should be using a pipeline
architecture: a series of transformations. First transform your data to
&quot;clean&quot; XML, that is, to

&lt;Join_date&gt;1987-10-27&lt;/Join_date&gt;

and then the real processing all becomes much easier. The advantage of
splitting the transformation into phases is that the &quot;clean-up&quot; phase is
reusable, and independent of the subsequent processing you want to perform.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305553.html</link>
</item><item>
<title>Re: Re: [xsl] Create word elements from a string - 10/29/2009 8:45:00 AM</title>
<description><![CDATA[<pre>On Thu, Oct 29, 2009 at 12:28 PM, Larry Hayashi &lt;lhtrees@gmail.com&gt; wrote:
&gt; I did run into a problem with:
&gt;
&gt; &lt;xsl:when test=&quot;contains($str, ' ')&quot;&gt;
&gt;
&gt; The test always returns true even when I only have one word in the
&gt; text. I don't particularly understand why, but when I change it to
&gt; this, everything works fine:
&gt;
&gt; &lt;xsl:when test=&quot;contains(normalize-space($str), ' ')&quot;&gt;

Did you run this modified syntax, with the same input you specified
earlier (i.e, &lt;text&gt;Jill ran up the hill.&lt;/text&gt;)?
If your input was this (i.e, text node within &lt;text&gt; as mentioned
above), then I think normalize-space is not needed.

&gt; Why does it return true when normalize-space is not there? I would
&gt; think with only one word, there wouldn't be any spaces.

If you can post the input with which, you ran your stylesheet it would
be helpful to find an answer to your question. It would also be
helpful, if you mention the XSLT engine you are using.



-- 
Regards,
Mukul Gandhi

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305550.html</link>
</item><item>
<title>Re: [xsl] Is a XSLT 2 to 1 transform possible? - 10/29/2009 8:40:00 AM</title>
<description><![CDATA[<pre>Ok, thanks :)

2009/10/29 Michael Kay &lt;mike@saxonica.com&gt;:
&gt;&gt; Out of curiosity, could a XSLT 1.0 stylesheet be used to
&gt;&gt; convert a XSLT 2.0 stylesheet to an equivalent XSLT 1.0 stylesheet?
&gt;&gt;
&gt;
&gt; XSLT 1.0 is Turing-complete so the theoretical answer is yes. (With a
&gt; proviso that you would need to call out to extensions to handle a few things
&gt; like unparsed-text() and xsl:result-document).
&gt;
&gt; The practical answer, given the number of man-years that I imagine are
&gt; available to you, is no. Can you imagine what a regular expression engine
&gt; would look like written in XSLT 1.0 code?
&gt;
&gt; Regards,
&gt;
&gt; Michael Kay
&gt; http://www.saxonica.com/
&gt; http://twitter.com/michaelhkay
&gt;
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive: &#160;http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305549.html</link>
</item><item>
<title>Re: [xsl] attribute based sorting - 10/29/2009 8:38:00 AM</title>
<description><![CDATA[<pre>Thanks a lot  Michael. Its working as expected..
I have another question, its an extension to that.

 
&lt;COLUMN NAME=&quot;Join_date&quot;&gt;28-Oct-1987&lt;/COLUMN&gt;

date format will be in DD-MMM-DDDD, what is the good approach to sort this kind of dates.


Thanks,
Anil

Michael Kay wrote:
&gt; &lt;xsl:sort select=&quot;COLUMN[@NAME='SALARY']&quot; data-type=&quot;number&quot;/&gt;
&gt;
&gt; Regards,
&gt;
&gt; Michael Kay
&gt; http://www.saxonica.com/
&gt; http://twitter.com/michaelhkay  
&gt;
&gt;   
&gt;&gt; -----Original Message-----
&gt;&gt; From: Anil Kumar Veeramalli [mailto:anil.v@frescoinformatics.com] 
&gt;&gt; Sent: 29 October 2009 06:33
&gt;&gt; To: xsl-list@lists.mulberrytech.com
&gt;&gt; Subject: [xsl] attribute based sorting 
&gt;&gt;
&gt;&gt; Hi,
&gt;&gt;
&gt;&gt; I wanted to sort based on salary. please suggest me on 
&gt;&gt; this.can you give me some sample code.
&gt;&gt; my sample xml file look like this
&gt;&gt; &lt;employee&gt;
&gt;&gt;     &lt;COLUMN NAME=&quot;SALARY&quot;&gt;95000&lt;/COLUMN&gt;
&gt;&gt;   &lt;/employee&gt;
&gt;&gt; with multiple employees.
&gt;&gt;
&gt;&gt; I want to sort based on Salary attribute. instead of &lt;column 
&gt;&gt; name=&quot;salary&quot;&gt;95000&lt;/column&gt; this , &lt;salary&gt;1000&lt;/salary&gt; 
&gt;&gt; with this I am able to sort it out  like this &lt;xsl:sort 
&gt;&gt; select=&quot;salary&quot; *data-type=&quot;number&quot;*/&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; Please please help out on this.
&gt;&gt;
&gt;&gt; Thanks,
&gt;&gt; Anil
&gt;&gt;
&gt;&gt;
&gt;&gt; --~------------------------------------------------------------------
&gt;&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt;&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt;&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt;&gt; --~--
&gt;&gt;
&gt;&gt;     
&gt;
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;
&gt;   



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305548.html</link>
</item><item>
<title>RE: [xsl] Is a XSLT 2 to 1 transform possible? - 10/29/2009 8:36:00 AM</title>
<description><![CDATA[<pre>&gt; Out of curiosity, could a XSLT 1.0 stylesheet be used to 
&gt; convert a XSLT 2.0 stylesheet to an equivalent XSLT 1.0 stylesheet?
&gt; 

XSLT 1.0 is Turing-complete so the theoretical answer is yes. (With a
proviso that you would need to call out to extensions to handle a few things
like unparsed-text() and xsl:result-document).

The practical answer, given the number of man-years that I imagine are
available to you, is no. Can you imagine what a regular expression engine
would look like written in XSLT 1.0 code?

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305547.html</link>
</item><item>
<title>RE: [xsl] attribute based sorting - 10/29/2009 8:30:00 AM</title>
<description><![CDATA[<pre>&lt;xsl:sort select=&quot;COLUMN[@NAME='SALARY']&quot; data-type=&quot;number&quot;/&gt;

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay  

&gt; -----Original Message-----
&gt; From: Anil Kumar Veeramalli [mailto:anil.v@frescoinformatics.com] 
&gt; Sent: 29 October 2009 06:33
&gt; To: xsl-list@lists.mulberrytech.com
&gt; Subject: [xsl] attribute based sorting 
&gt; 
&gt; Hi,
&gt; 
&gt; I wanted to sort based on salary. please suggest me on 
&gt; this.can you give me some sample code.
&gt; my sample xml file look like this
&gt; &lt;employee&gt;
&gt;     &lt;COLUMN NAME=&quot;SALARY&quot;&gt;95000&lt;/COLUMN&gt;
&gt;   &lt;/employee&gt;
&gt; with multiple employees.
&gt; 
&gt; I want to sort based on Salary attribute. instead of &lt;column 
&gt; name=&quot;salary&quot;&gt;95000&lt;/column&gt; this , &lt;salary&gt;1000&lt;/salary&gt; 
&gt; with this I am able to sort it out  like this &lt;xsl:sort 
&gt; select=&quot;salary&quot; *data-type=&quot;number&quot;*/&gt;
&gt; 
&gt; 
&gt; Please please help out on this.
&gt; 
&gt; Thanks,
&gt; Anil
&gt; 
&gt; 
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt; 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305546.html</link>
</item><item>
<title>Re: [xsl] attribute based sorting - 10/29/2009 8:28:00 AM</title>
<description><![CDATA[<pre>I am using &lt;xsl:stylesheet version=&quot;1.0&quot; &gt;

Please help me out this problem.

Thanks,
Anil
Anil Kumar Veeramalli wrote:
&gt; Let me explain my problem
&gt;
&gt; My XML format will look like this.
&gt; &lt;employee&gt;   &lt;COLUMN NAME=&quot;SALARY&quot;&gt;95000&lt;/COLUMN&gt; &lt;COLUMN 
&gt; NAME=&quot;NAME&quot;&gt;ANIL&lt;/COLUMN&gt; &lt;/employee&gt;
&gt; &lt;employee&gt;   &lt;COLUMN NAME=&quot;SALARY&quot;&gt;92000&lt;/COLUMN&gt; &lt;COLUMN 
&gt; NAME=&quot;NAME&quot;&gt;Kumar&lt;/COLUMN&gt;&lt;/employee&gt; .....
&gt;
&gt; I wanted to sort this based on SALARY.
&gt;
&gt; Approaches I tried
&gt; 1)    &lt;xsl:for-each select=&quot;employee&quot;&gt;          &lt;xsl:sort 
&gt; select=&quot;COLUMN/SALARY&quot; data-type=&quot;number&quot;/&gt;
&gt;      &lt;xsl:for-each select=&quot;COLUMN&quot;&gt;         &lt;xsl:if 
&gt; test=&quot;@NAME='SALARY'&quot;&gt;&lt;xsl:variable select=&quot;.&quot;&gt;&lt;/xsl:variable&gt;&lt;/xsl:if&gt;
&gt;      &lt;/xsl:for-each&gt;
&gt; with this I am not able to sort
&gt;
&gt; with the above code, sort is not happening.
&gt;
&gt;
&gt; Thanks,
&gt; Anil
&gt;
&gt;
&gt; Michael M&#252;ller-Hillebrand wrote:
&gt;&gt; Am 29.10.2009 um 09:00 schrieb Anil Kumar Veeramalli:
&gt;&gt;
&gt;&gt;&gt; thanks Michael,
&gt;&gt;&gt;
&gt;&gt;&gt; I tried that option too,......its not working.
&gt;&gt;
&gt;&gt; Anil, apparently you gave us not enough information. &quot;not working&quot; is 
&gt;&gt; not useful. What is your input, how does your XSL look like so far 
&gt;&gt; (all stripped down to the absolute minimum), what is the expected 
&gt;&gt; output, what output do you get.
&gt;&gt;
&gt;&gt; As mentioned previously, preparing such a test case for many users 
&gt;&gt; (myself included) solves the problem.
&gt;&gt;
&gt;&gt; Best regards,
&gt;&gt;
&gt;&gt; - Michael
&gt;&gt;
&gt;&gt;
&gt;&gt; -- 
&gt;&gt; _______________________________________________________________
&gt;&gt; Michael M&#252;ller-Hillebrand: Dokumentations-Technologie
&gt;&gt; Adobe Certified Expert, FrameMaker
&gt;&gt; L&#246;sungen und Training, FrameScript, XML/XSL, Unicode
&gt;&gt; Blog: http://cap-studio.de/ - Tel. +49 (9131) 28747
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; --~------------------------------------------------------------------
&gt;&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt;&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt;&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt;&gt; --~--
&gt;&gt;
&gt;&gt;
&gt;
&gt;
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305545.html</link>
</item><item>
<title>[xsl] Is a XSLT 2 to 1 transform possible? - 10/29/2009 8:26:00 AM</title>
<description><![CDATA[<pre>Out of curiosity, could a XSLT 1.0 stylesheet be used to convert a
XSLT 2.0 stylesheet to an equivalent XSLT 1.0 stylesheet?

-Jostein

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305544.html</link>
</item><item>
<title>Re: [xsl] attribute based sorting - 10/29/2009 8:14:00 AM</title>
<description><![CDATA[<pre>Let me explain my problem

My XML format will look like this.
&lt;employee&gt;   &lt;COLUMN NAME=&quot;SALARY&quot;&gt;95000&lt;/COLUMN&gt; &lt;COLUMN 
NAME=&quot;NAME&quot;&gt;ANIL&lt;/COLUMN&gt; &lt;/employee&gt;
&lt;employee&gt;   &lt;COLUMN NAME=&quot;SALARY&quot;&gt;92000&lt;/COLUMN&gt; &lt;COLUMN 
NAME=&quot;NAME&quot;&gt;Kumar&lt;/COLUMN&gt;&lt;/employee&gt; .....

I wanted to sort this based on SALARY.

Approaches I tried
1)    &lt;xsl:for-each select=&quot;employee&quot;&gt;   
        &lt;xsl:sort select=&quot;COLUMN/SALARY&quot; data-type=&quot;number&quot;/&gt;
      &lt;xsl:for-each select=&quot;COLUMN&quot;&gt;  
        &lt;xsl:if test=&quot;@NAME='SALARY'&quot;&gt;     
          &lt;xsl:variable select=&quot;.&quot;&gt;&lt;/xsl:variable&gt;        
        &lt;/xsl:if&gt;
      &lt;/xsl:for-each&gt;
with this I am not able to sort

with the above code, sort is not happening.


Thanks,
Anil


Michael M&#252;ller-Hillebrand wrote:
&gt; Am 29.10.2009 um 09:00 schrieb Anil Kumar Veeramalli:
&gt;
&gt;&gt; thanks Michael,
&gt;&gt;
&gt;&gt; I tried that option too,......its not working.
&gt;
&gt; Anil, apparently you gave us not enough information. &quot;not working&quot; is 
&gt; not useful. What is your input, how does your XSL look like so far 
&gt; (all stripped down to the absolute minimum), what is the expected 
&gt; output, what output do you get.
&gt;
&gt; As mentioned previously, preparing such a test case for many users 
&gt; (myself included) solves the problem.
&gt;
&gt; Best regards,
&gt;
&gt; - Michael
&gt;
&gt;
&gt; -- 
&gt; _______________________________________________________________
&gt; Michael M&#252;ller-Hillebrand: Dokumentations-Technologie
&gt; Adobe Certified Expert, FrameMaker
&gt; L&#246;sungen und Training, FrameScript, XML/XSL, Unicode
&gt; Blog: http://cap-studio.de/ - Tel. +49 (9131) 28747
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305543.html</link>
</item><item>
<title>Re: [xsl] attribute based sorting - 10/29/2009 8:07:00 AM</title>
<description><![CDATA[<pre>Am 29.10.2009 um 09:00 schrieb Anil Kumar Veeramalli:

&gt; thanks Michael,
&gt;
&gt; I tried that option too,......its not working.

Anil, apparently you gave us not enough information. &quot;not working&quot; is  
not useful. What is your input, how does your XSL look like so far  
(all stripped down to the absolute minimum), what is the expected  
output, what output do you get.

As mentioned previously, preparing such a test case for many users  
(myself included) solves the problem.

Best regards,

- Michael


--
_______________________________________________________________
Michael M&#252;ller-Hillebrand: Dokumentations-Technologie
Adobe Certified Expert, FrameMaker
L&#246;sungen und Training, FrameScript, XML/XSL, Unicode
Blog: http://cap-studio.de/ - Tel. +49 (9131) 28747






--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305542.html</link>
</item><item>
<title>Re: [xsl] attribute based sorting - 10/29/2009 8:01:00 AM</title>
<description><![CDATA[<pre>thanks Michael,

I tried that option too,......its not working.

Thanks,
Anil

if the XML format is
Michael M&#252;ller-Hillebrand wrote:
&gt; Am 29.10.2009 um 07:33 schrieb Anil Kumar Veeramalli:
&gt;
&gt;&gt; I wanted to sort based on salary. please suggest me on this.can you 
&gt;&gt; give me some sample code.
&gt;&gt; my sample xml file look like this &lt;employee&gt;
&gt;&gt;   &lt;COLUMN NAME=&quot;SALARY&quot;&gt;95000&lt;/COLUMN&gt;
&gt;&gt; &lt;/employee&gt;
&gt;&gt; with multiple employees.
&gt;&gt;
&gt;&gt; I want to sort based on Salary attribute. instead of &lt;column 
&gt;&gt; name=&quot;salary&quot;&gt;95000&lt;/column&gt; this , &lt;salary&gt;1000&lt;/salary&gt; with this I 
&gt;&gt; am able to sort it out  like this
&gt;&gt; &lt;xsl:sort select=&quot;salary&quot; *data-type=&quot;number&quot;*/&gt;
&gt;
&gt; I assume you process &lt;employee&gt; maybe in a xsl:for-each loop. The try:
&gt;
&gt; &lt;xsl:sort select=&quot;column/@salary&quot; *data-type=&quot;number&quot;*/&gt;
&gt;
&gt; - Michael
&gt;
&gt; -- 
&gt; _______________________________________________________________
&gt; Michael M&#252;ller-Hillebrand: Dokumentations-Technologie
&gt; Adobe Certified Expert, FrameMaker
&gt; L&#246;sungen und Training, FrameScript, XML/XSL, Unicode
&gt; Blog: http://cap-studio.de/ - Tel. +49 (9131) 28747
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305541.html</link>
</item><item>
<title>Re: [xsl] attribute based sorting - 10/29/2009 7:58:00 AM</title>
<description><![CDATA[<pre>Am 29.10.2009 um 07:33 schrieb Anil Kumar Veeramalli:

&gt; I wanted to sort based on salary. please suggest me on this.can you  
&gt; give me some sample code.
&gt; my sample xml file look like this &lt;employee&gt;
&gt;   &lt;COLUMN NAME=&quot;SALARY&quot;&gt;95000&lt;/COLUMN&gt;
&gt; &lt;/employee&gt;
&gt; with multiple employees.
&gt;
&gt; I want to sort based on Salary attribute. instead of &lt;column  
&gt; name=&quot;salary&quot;&gt;95000&lt;/column&gt; this , &lt;salary&gt;1000&lt;/salary&gt; with this  
&gt; I am able to sort it out  like this
&gt; &lt;xsl:sort select=&quot;salary&quot; *data-type=&quot;number&quot;*/&gt;

I assume you process &lt;employee&gt; maybe in a xsl:for-each loop. The try:

&lt;xsl:sort select=&quot;column/@salary&quot; *data-type=&quot;number&quot;*/&gt;

- Michael

--
_______________________________________________________________
Michael M&#252;ller-Hillebrand: Dokumentations-Technologie
Adobe Certified Expert, FrameMaker
L&#246;sungen und Training, FrameScript, XML/XSL, Unicode
Blog: http://cap-studio.de/ - Tel. +49 (9131) 28747






--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305538.html</link>
</item><item>
<title>Re: Re: [xsl] Create word elements from a string - 10/29/2009 6:59:00 AM</title>
<description><![CDATA[<pre>Thanks for the help. I was able to get something working in XSL 1.0
using what you all provided. Although I think it's time to switch to
2.0 with tokenize!

I did run into a problem with:

&lt;xsl:when test=&quot;contains($str, ' ')&quot;&gt;

The test always returns true even when I only have one word in the
text. I don't particularly understand why, but when I change it to
this, everything works fine:

&lt;xsl:when test=&quot;contains(normalize-space($str), ' ')&quot;&gt;

Why does it return true when normalize-space is not there? I would
think with only one word, there wouldn't be any spaces.

Larry

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305533.html</link>
</item><item>
<title>[xsl] copy attributes, except some - 10/29/2009 6:38:00 AM</title>
<description><![CDATA[<pre>Hi,

Sorry for noise again, but David did provide a possibly better option as in:
&lt;xsl:copy-of select=&quot;@* except (attribute(name1), attribute(name2), 
attribute(name3), attribute(name4))&quot;/&gt;

Thanks,
ac




Hi,

In XSLT 2.0, assuming that the $excepted-attributes variable is not used
anywhere else, and apart from also using an attribute-set in defining
the $excepted-attributes variable value xx element, is there a better
way to copy all attributes except some specific ones, in a namespace
safe way, rather than:
&lt;xsl:variable name=&quot;excepted-attributes&quot;&gt;&lt;xx name1=&quot;&quot; name2=&quot;&quot; name3=&quot;&quot;
name4=&quot;&quot; name5=&quot;&quot; .../&gt;
&lt;xsl:copy-of select=&quot;@*[not(node-name(.) =
$excepted-attributes/xx/@*/node-name(.))]&quot;/&gt;

Thank you,
ac



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305532.html</link>
</item><item>
<title>[xsl] attribute based sorting - 10/29/2009 6:34:00 AM</title>
<description><![CDATA[<pre>Hi,

I wanted to sort based on salary. please suggest me on this.can you give 
me some sample code.
my sample xml file look like this 
&lt;employee&gt;
    &lt;COLUMN NAME=&quot;SALARY&quot;&gt;95000&lt;/COLUMN&gt;
  &lt;/employee&gt;
with multiple employees.

I want to sort based on Salary attribute. instead of &lt;column 
name=&quot;salary&quot;&gt;95000&lt;/column&gt; this , &lt;salary&gt;1000&lt;/salary&gt; with this I am 
able to sort it out  like this
&lt;xsl:sort select=&quot;salary&quot; *data-type=&quot;number&quot;*/&gt;


Please please help out on this.

Thanks,
Anil


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305531.html</link>
</item><item>
<title>[xsl] mailing list - 10/29/2009 6:30:00 AM</title>
<description><![CDATA[<pre>mailing list


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305530.html</link>
</item><item>
<title>[xsl] copy attributes, except some - 10/29/2009 6:06:00 AM</title>
<description><![CDATA[<pre>Hi,

In XSLT 2.0, assuming that the $excepted-attributes variable is not used 
anywhere else, and apart from also using an attribute-set in defining 
the $excepted-attributes variable value xx element, is there a better 
way to copy all attributes except some specific ones, in a namespace 
safe way, rather than:
&lt;xsl:variable name=&quot;excepted-attributes&quot;&gt;&lt;xx name1=&quot;&quot; name2=&quot;&quot; name3=&quot;&quot; 
name4=&quot;&quot; name5=&quot;&quot; .../&gt;
&lt;xsl:copy-of select=&quot;@*[not(node-name(.) = 
$excepted-attributes/xx/@*/node-name(.))]&quot;/&gt;

Thank you,
ac


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305527.html</link>
</item><item>
<title>Re: [xsl] Create word elements from a string - 10/29/2009 4:41:00 AM</title>
<description><![CDATA[<pre>Here's another 1.0 stylesheet (Dimitre, gave you one):

&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
		       version=&quot;1.0&quot;&gt;
				
    &lt;xsl:output method=&quot;xml&quot; indent=&quot;yes&quot; /&gt;				
				
    &lt;xsl:template match=&quot;/&quot;&gt;
       &lt;words&gt;
	   &lt;xsl:call-template name=&quot;tokenize&quot;&gt;
	      &lt;xsl:with-param name=&quot;str&quot; select=&quot;text&quot; /&gt;
	   &lt;/xsl:call-template&gt;
       &lt;/words&gt;
   &lt;/xsl:template&gt;

   &lt;xsl:template name=&quot;tokenize&quot;&gt;
      &lt;xsl:param name=&quot;str&quot; /&gt;	
	  &lt;xsl:choose&gt;
	    &lt;xsl:when test=&quot;contains($str, ' ')&quot;&gt;
	       &lt;word&gt;
		  &lt;xsl:value-of select=&quot;substring-before($str, ' ')&quot; /&gt;
	       &lt;/word&gt;
	       &lt;xsl:call-template name=&quot;tokenize&quot;&gt;
		   &lt;xsl:with-param name=&quot;str&quot; select=&quot;substring-after($str, ' ')&quot; /&gt;
	       &lt;/xsl:call-template&gt;
	    &lt;/xsl:when&gt;
	    &lt;xsl:otherwise&gt;
	       &lt;word&gt;
		   &lt;xsl:value-of select=&quot;$str&quot; /&gt;
	       &lt;/word&gt;
	    &lt;/xsl:otherwise&gt;
	  &lt;/xsl:choose&gt;
    &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;

This stylesheet implements tokenizing algorithm from scratch (and also
with a limitation, that tokenizing delimiter can be a single ' '
character). If you can use XSLT 2.0, you might prefer Ken's solution,
as XPath 2.0 has native tokenizing function. XPath 2.0 tokenizing
function allows you to, use say a regular expression specifier '\s+'
as a tokenizing delimiter.

On Thu, Oct 29, 2009 at 2:14 AM, Larry Hayashi &lt;lhtrees@gmail.com&gt; wrote:
&gt; Is there a function in XSLT 1.1 that will extract words from a string?
&gt; I'd like to be able to take &lt;text&gt;Jill ran up the hill.&lt;/text&gt; and get
&gt; the following:
&gt;
&gt; &lt;words&gt;
&gt; &#194;&#160;&lt;word&gt;Jill&lt;/word&gt;
&gt; &#194;&#160;&lt;word&gt;ran&lt;/word&gt;
&gt; &#194;&#160;&lt;word&gt;up&lt;/word&gt;
&gt; &#194;&#160;&lt;word&gt;the&lt;/word&gt;
&gt; &#194;&#160;&lt;word&gt;hill.&lt;/word&gt;
&gt; &lt;/words&gt;
&gt;
&gt; Thanks,
&gt; Larry



-- 
Regards,
Mukul Gandhi

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305523.html</link>
</item><item>
<title>RE: [xsl] nodes() before and after a string delimiter - 10/28/2009 9:58:00 PM</title>
<description><![CDATA[<pre>First find the text node containing the dash:

&lt;xsl:variable name=&quot;textNode&quot; select=&quot;text()[contains(.,' - ')][1] &quot;/&gt;

Create a &lt;term&gt; element containing all nodes preceding this text node, plus
the part of the text node before the dash:

&lt;term&gt;
   &lt;xsl:copy-of select=&quot;$textNode/preceding-sibling::node()&quot;/&gt;
   &lt;xsl:value-of select=&quot;substring-before($textNode, ' - ')&quot;/&gt;
&lt;/term&gt;

Create a &lt;definition&gt; element containing everything that follows the dash:

&lt;definition&gt;
   &lt;xsl:value-of select=&quot;substring-after($textNode, ' - ')&quot;/&gt; 
   &lt;xsl:copy-of select=&quot;$textNode/following-sibling::node()&quot;/&gt;
&lt;/definition&gt;

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay  

&gt; -----Original Message-----
&gt; From: Mario Madunic [mailto:Mario_Madunic@newflyer.com] 
&gt; Sent: 28 October 2009 19:25
&gt; To: xsl-list@lists.mulberrytech.com
&gt; Subject: [xsl] nodes() before and after a string delimiter
&gt; 
&gt; I have the following element (I'm using Saxon9 and XSLT2)
&gt; 
&gt; &lt;p&gt;Crazing - Hairline cracking of the resin, giving it an 
&gt; opaque, &lt;q&gt;frosty&lt;/q&gt; appearance.&lt;/p&gt;
&gt; 
&gt; I need to break it into two halves like the following based 
&gt; on the - (space en dash space) and only the first  - (space 
&gt; en dash space).
&gt; 
&gt; &lt;p&gt;
&gt;    &lt;term&gt;Crazing&lt;/term&gt;
&gt;    &lt;definition&gt;Hairline cracking of the resin, giving it an 
&gt; opaque, &lt;q&gt;frosty&lt;/q&gt; appearance.&lt;/definition&gt; &lt;/p&gt;
&gt; 
&gt; I'm used to breaking strings on delimiters and not worrying 
&gt; about any inline elements, but his time the inline elements matter. 
&gt; Is this a for-each-group solution? Break it into two 
&gt; for-each-groups and in the first test for a 
&gt; following-sibling[. = '-'] and the second test for the 
&gt; following-sibling[. = '-']. 
&gt; 
&gt; No need to apply templates at this point a copy-of will suffice.
&gt; 
&gt; Any insight would be appreciated.
&gt; 
&gt; Thanks
&gt; 
&gt; Marijan (Mario) Madunic
&gt; Publishing Specialist
&gt; New Flyer Industries
&gt; 
&gt; --------------------------------------------------------------------
&gt; Please consider the environment before printing this e-mail.
&gt; 
&gt; CONFIDENTIALITY STATEMENT: This communication (and  any and 
&gt; all information or material transmitted with this 
&gt; communication) is confidential, may be privileged and is 
&gt; intended only for the use of the intended recipient. If you 
&gt; are not the intended recipient, any review, retransmission, 
&gt; circulation, distribution, reproduction, conversion to hard 
&gt; copy, copying or other use of this communication, information 
&gt; or material is strictly prohibited and may be illegal. If you 
&gt; received this communication in error or if it is forwarded to 
&gt; you without the express authorization of New Flyer, please 
&gt; notify us immediately by telephone or by return email and 
&gt; permanently delete the communication, information and 
&gt; material from any computer, disk drive, diskette or other 
&gt; storage device or media. Thank you.
&gt; 
&gt; 
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt; 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305510.html</link>
</item><item>
<title>Re: [xsl] Create word elements from a string - 10/28/2009 9:11:00 PM</title>
<description><![CDATA[<pre>You can use the str-split-to-words template of FXSL 1,x

Here is an example of using it:


&lt;xsl:stylesheet version=&quot;1.0&quot;
 xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
 xmlns:ext=&quot;http://exslt.org/common&quot;
&gt;

   &lt;xsl:import href=&quot;strSplit-to-Words.xsl&quot;/&gt;

   &lt;xsl:output indent=&quot;yes&quot; omit-xml-declaration=&quot;yes&quot;/&gt;

    &lt;xsl:template match=&quot;/&quot;&gt;
      &lt;xsl:variable name=&quot;vwordNodes&quot;&gt;
        &lt;xsl:call-template name=&quot;str-split-to-words&quot;&gt;
          &lt;xsl:with-param name=&quot;pStr&quot; select=&quot;/&quot;/&gt;
          &lt;xsl:with-param name=&quot;pDelimiters&quot;
                          select=&quot;', &amp;#9;&amp;#10;&amp;#13;'&quot;/&gt;
        &lt;/xsl:call-template&gt;
      &lt;/xsl:variable&gt;

      &lt;xsl:apply-templates select=&quot;ext:node-set($vwordNodes)/*&quot;/&gt;
    &lt;/xsl:template&gt;

    &lt;xsl:template match=&quot;word&quot; priority=&quot;10&quot;&gt;
      &lt;xsl:value-of select=&quot;concat(position(), ' ', ., '&amp;#10;')&quot;/&gt;
    &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;


When applied on the following XML document:

&lt;t&gt;Use FXSL to do this&lt;/t&gt;

the result is:

1 Use
2 FXSL
3 to
4 do
5 this


-- 
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play




On Wed, Oct 28, 2009 at 1:44 PM, Larry Hayashi &lt;lhtrees@gmail.com&gt; wrote:
&gt; Is there a function in XSLT 1.1 that will extract words from a string?
&gt; I'd like to be able to take &lt;text&gt;Jill ran up the hill.&lt;/text&gt; and get
&gt; the following:
&gt;
&gt; &lt;words&gt;
&gt; &#194;&#160;&lt;word&gt;Jill&lt;/word&gt;
&gt; &#194;&#160;&lt;word&gt;ran&lt;/word&gt;
&gt; &#194;&#160;&lt;word&gt;up&lt;/word&gt;
&gt; &#194;&#160;&lt;word&gt;the&lt;/word&gt;
&gt; &#194;&#160;&lt;word&gt;hill.&lt;/word&gt;
&gt; &lt;/words&gt;
&gt;
&gt; Thanks,
&gt; Larry
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive: &#194;&#160;http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305509.html</link>
</item><item>
<title>Re: [xsl] Create word elements from a string - 10/28/2009 8:52:00 PM</title>
<description><![CDATA[<pre>At 2009-10-28 13:44 -0700, Larry Hayashi wrote:
&gt;Is there a function in XSLT 1.1

XSLT 1.1 was formally abandoned in August 2001 and should not be used 
... read the notice in the status section of this document:

   http://www.w3.org/TR/2001/WD-xslt11-20010824/

&gt;that will extract words from a string?
&gt;I'd like to be able to take &lt;text&gt;Jill ran up the hill.&lt;/text&gt; and get
&gt;the following:
&gt;
&gt;&lt;words&gt;
&gt;   &lt;word&gt;Jill&lt;/word&gt;
&gt;   &lt;word&gt;ran&lt;/word&gt;
&gt;   &lt;word&gt;up&lt;/word&gt;
&gt;   &lt;word&gt;the&lt;/word&gt;
&gt;   &lt;word&gt;hill.&lt;/word&gt;
&gt;&lt;/words&gt;

In XSLT 2.0 you can use tokenize().

I hope this helps.

. . . . . . . . . . . Ken

T:\ftemp&gt;type larry.xsl
&lt;?xml version=&quot;1.0&quot; encoding=&quot;US-ASCII&quot;?&gt;
&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
                 version=&quot;2.0&quot;&gt;

&lt;xsl:output indent=&quot;yes&quot;/&gt;

&lt;xsl:template match=&quot;/&quot;&gt;
   &lt;words&gt;
     &lt;xsl:for-each select=&quot;tokenize('Jill ran up the hill.','\s+')&quot;&gt;
       &lt;word&gt;
         &lt;xsl:value-of select=&quot;.&quot;/&gt;
       &lt;/word&gt;
     &lt;/xsl:for-each&gt;
   &lt;/words&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;

T:\ftemp&gt;xslt2 larry.xsl larry.xsl con
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;words&gt;
    &lt;word&gt;Jill&lt;/word&gt;
    &lt;word&gt;ran&lt;/word&gt;
    &lt;word&gt;up&lt;/word&gt;
    &lt;word&gt;the&lt;/word&gt;
    &lt;word&gt;hill.&lt;/word&gt;
&lt;/words&gt;
T:\ftemp&gt;

--
Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
Interested in other classes?  http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305506.html</link>
</item><item>
<title>[xsl] Create word elements from a string - 10/28/2009 8:45:00 PM</title>
<description><![CDATA[<pre>Is there a function in XSLT 1.1 that will extract words from a string?
I'd like to be able to take &lt;text&gt;Jill ran up the hill.&lt;/text&gt; and get
the following:

&lt;words&gt;
  &lt;word&gt;Jill&lt;/word&gt;
  &lt;word&gt;ran&lt;/word&gt;
  &lt;word&gt;up&lt;/word&gt;
  &lt;word&gt;the&lt;/word&gt;
  &lt;word&gt;hill.&lt;/word&gt;
&lt;/words&gt;

Thanks,
Larry

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305505.html</link>
</item><item>
<title>Re: [xsl] nodes() before and after a string delimiter - 10/28/2009 7:53:00 PM</title>
<description><![CDATA[<pre>Mario Madunic wrote:
&gt; I have the following element (I'm using Saxon9 and XSLT2)
&gt; 
&gt; &lt;p&gt;Crazing &#226;€“ Hairline cracking of the resin, giving it an opaque, &lt;q&gt;frosty&lt;/q&gt; appearance.&lt;/p&gt;
&gt; 
&gt; I need to break it into two halves like the following based on the &#226;€“ (space en dash space) and only the first  &#226;€“ (space en dash space).
&gt; 
&gt; &lt;p&gt;
&gt;    &lt;term&gt;Crazing&lt;/term&gt;
&gt;    &lt;definition&gt;Hairline cracking of the resin, giving it an opaque, &lt;q&gt;frosty&lt;/q&gt; appearance.&lt;/definition&gt;
&gt; &lt;/p&gt;

This stylesheet

&lt;xsl:stylesheet
   xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
   version=&quot;2.0&quot;&gt;

   &lt;xsl:output indent=&quot;yes&quot;/&gt;

   &lt;xsl:template match=&quot;@* | node()&quot;&gt;
     &lt;xsl:copy&gt;
       &lt;xsl:apply-templates select=&quot;@* | node()&quot;/&gt;
     &lt;/xsl:copy&gt;
   &lt;/xsl:template&gt;

   &lt;xsl:template match=&quot;p&quot;&gt;
     &lt;xsl:copy&gt;
       &lt;xsl:variable name=&quot;this&quot; select=&quot;.&quot;/&gt;
       &lt;xsl:variable name=&quot;t&quot; select=&quot;text()[1]&quot;/&gt;
       &lt;xsl:analyze-string select=&quot;$t&quot; regex=&quot;(.*) &#226;€“ (.*)&quot;&gt;
         &lt;xsl:matching-substring&gt;
           &lt;term&gt;&lt;xsl:value-of select=&quot;regex-group(1)&quot;/&gt;&lt;/term&gt;
           &lt;definition&gt;
             &lt;xsl:value-of select=&quot;regex-group(2)&quot;/&gt;
             &lt;xsl:apply-templates select=&quot;$t/following-sibling::node()&quot;/&gt;
           &lt;/definition&gt;
         &lt;/xsl:matching-substring&gt;
         &lt;xsl:non-matching-substring&gt;
           &lt;xsl:apply-templates select=&quot;$this/node()&quot;/&gt;
         &lt;/xsl:non-matching-substring&gt;
       &lt;/xsl:analyze-string&gt;
     &lt;/xsl:copy&gt;
   &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;

does that but I have not tested against anything but your input sample.
-- 

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305502.html</link>
</item><item>
<title>[xsl] nodes() before and after a string delimiter - 10/28/2009 7:25:00 PM</title>
<description><![CDATA[<pre>I have the following element (I'm using Saxon9 and XSLT2)

&lt;p&gt;Crazing &#226;€“ Hairline cracking of the resin, giving it an opaque, &lt;q&gt;frosty&lt;/q&gt; appearance.&lt;/p&gt;

I need to break it into two halves like the following based on the &#226;€“ (space en dash space) and only the first  &#226;€“ (space en dash space).

&lt;p&gt;
   &lt;term&gt;Crazing&lt;/term&gt;
   &lt;definition&gt;Hairline cracking of the resin, giving it an opaque, &lt;q&gt;frosty&lt;/q&gt; appearance.&lt;/definition&gt;
&lt;/p&gt;

I&#226;€™m used to breaking strings on delimiters and not worrying about any inline elements, but his time the inline elements matter. 
Is this a for-each-group solution? Break it into two for-each-groups and in the first test for a following-sibling[. = '&#226;€“'] and the second test for the following-sibling[. = '&#226;€“']. 

No need to apply templates at this point a copy-of will suffice.

Any insight would be appreciated.

Thanks

Marijan (Mario) Madunic
Publishing Specialist
New Flyer Industries

--------------------------------------------------------------------
Please consider the environment before printing this e-mail.

CONFIDENTIALITY STATEMENT: This communication (and  any and all information or material transmitted with this communication) is confidential, may be privileged and is intended only for the use of the intended recipient. If you are not the intended recipient, any review, retransmission, circulation, distribution, reproduction, conversion to hard copy, copying or other use of this communication, information or material is strictly prohibited and may be illegal. If you received this communication in error or if it is forwarded to you without the express authorization of New Flyer, please notify us immediately by telephone or by return email and permanently delete the communication, information and material from any computer, disk drive, diskette or other storage device or media. Thank you.


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305501.html</link>
</item><item>
<title>Re: [xsl] reading a text file and putting out an xml file using xslt - 10/28/2009 7:24:00 PM</title>
<description><![CDATA[<pre>Thank you. This worked.

But I have anther problem. I am applying a transformation style sheets
to another set of xml files to generate another xml output.
These files have images as entities in beginning:

&lt;!DOCTYPE books[
&lt;!NOTATION ccitt4 PUBLIC '-//USA-DOD//NOTATION CCITT Group4 Facsimile//EN' &gt;
&lt;!ENTITY im1 SYSTEM &quot;bk1-im1.tif&quot; NDATA ccitt4&gt;
&lt;!ENTITY im2 SYSTEM &quot;bk1-im2.tif&quot; NDATA ccitt4&gt;
]&gt;

I am using saxon9 to run this in a batch mode. So my source points to
a directory with all the xml files and images.
java net.sf.saxon.Transform -s:c:\sampleset -xsl:test.xsl -o:c:\output

But I get this error on running it in batch mode.

SXXP0003: Error reported by XML parser: Content is not allowed in prolog.
While processing bk1-im1.tif: Run-time errors were reported

Can you please tell me what I am doing wrong here?


On Wed, Oct 28, 2009 at 10:40 AM, Michael Kay &lt;mike@saxonica.com&gt; wrote:
&gt;
&gt;&gt; Thank you. I have saxon9 downloaded. But I am not sure how to
&gt;&gt; run a transformation on the command line for a text input.
&gt;&gt; Any help?
&gt;&gt;
&gt;
&gt; Typically
&gt;
&gt; java net.sf.saxon.Transform -xsl:stylesheet.xsl -it:main
&gt;
&gt; or you might want to supply the name of the unparsed text file as a
&gt; parameter:
&gt;
&gt; java net.sf.saxon.Transform -xsl:stylesheet.xsl -it:main input=text.xml
&gt;
&gt; with
&gt;
&gt; &lt;xsl:param name=&quot;input&quot;/&gt;
&gt;
&gt; and
&gt;
&gt; select=&quot;unparsed-text($input)&quot;
&gt;
&gt; Regards,
&gt;
&gt; Michael Kay
&gt; http://www.saxonica.com/
&gt; http://twitter.com/michaelhkay
&gt;
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive: &#160;http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305500.html</link>
</item><item>
<title>RE: [xsl] reading a text file and putting out an xml file using xslt - 10/28/2009 3:41:00 PM</title>
<description><![CDATA[<pre>&gt; Thank you. I have saxon9 downloaded. But I am not sure how to 
&gt; run a transformation on the command line for a text input.
&gt; Any help?
&gt; 

Typically

java net.sf.saxon.Transform -xsl:stylesheet.xsl -it:main

or you might want to supply the name of the unparsed text file as a
parameter:

java net.sf.saxon.Transform -xsl:stylesheet.xsl -it:main input=text.xml

with

&lt;xsl:param name=&quot;input&quot;/&gt;

and

select=&quot;unparsed-text($input)&quot;

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305490.html</link>
</item><item>
<title>Re: [xsl] reading a text file and putting out an xml file using xslt - 10/28/2009 3:13:00 PM</title>
<description><![CDATA[<pre>Thank you. I have saxon9 downloaded. But I am not sure how to run a
transformation on the command line for a text input.
Any help?

On Wed, Oct 28, 2009 at 9:30 AM, Martin Honnen &lt;Martin.Honnen@gmx.de&gt; wrote:
&gt; a kusa wrote:
&gt;
&gt;&gt; I have an input file which is a text file. My output should be an XML
&gt;&gt; file that conforms to a schema that I already have.
&gt;&gt;
&gt;&gt; How do I do this in XSLT2.0? Can I use unparsed-text() function? Are
&gt;&gt; there any examples that I can look at for this?
&gt;
&gt; An XSLT 2.0 processor should allow you to start processing with a named
&gt; template so in your stylesheet you would write a named template e.g.
&gt; &#160;&lt;xsl:template name=&quot;main&quot;&gt;
&gt; &#160; &#160;&lt;xsl:variable name=&quot;t1&quot; select=&quot;unparsed-text('input.txt')&quot;/&gt;
&gt; &#160; &#160;&lt;!-- now process t1 here perhaps by tokenizing --&gt;
&gt; &#160;&lt;/xsl:template&gt;
&gt; then you would instruct the XSLT processor to start with template named
&gt; &quot;main&quot; (e.g. option -it:main in Saxon or /n main with Altova I think).
&gt;
&gt;
&gt;
&gt; --
&gt;
&gt; &#160; &#160; &#160; &#160;Martin Honnen
&gt; &#160; &#160; &#160; &#160;http://msmvps.com/blogs/martin_honnen/
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive: &#160;http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305489.html</link>
</item><item>
<title>Re: [xsl] reading a text file and putting out an xml file using xslt - 10/28/2009 2:30:00 PM</title>
<description><![CDATA[<pre>a kusa wrote:

&gt; I have an input file which is a text file. My output should be an XML
&gt; file that conforms to a schema that I already have.
&gt; 
&gt; How do I do this in XSLT2.0? Can I use unparsed-text() function? Are
&gt; there any examples that I can look at for this?

An XSLT 2.0 processor should allow you to start processing with a named 
template so in your stylesheet you would write a named template e.g.
   &lt;xsl:template name=&quot;main&quot;&gt;
     &lt;xsl:variable name=&quot;t1&quot; select=&quot;unparsed-text('input.txt')&quot;/&gt;
     &lt;!-- now process t1 here perhaps by tokenizing --&gt;
   &lt;/xsl:template&gt;
then you would instruct the XSLT processor to start with template named 
&quot;main&quot; (e.g. option -it:main in Saxon or /n main with Altova I think).



-- 

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305486.html</link>
</item><item>
<title>[xsl] reading a text file and putting out an xml file using xslt 2.0 - 10/28/2009 2:26:00 PM</title>
<description><![CDATA[<pre>Hi

I have an input file which is a text file. My output should be an XML
file that conforms to a schema that I already have.

How do I do this in XSLT2.0? Can I use unparsed-text() function? Are
there any examples that I can look at for this?

Thanks in advance

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305485.html</link>
</item><item>
<title>Re: [xsl] Saxon9, XMLSpy2009, and result-document href= - 10/28/2009 1:30:00 PM</title>
<description><![CDATA[<pre>I often make solutions that work in both AltovaXML and Saxon.

In the following example I load a file as unpassed text, and need to
get hold of the filename. To make a solution that works both in Saxon
and AltovaXML, I do this:

&lt;xsl:variable name=&quot;unparsed&quot; select=&quot;unparsed-text(document-uri(.))&quot;/&gt;
&lt;!-- The next four varaibles are preparations to make it easier to
modify the name of the output file --&gt;
&lt;xsl:variable name=&quot;input-file&quot; select=&quot;tokenize(document-uri(.),
'(\\|/)')[last()]&quot;&gt;
&lt;xsl:variable name=&quot;input-filename&quot;
select=&quot;substring-before($input-file, '.')&quot;/&gt;
&lt;xsl:variable name=&quot;input-path&quot;
select=&quot;substring-before(document-uri(.), $input-filename)&quot;/&gt;
&lt;xsl:variable name=&quot;input-extension&quot;
select=&quot;substring-after($input-file, '.')&quot;/&gt;

It is line three that is important. I do this:
(\\|/)')[last()
to make it work both in Saxon and AltovaXML.

Hope it can be of some help.

Cheers,

Jesper Tverskov
http://www.xmlplease.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305481.html</link>
</item><item>
<title>RE: [xsl] Saxon9, XMLSpy2009, and result-document href= - 10/28/2009 1:18:00 PM</title>
<description><![CDATA[<pre>Is it possible to pass a param in that defines which environment you are using, so as to define whether or not &quot;file:///&quot; or &quot;&quot; to use?

Marijan (Mario) Madunic
Publishing Specialist
New Flyer Industries

-----Original Message-----
From: Raymond Lillibridge [mailto:RLillibridge@municode.com] 
Sent: Wednesday, October 28, 2009 7:08 AM
To: 'xsl-list@lists.mulberrytech.com'
Subject: [xsl] Saxon9, XMLSpy2009, and result-document href=

All,

While developing my XSLT 2.0 transformation files using XMLSpy 2009, I was able to save output to the result-document @href value of &quot;C:/folder/file.xml&quot; but when using Saxon9 this doesn't work.  Saxon9 seemed to only work if I used &quot;file:////C:/folder/file.xml&quot; instead (Which doesn't work with XMLSpy).  

This creates a development problem.  My current solution is to change XMLSpy to use Saxon9 for it's translations, but I can't assume all developers will be using it for their development and transformations.  Is there a method of writing our XSLT transformations such that they will work properly using either Saxon9 or XMLSpy2009?  Any insight on this difference in their functionality is appreciated.


Cheers,
----------------------------------
Raymond Lillibridge
   Systems Analyst
rlillibridge@municode.com
800-262-2633
850-576-3171 x248

&quot;It's what you read when you don't have to that determines what you will be when you can't help it.&quot;
--Oscar Wilde


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--


--------------------------------------------------------------------
Please consider the environment before printing this e-mail.

CONFIDENTIALITY STATEMENT: This communication (and  any and all information or material transmitted with this communication) is confidential, may be privileged and is intended only for the use of the intended recipient. If you are not the intended recipient, any review, retransmission, circulation, distribution, reproduction, conversion to hard copy, copying or other use of this communication, information or material is strictly prohibited and may be illegal. If you received this communication in error or if it is forwarded to you without the express authorization of New Flyer, please notify us immediately by telephone or by return email and permanently delete the communication, information and material from any computer, disk drive, diskette or other storage device or media. Thank you.


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305480.html</link>
</item><item>
<title>RE: [xsl] Saxon9, XMLSpy2009, and result-document href= - 10/28/2009 12:17:00 PM</title>
<description><![CDATA[<pre>&gt; 
&gt; While developing my XSLT 2.0 transformation files using 
&gt; XMLSpy 2009, I was able to save output to the result-document 
&gt; @href value of &quot;C:/folder/file.xml&quot; but when using Saxon9 
&gt; this doesn't work.  Saxon9 seemed to only work if I used 
&gt; &quot;file:////C:/folder/file.xml&quot; instead (Which doesn't work 
&gt; with XMLSpy).  
&gt; 

The specification states that it must be a URI. Many products accept Windows
filenames in places where the W3C specs mandate a URI, but in general, Saxon
doesn't.

It should be file:///C:/folder/file.xml or possibly file:/C:/folder/file.xml
- but I'm not surprised you got away with ////, the specs for the file: URI
scheme are pretty fuzzy.

You might find that the most portable solution is to use a relative URI
(e.g. file.xml). This is interpreted relative to the base Output URI, which
will generally be the destination of the primary output of the
transformation.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305477.html</link>
</item><item>
<title>Re: [xsl] Saxon9, XMLSpy2009, and result-document href= - 10/28/2009 12:11:00 PM</title>
<description><![CDATA[<pre>try oxygenxml - oxygenxml.com

Joan Crawford  - &quot;I, Joan Crawford, I believe in the dollar.
Everything I earn, I spend.&quot; -
http://www.brainyquote.com/quotes/authors/j/joan_crawford.html


On Wed, Oct 28, 2009 at 3:08 PM, Raymond Lillibridge
&lt;RLillibridge@municode.com&gt; wrote:
&gt; All,
&gt;
&gt; While developing my XSLT 2.0 transformation files using XMLSpy 2009, I was able to save output to the result-document @href value of &quot;C:/folder/file.xml&quot; but when using Saxon9 this doesn't work. &#194;&#160;Saxon9 seemed to only work if I used &quot;file:////C:/folder/file.xml&quot; instead (Which doesn't work with XMLSpy).
&gt;
&gt; This creates a development problem. &#194;&#160;My current solution is to change XMLSpy to use Saxon9 for it's translations, but I can't assume all developers will be using it for their development and transformations. &#194;&#160;Is there a method of writing our XSLT transformations such that they will work properly using either Saxon9 or XMLSpy2009? &#194;&#160;Any insight on this difference in their functionality is appreciated.
&gt;
&gt;
&gt; Cheers,
&gt; ----------------------------------
&gt; Raymond Lillibridge
&gt; &#194;&#160;&#194;&#160; Systems Analyst
&gt; rlillibridge@municode.com
&gt; 800-262-2633
&gt; 850-576-3171 x248
&gt;
&gt; &quot;It's what you read when you don't have to that determines what you will be when you can't help it.&quot;
&gt; --Oscar Wilde
&gt;
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive: &#194;&#160;http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305476.html</link>
</item><item>
<title>[xsl] Saxon9, XMLSpy2009, and result-document href= - 10/28/2009 12:09:00 PM</title>
<description><![CDATA[<pre>All,

While developing my XSLT 2.0 transformation files using XMLSpy 2009, I was able to save output to the result-document @href value of &quot;C:/folder/file.xml&quot; but when using Saxon9 this doesn't work.  Saxon9 seemed to only work if I used &quot;file:////C:/folder/file.xml&quot; instead (Which doesn't work with XMLSpy).  

This creates a development problem.  My current solution is to change XMLSpy to use Saxon9 for it's translations, but I can't assume all developers will be using it for their development and transformations.  Is there a method of writing our XSLT transformations such that they will work properly using either Saxon9 or XMLSpy2009?  Any insight on this difference in their functionality is appreciated.


Cheers,
----------------------------------
Raymond Lillibridge
&#160;&#160; Systems Analyst
rlillibridge@municode.com
800-262-2633
850-576-3171 x248

&quot;It's what you read when you don't have to that determines what you will be when you can't help it.&quot;
--Oscar Wilde


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305475.html</link>
</item><item>
<title>RE: [xsl] FOP flow question - 10/28/2009 11:50:00 AM</title>
<description><![CDATA[<pre>Mark,

I also noticed you have no &lt;fo:table-row&gt; in your table. You may also be
having problems with the renderer handling your LinoType font. Try using a
generic font such as Helvetica and see if that helps.

Below is some code that should work although you need to get the indents
sorted on the before and after regions.

&lt;fo:root xmlns:fo=&quot;http://www.w3.org/1999/XSL/Format&quot;&gt;
	&lt;fo:layout-master-set&gt;
		&lt;fo:simple-page-master master-name=&quot;cover_letter&quot;
page-width=&quot;8.5in&quot; page-height=&quot;11in&quot; margin-top=&quot;0.5in&quot;
margin-bottom=&quot;0.5in&quot; margin-left=&quot;0.5in&quot; margin-right=&quot;1in&quot;&gt;
			&lt;fo:region-body margin-left=&quot;0.50in&quot;
margin-top=&quot;1.25in&quot;/&gt;
			&lt;fo:region-before extent=&quot;1in&quot;/&gt;
			&lt;fo:region-after extent=&quot;0.5in&quot;/&gt;
		&lt;/fo:simple-page-master&gt;
	&lt;/fo:layout-master-set&gt;
	&lt;fo:page-sequence master-reference=&quot;cover_letter&quot;
force-page-count=&quot;no-force&quot;&gt;
		&lt;fo:static-content flow-name=&quot;xsl-region-before&quot;&gt;
			&lt;fo:table table-layout=&quot;fixed&quot;&gt;
				&lt;fo:table-column column-width=&quot;100%&quot;
column-number=&quot;1&quot;/&gt;
				&lt;fo:table-body&gt;
					&lt;fo:table-row&gt;
						&lt;fo:table-cell&gt;
							&lt;fo:block&gt;Hello in
the header table!&lt;/fo:block&gt;
						&lt;/fo:table-cell&gt;
					&lt;/fo:table-row&gt;
				&lt;/fo:table-body&gt;
			&lt;/fo:table&gt;
		&lt;/fo:static-content&gt;
		&lt;fo:static-content flow-name=&quot;xsl-region-after&quot;&gt;
			&lt;fo:table table-layout=&quot;fixed&quot;&gt;
				&lt;fo:table-column column-width=&quot;50%&quot;
column-number=&quot;1&quot;/&gt;
				&lt;fo:table-column column-width=&quot;50%&quot;
column-number=&quot;2&quot;/&gt;
				&lt;fo:table-body&gt;
					&lt;fo:table-row&gt;
						&lt;fo:table-cell&gt;
							&lt;fo:block&gt;
&lt;/fo:block&gt;
						&lt;/fo:table-cell&gt;
						&lt;fo:table-cell&gt;
							&lt;fo:block
text-align=&quot;right&quot;&gt;
	
&lt;fo:page-number format=&quot;1&quot;/&gt;
							&lt;/fo:block&gt;
						&lt;/fo:table-cell&gt;
					&lt;/fo:table-row&gt;
				&lt;/fo:table-body&gt;
			&lt;/fo:table&gt;
		&lt;/fo:static-content&gt;
		&lt;fo:flow flow-name=&quot;xsl-region-body&quot;&gt;
			&lt;fo:block font-family=&quot;Helvetica&quot;
font-size=&quot;8pt&quot;&gt;Hello in the body.&lt;/fo:block&gt;
		&lt;/fo:flow&gt;
		&lt;!-- for the body --&gt;
	&lt;/fo:page-sequence&gt;
&lt;/fo:root&gt;


William Charlton
The yMonda team
yMonda Limited
w: www.ymonda.net


-----Original Message-----
From: mark bordelon [mailto:markcbordelon@yahoo.com] 
Sent: 26 October 2009 17:36
To: xsl-list@lists.mulberrytech.com
Subject: [xsl] FOP flow question

Dear Members,

After a break from fop frustration, I have reduced my fop transform to the
simplest as I build it up, studying from ww3schools ftp xslt tutorial.
Unfortuantely, even here I am having mixed success that someone here might
be able to help with. I will eventually learn all this at a class I am
taking with Ken, but need this working before then, unfortunately. Any help
much appreciated!

1) (region-bfore) I am getting errors about having two flow tags. When I
change the first to static-content, nothing appears at all in this region.
How can you put text into two regions of the same page-sequence?

2) (region-after) The &quot;denominator&quot; of the page footer does not display. I
have looked through the documentation and cannot figure what is wrong.

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;

&lt;xsl:stylesheet version=&quot;1.1&quot;
xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
xmlns:fo=&quot;http://www.w3.org/1999/XSL/Format&quot; exclude-result-prefixes=&quot;fo&quot;&gt;
&lt;xsl:output method=&quot;xml&quot; version=&quot;1.0&quot; omit-xml-declaration=&quot;no&quot;
indent=&quot;yes&quot;/&gt;&lt;xsl:strip-space elements=&quot;*&quot;/&gt;

&lt;!--master template--&gt;
&lt;xsl:template match=&quot;TEAMS_ASSET_FILE&quot;&gt;
&lt;fo:root&gt;
&lt;fo:layout-master-set&gt;
&lt;fo:simple-page-master master-name=&quot;cover_letter&quot; page-width=&quot;8.5in&quot;
page-height=&quot;11in&quot; margin-top=&quot;0.5in&quot; margin-bottom=&quot;.5in&quot;
margin-left=&quot;0.5in&quot; margin-right=&quot;1in&quot;&gt;
	&lt;fo:region-body margin-left=&quot;0.50in&quot; margin-top=&quot;1.25in&quot; /&gt;
	&lt;fo:region-before extent=&quot;1in&quot;/&gt;
	&lt;fo:region-after extent=&quot;0.5in&quot;/&gt;
&lt;/fo:simple-page-master&gt;
&lt;/fo:layout-master-set&gt;
			
&lt;fo:page-sequence master-reference=&quot;cover_letter&quot;
force-page-count=&quot;no-force&quot;&gt;
						
&lt;fo:flow flow-name=&quot;xsl-region-before&quot;&gt; 
&lt;fo:table table-layout=&quot;fixed&quot;&gt;
&lt;/fo:table&gt;
&lt;/fo:flow&gt;
				
&lt;fo:static-content flow-name=&quot;xsl-region-after&quot;&gt;
&lt;fo:block font-family=&quot;LinotypeSyntaxItalics&quot; font-size=&quot;8pt&quot;
text-align=&quot;right&quot;&gt;
Page &lt;fo:page-number/&gt; of &lt;fo:page-number-citation ref-id=&quot;last-page&quot;/&gt;
&lt;/fo:block&gt;
&lt;/fo:static-content&gt;

&lt;fo:flow flow-name=&quot;xsl-region-body&quot;&gt;
...content...
&lt;/fo:flow&gt;

&lt;/fo:page-sequence&gt;

&lt;/fo:root&gt;
&lt;/xsl:template&gt;
	
&lt;/xsl:stylesheet&gt;


      

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305472.html</link>
</item><item>
<title>RE: [xsl] FOP transform region issue - 10/28/2009 11:32:00 AM</title>
<description><![CDATA[<pre>Mark,

You must have columns specified for tables in XSL-FO or the table will not
render.

&lt;fo:table table-layout=&quot;fixed&quot;&gt;
&lt;!-- Add this or it won't work --&gt;
	  &lt;fo:table-column column-width=&quot;100%&quot; column-number=&quot;1&quot;/&gt;


William Charlton
The yMonda team
yMonda Limited
w: www.ymonda.net

-----Original Message-----
From: G. Ken Holman [mailto:gkholman@CraneSoftwrights.com] 
Sent: 27 October 2009 17:43
To: xsl-list@lists.mulberrytech.com
Subject: Re: [xsl] FOP transform region issue

At 2009-10-27 10:28 -0700, mark bordelon wrote:
&gt;OK, following instructions,
&gt;I have only one flow for the body and static-content for the before-region.
&gt;
&gt;Structure looks like this:

I removed the XSLT and just edited a raw XSL-FO file so as to be able 
to test the pertinent issues without the XSLT getting in the way.  I 
also had to flesh out the table and the body to get some text.  I was 
left with this:

   &lt;fo:root xmlns:fo=&quot;http://www.w3.org/1999/XSL/Format&quot;&gt;
    &lt;fo:layout-master-set&gt;
     &lt;fo:simple-page-master master-name=&quot;cover_letter&quot; 
page-width=&quot;8.5in&quot; page-height=&quot;11in&quot; margin-top=&quot;0.5in&quot; 
margin-bottom=&quot;.5in&quot; margin-left=&quot;0.5in&quot; margin-right=&quot;1in&quot;&gt;
      &lt;fo:region-body margin-left=&quot;0.50in&quot; margin-top=&quot;1.25in&quot; /&gt;
      &lt;fo:region-before extent=&quot;1in&quot;/&gt;
     &lt;/fo:simple-page-master&gt;
    &lt;/fo:layout-master-set&gt;

    &lt;fo:page-sequence master-reference=&quot;cover_letter&quot;
                      force-page-count=&quot;no-force&quot;&gt;

     &lt;fo:static-content flow-name=&quot;xsl-region-before&quot;&gt;
       &lt;!-- none of this is appearing !!! --&gt;
      &lt;fo:table table-layout=&quot;fixed&quot;&gt;
        &lt;fo:table-body&gt;
          &lt;fo:table-cell&gt;
            &lt;fo:block&gt;Hello in the header table!&lt;/fo:block&gt;
          &lt;/fo:table-cell&gt;
        &lt;/fo:table-body&gt;
      &lt;/fo:table&gt;
     &lt;/fo:static-content&gt;
     &lt;fo:flow flow-name=&quot;xsl-region-body&quot;&gt;
      &lt;fo:block font-family=&quot;LinotypeSyntax&quot; font-size=&quot;8pt&quot;&gt;
        Hello in the body.
      &lt;/fo:block&gt;
     &lt;/fo:flow&gt; &lt;!-- for the body --&gt;
    &lt;/fo:page-sequence&gt;
   &lt;/fo:root&gt;

When I run the above through four XSL-FO processors (including FOP), 
I get both the header and the body showing.  I am also using FOP 0.95 
and I get these messages:

t:\ftemp&gt;xslfo-pdf-fop mark.fo mark.pdf -v
FOP Version 0.95
Oct 27, 2009 1:37:03 PM org.apache.fop.fonts.FontInfo notifyFontReplacement
WARNING: Font 'LinotypeSyntax,normal,400' not found. Substituting 
with 'any,normal,400'.
Oct 27, 2009 1:37:03 PM 
org.apache.fop.layoutmgr.table.TableLayoutManager getNextKnuthElements
INFO: table-layout=&quot;fixed&quot; and width=&quot;auto&quot;, but auto-layout not 
supported =&gt; assuming width=&quot;100%&quot;

t:\ftemp&gt;

&gt;But the bad news is the static-content for the before-region does not
appear

I am seeing the static content, so I'm not sure how to mimic the 
problems you are experiencing.

Perhaps someone on the list with FOP experience can recognize the 
differences in behaviours.

. . . . . . . . . . . . . . Ken

--
Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
Interested in other classes?  http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305471.html</link>
</item><item>
<title>Re: [xsl] start-indent - 10/27/2009 9:09:00 PM</title>
<description><![CDATA[<pre>My error.
Shortly after I hit the send button, I realized that I was missing the 
point. Simply putting the &quot;right&quot; value (as opposed to useless values) in 
the fo:block did the trick.
Thanks for your answer.
Mark

--------------------------------------------------
From: &quot;G. Ken Holman&quot; &lt;gkholman@CraneSoftwrights.com&gt;
Sent: Tuesday, October 27, 2009 1:58 PM
To: &lt;xsl-list@lists.mulberrytech.com&gt;
Subject: Re: [xsl] start-indent

&gt; At 2009-10-27 13:09 -0700, Mark Wilson wrote:
&gt;&gt;Hi all,
&gt;&gt;I know I can do this:
&gt;&gt;&lt;fo:block start-indent=&quot;4em&quot; text-indent=&quot;-4em&quot;&gt;
&gt;&gt;
&gt;&gt;but is it possible to make something like this work?
&gt;&gt;&lt;fo:block&gt;
&gt;&gt;........
&gt;&gt;&lt;fo:wrapper start-indent=&quot;4em&quot; text-indent=&quot;-4em&quot;&gt;
&gt;&gt;
&gt;&gt;So that the wrapper stuff is indented within the block.
&gt;
&gt; Can you describe your requirement in more detail?  Your &lt;fo:wrapper&gt; is 
&gt; going to add those block-oriented properties to any block content inside, 
&gt; but if you only have inline characters inside, then you won't see any 
&gt; effect.
&gt;
&gt;&gt;If so, how?
&gt;
&gt; If you are expecting to write:
&gt;
&gt;   &lt;fo:block&gt;abc&lt;fo:wrapper (indents)&gt;def ghi&lt;/fo:wrapper&gt;jkl&lt;/fo:block&gt;
&gt;
&gt; ... then what would you have wanted to see?
&gt;
&gt; . . . . . . . . . Ken
&gt;
&gt;
&gt; --
&gt; Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
&gt; Interested in other classes?  http://www.CraneSoftwrights.com/s/i/
&gt; Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
&gt; Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
&gt; Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
&gt; Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
&gt; G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
&gt; Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
&gt; Legal business disclaimers:  http://www.CraneSoftwrights.com/legal
&gt;
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;
&gt; 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305441.html</link>
</item><item>
<title>Re: [xsl] start-indent - 10/27/2009 8:59:00 PM</title>
<description><![CDATA[<pre>At 2009-10-27 13:09 -0700, Mark Wilson wrote:
&gt;Hi all,
&gt;I know I can do this:
&gt;&lt;fo:block start-indent=&quot;4em&quot; text-indent=&quot;-4em&quot;&gt;
&gt;
&gt;but is it possible to make something like this work?
&gt;&lt;fo:block&gt;
&gt;........
&gt;&lt;fo:wrapper start-indent=&quot;4em&quot; text-indent=&quot;-4em&quot;&gt;
&gt;
&gt;So that the wrapper stuff is indented within the block.

Can you describe your requirement in more detail?  Your &lt;fo:wrapper&gt; 
is going to add those block-oriented properties to any block content 
inside, but if you only have inline characters inside, then you won't 
see any effect.

&gt;If so, how?

If you are expecting to write:

   &lt;fo:block&gt;abc&lt;fo:wrapper (indents)&gt;def ghi&lt;/fo:wrapper&gt;jkl&lt;/fo:block&gt;

... then what would you have wanted to see?

. . . . . . . . . Ken


--
Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
Interested in other classes?  http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305438.html</link>
</item><item>
<title>[xsl] start-indent - 10/27/2009 8:10:00 PM</title>
<description><![CDATA[<pre>Hi all,
I know I can do this:
&lt;fo:block start-indent=&quot;4em&quot; text-indent=&quot;-4em&quot;&gt;

but is it possible to make something like this work?
&lt;fo:block&gt;
........
&lt;fo:wrapper start-indent=&quot;4em&quot; text-indent=&quot;-4em&quot;&gt;

So that the wrapper stuff is indented within the block.
If so, how?
Thanks
Mark
 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305437.html</link>
</item><item>
<title>Re: [xsl] XSL-FO group by problem - 10/27/2009 7:08:00 PM</title>
<description><![CDATA[<pre>Martin and Ken,
So obvious, but I just did not see it.
Thanks
Mark
--------------------------------------------------
From: &quot;Martin Honnen&quot; &lt;Martin.Honnen@gmx.de&gt;
Sent: Tuesday, October 27, 2009 11:08 AM
To: &lt;xsl-list@lists.mulberrytech.com&gt;
Subject: Re: [xsl] XSL-FO group by problem

&gt; Mark Wilson wrote:
&gt;
&gt;&gt;         &lt;xsl:for-each-group select=&quot;Item&quot; group-by=&quot;concat(Prefix, 
&gt;&gt; CatalogNumber, Range)&quot;&gt;
&gt;&gt;            &lt;fo:block xsl:use-attribute-sets=&quot;base&quot;&gt;
&gt;&gt;                &lt;xsl:for-each select=&quot;current-group()&quot;&gt;
&gt;&gt;
&gt;&gt; &lt;!--    What do I put here so that I only get one copy of the Catalog 
&gt;&gt; Number?
&gt;&gt;          (This code seems to go into an endless loop.)
&gt;&gt; --&gt;
&gt;&gt;                    &lt;xsl:apply-templates select=&quot;CatalogNumber&quot; 
&gt;&gt; mode=&quot;do&quot;/&gt;
&gt;
&gt; I think you want to move the above xsl:apply-templates outside of the 
&gt; xsl:for-each to ensure it is only done once for each group but not for 
&gt; each Item in each group.
&gt;
&gt;&gt;                   &lt;xsl:apply-templates select=&quot;Title&quot; mode=&quot;do&quot;/&gt;
&gt;&gt;
&gt;&gt;                &lt;/xsl:for-each&gt;
&gt;&gt;            &lt;/fo:block&gt;
&gt;&gt;        &lt;/xsl:for-each-group&gt;
&gt;
&gt;
&gt;
&gt; -- 
&gt;
&gt; Martin Honnen
&gt; http://msmvps.com/blogs/martin_honnen/
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;
&gt; 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305434.html</link>
</item><item>
<title>RE: [xsl] string search - 10/27/2009 6:52:00 PM</title>
<description><![CDATA[<pre>Thank you for your responses. I am sorry to have come in such a rush :-) Things (especially the specification give to me) have changed a bit since my post and are much clearer now. It seems that it will not be as difficult as it seemed at the beginning. Nevertheless, I will try to post results and examples after I finish.

Pavel &#169;kop&#237;k



-----Original Message-----
From: Andrew Welch [mailto:andrew.j.welch@gmail.com] 
Sent: Tuesday, October 27, 2009 6:40 PM
To: xsl-list@lists.mulberrytech.com
Subject: Re: [xsl] string search


That's fine... if you spec out the problem more fully with a complete set of possible inputs and required out, and the xslt processer and version you are using, then you should get a solution.

2009/10/27 Skopik Pavel &lt;Pavel.Skopik@aipsafe.cz&gt;:
&gt; Hello,
&gt;
&gt; I have come across an issue related to string search which seems to be 
&gt; much advanced then just testing its occurence or positon.
&gt;
&gt; My XML source has a node, which contains list of organizations and 
&gt; their roles. First comes the role, second the name of the subject. The 
&gt; subject and its role may be surounded by other text. What I need to do 
&gt; is to extract the name of the subject which comes after the name of 
&gt; the role.
&gt;
&gt; Source text:
&gt; Text text text. Approves: Ministry of whatever. Text Text.
&gt;
&gt; Desired result:
&gt; Ministry of whatever
&gt;
&gt; Of course there can be punctuation characters around the name of the 
&gt; subject, spaces etc.
&gt;
&gt; Do you think it is feasable even to try do something like this or just 
&gt; leave it off and try to solve this situation with different 
&gt; technology? (I am inclined to the second option, but would like to 
&gt; hear you opinion).
&gt;
&gt; Best regards,
&gt;
&gt; Pavel &#169;kop&#237;k
&gt;
&gt;
&gt;
&gt;
&gt;
&gt; __________ Informace od ESET NOD32 Antivirus, verze databaze 4548 
&gt; (20091027) __________
&gt;
&gt; Tuto zpravu proveril ESET NOD32 Antivirus.
&gt;
&gt; http://www.eset.cz
&gt;
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive: &#160;http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;



-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--

 

__________ Informace od ESET NOD32 Antivirus, verze databaze 4548 (20091027) __________

Tuto zpravu proveril ESET NOD32 Antivirus.

http://www.eset.cz
 
 

__________ Informace od ESET NOD32 Antivirus, verze databaze 4549 (20091027) __________

Tuto zpravu proveril ESET NOD32 Antivirus.

http://www.eset.cz
 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305431.html</link>
</item><item>
<title>Re: [xsl] XSL-FO group by problem - 10/27/2009 6:10:00 PM</title>
<description><![CDATA[<pre>At 2009-10-27 11:00 -0700, Mark Wilson wrote:
&gt;In an XSLT-FO style sheet, I have created groups similar to the one 
&gt;shown at the end of this email.

Fine.

&gt;I have one template for formatting the &lt;CatalogNumber&gt; and another 
&gt;for formatting the remaining data. The &lt;CatalogNumber&gt; is always 
&gt;identical in a group, but the remaining information differs. I want 
&gt;a single copy of the &lt;CatalogNumber&gt; and one copy each of all of the 
&gt;remaining information from each &lt;Item&gt;as indicated in the output 
&gt;below (I can format everything, that's not my problem, I just can't 
&gt;get the single copy of the &lt;CatalogNumber&gt;).

What you are missing is that your current node at the beginning of 
&lt;xsl:for-each-group&gt; is at the first member of the group selected.

&gt;Output:
&gt;4: New issues: Czech Republic, May/Jun 1993, p. 22; Letters to the 
&gt;editor, Mar/Apr 2002, p. 27; Joint issues, Nov/Dec 2002, p.18.
&gt;
&gt;My style sheet code is:
&gt;         &lt;xsl:for-each-group select=&quot;Item&quot; group-by=&quot;concat(Prefix, 
&gt; CatalogNumber, Range)&quot;&gt;

At this point, &lt;xsl:value-of select=&quot;CatalogNumber&quot;/&gt; will give you 
&quot;4&quot; because your current node is the first &lt;Item&gt; of the group of 
&lt;Item&gt; elements.

In the classroom I tell students to read the instruction as if it were written:

   &lt;xsl:for-the-first-member-of-each-group .....

... and then to work with the other members of the group using current-group().

&gt;            &lt;fo:block xsl:use-attribute-sets=&quot;base&quot;&gt;
&gt;                &lt;xsl:for-each select=&quot;current-group()&quot;&gt;
&gt;
&gt;&lt;!--    What do I put here so that I only get one copy of the Catalog Number?
&gt;          (This code seems to go into an endless loop.)
&gt;--&gt;

You put the processing of the catalogue number before the 
&lt;xsl:for-each&gt;, not inside.

&gt;                    &lt;xsl:apply-templates select=&quot;CatalogNumber&quot; mode=&quot;do&quot;/&gt;

Move that line up before the &lt;xsl:for-each/&gt;

&gt;                   &lt;xsl:apply-templates select=&quot;Title&quot; mode=&quot;do&quot;/&gt;
&gt;
&gt;                &lt;/xsl:for-each&gt;
&gt;            &lt;/fo:block&gt;
&gt;        &lt;/xsl:for-each-group&gt;

I hope this helps.

. . . . . . . . . . . . . . Ken


--
Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
Interested in other classes?  http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305430.html</link>
</item><item>
<title>Re: [xsl] XSL-FO group by problem - 10/27/2009 6:09:00 PM</title>
<description><![CDATA[<pre>Mark Wilson wrote:

&gt;         &lt;xsl:for-each-group select=&quot;Item&quot; group-by=&quot;concat(Prefix, 
&gt; CatalogNumber, Range)&quot;&gt;
&gt;            &lt;fo:block xsl:use-attribute-sets=&quot;base&quot;&gt;
&gt;                &lt;xsl:for-each select=&quot;current-group()&quot;&gt;
&gt; 
&gt; &lt;!--    What do I put here so that I only get one copy of the Catalog 
&gt; Number?
&gt;          (This code seems to go into an endless loop.)
&gt; --&gt;
&gt;                    &lt;xsl:apply-templates select=&quot;CatalogNumber&quot; mode=&quot;do&quot;/&gt;

I think you want to move the above xsl:apply-templates outside of the 
xsl:for-each to ensure it is only done once for each group but not for 
each Item in each group.

&gt;                   &lt;xsl:apply-templates select=&quot;Title&quot; mode=&quot;do&quot;/&gt;
&gt; 
&gt;                &lt;/xsl:for-each&gt;
&gt;            &lt;/fo:block&gt;
&gt;        &lt;/xsl:for-each-group&gt;



-- 

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305429.html</link>
</item><item>
<title>[xsl] XSL-FO group by problem - 10/27/2009 6:01:00 PM</title>
<description><![CDATA[<pre>Hello all,
In an XSLT-FO style sheet, I have created groups similar to the one shown at 
the end of this email.
I have one template for formatting the &lt;CatalogNumber&gt; and another for 
formatting the remaining data. The &lt;CatalogNumber&gt; is always identical in a 
group, but the remaining information differs. I want a single copy of the 
&lt;CatalogNumber&gt; and one copy each of all of the remaining information from 
each &lt;Item&gt;as indicated in the output below (I can format everything, that's 
not my problem, I just can't get the single copy of the &lt;CatalogNumber&gt;).

Thanks,
Mark

Output:
4: New issues: Czech Republic, May/Jun 1993, p. 22; Letters to the editor, 
Mar/Apr 2002, p. 27; Joint issues, Nov/Dec 2002, p.18.

My style sheet code is:
         &lt;xsl:for-each-group select=&quot;Item&quot; group-by=&quot;concat(Prefix, 
CatalogNumber, Range)&quot;&gt;
            &lt;fo:block xsl:use-attribute-sets=&quot;base&quot;&gt;
                &lt;xsl:for-each select=&quot;current-group()&quot;&gt;

&lt;!--    What do I put here so that I only get one copy of the Catalog 
Number?
          (This code seems to go into an endless loop.)
--&gt;
                    &lt;xsl:apply-templates select=&quot;CatalogNumber&quot; mode=&quot;do&quot;/&gt;
                   &lt;xsl:apply-templates select=&quot;Title&quot; mode=&quot;do&quot;/&gt;

                &lt;/xsl:for-each&gt;
            &lt;/fo:block&gt;
        &lt;/xsl:for-each-group&gt;

Example of a group:
&lt;Item&gt;
      &lt;CatalogNumber&gt;4&lt;/CatalogNumber&gt;
      &lt;Title&gt;New issues: Czech Republic&lt;/Title&gt;
      &lt;IssueName&gt;May/Jun&lt;/IssueName&gt;
      &lt;Year&gt;1993&lt;/Year&gt;
      &lt;Page&gt;22&lt;/Page&gt;
&lt;/Item&gt;
 &lt;Item&gt;
     &lt;CatalogNumber&gt;4&lt;/CatalogNumber&gt;
     &lt;Title&gt;Letters to the editor&lt;/Title&gt;
     &lt;IssueName&gt;Mar/Apr&lt;/IssueName&gt;
     &lt;Year&gt;2002&lt;/Year&gt;
     &lt;Page&gt;27&lt;/Page&gt;
&lt;/Item&gt;
&lt;Item&gt;
     &lt;CatalogNumber&gt;4&lt;/CatalogNumber&gt;
     &lt;Title&gt;Joint issues&lt;/Title&gt;
     &lt;IssueName&gt;Nov/Dec&lt;/IssueName&gt;
     &lt;Year&gt;2002&lt;/Year&gt;
     &lt;Page&gt;18&lt;/Page&gt;
&lt;/Item&gt; 



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305428.html</link>
</item><item>
<title>RE: [xsl] string search - 10/27/2009 5:51:00 PM</title>
<description><![CDATA[<pre>It's probably feasible to do this in XSLT 2.0 using regular expressions,
assuming you can specify the problem more precisely - or develop the regular
expressions incrementally by trial and error over a range of source files
that are representative of the whole collection you need to process.

(If you can't specify the problem more precisely, then a different
technology isn't going to help.)

Doing it with XSLT 1.0 is likely to be more difficult. 

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 

&gt; -----Original Message-----
&gt; From: Skopik Pavel [mailto:Pavel.Skopik@aipsafe.cz] 
&gt; Sent: 27 October 2009 17:33
&gt; To: xsl-list@lists.mulberrytech.com
&gt; Subject: [xsl] string search
&gt; 
&gt; Hello,
&gt;  
&gt; I have come across an issue related to string search which 
&gt; seems to be much advanced then just testing its occurence or positon.
&gt;  
&gt; My XML source has a node, which contains list of 
&gt; organizations and their roles. First comes the role, second 
&gt; the name of the subject. The subject and its role may be 
&gt; surounded by other text. What I need to do is to extract the 
&gt; name of the subject which comes after the name of the role. 
&gt;  
&gt; Source text:
&gt; Text text text. Approves: Ministry of whatever. Text Text.
&gt;  
&gt; Desired result:
&gt; Ministry of whatever
&gt;  
&gt; Of course there can be punctuation characters around the name 
&gt; of the subject, spaces etc.
&gt;  
&gt; Do you think it is feasable even to try do something like 
&gt; this or just leave it off and try to solve this situation 
&gt; with different technology? (I am inclined to the second 
&gt; option, but would like to hear you opinion).
&gt;  
&gt; Best regards,
&gt;  
&gt; Pavel &#169;kop&#237;k
&gt; 
&gt; 
&gt; 
&gt;  
&gt; 
&gt; __________ Informace od ESET NOD32 Antivirus, verze databaze 
&gt; 4548 (20091027) __________
&gt; 
&gt; Tuto zpravu proveril ESET NOD32 Antivirus.
&gt; 
&gt; http://www.eset.cz
&gt;  
&gt; 
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt; 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305425.html</link>
</item><item>
<title>Re: [xsl] FOP transform region issue - 10/27/2009 5:43:00 PM</title>
<description><![CDATA[<pre>At 2009-10-27 10:28 -0700, mark bordelon wrote:
&gt;OK, following instructions,
&gt;I have only one flow for the body and static-content for the before-region.
&gt;
&gt;Structure looks like this:

I removed the XSLT and just edited a raw XSL-FO file so as to be able 
to test the pertinent issues without the XSLT getting in the way.  I 
also had to flesh out the table and the body to get some text.  I was 
left with this:

   &lt;fo:root xmlns:fo=&quot;http://www.w3.org/1999/XSL/Format&quot;&gt;
    &lt;fo:layout-master-set&gt;
     &lt;fo:simple-page-master master-name=&quot;cover_letter&quot; 
page-width=&quot;8.5in&quot; page-height=&quot;11in&quot; margin-top=&quot;0.5in&quot; 
margin-bottom=&quot;.5in&quot; margin-left=&quot;0.5in&quot; margin-right=&quot;1in&quot;&gt;
      &lt;fo:region-body margin-left=&quot;0.50in&quot; margin-top=&quot;1.25in&quot; /&gt;
      &lt;fo:region-before extent=&quot;1in&quot;/&gt;
     &lt;/fo:simple-page-master&gt;
    &lt;/fo:layout-master-set&gt;

    &lt;fo:page-sequence master-reference=&quot;cover_letter&quot;
                      force-page-count=&quot;no-force&quot;&gt;

     &lt;fo:static-content flow-name=&quot;xsl-region-before&quot;&gt;
       &lt;!-- none of this is appearing !!! --&gt;
      &lt;fo:table table-layout=&quot;fixed&quot;&gt;
        &lt;fo:table-body&gt;
          &lt;fo:table-cell&gt;
            &lt;fo:block&gt;Hello in the header table!&lt;/fo:block&gt;
          &lt;/fo:table-cell&gt;
        &lt;/fo:table-body&gt;
      &lt;/fo:table&gt;
     &lt;/fo:static-content&gt;
     &lt;fo:flow flow-name=&quot;xsl-region-body&quot;&gt;
      &lt;fo:block font-family=&quot;LinotypeSyntax&quot; font-size=&quot;8pt&quot;&gt;
        Hello in the body.
      &lt;/fo:block&gt;
     &lt;/fo:flow&gt; &lt;!-- for the body --&gt;
    &lt;/fo:page-sequence&gt;
   &lt;/fo:root&gt;

When I run the above through four XSL-FO processors (including FOP), 
I get both the header and the body showing.  I am also using FOP 0.95 
and I get these messages:

t:\ftemp&gt;xslfo-pdf-fop mark.fo mark.pdf -v
FOP Version 0.95
Oct 27, 2009 1:37:03 PM org.apache.fop.fonts.FontInfo notifyFontReplacement
WARNING: Font 'LinotypeSyntax,normal,400' not found. Substituting 
with 'any,normal,400'.
Oct 27, 2009 1:37:03 PM 
org.apache.fop.layoutmgr.table.TableLayoutManager getNextKnuthElements
INFO: table-layout=&quot;fixed&quot; and width=&quot;auto&quot;, but auto-layout not 
supported =&gt; assuming width=&quot;100%&quot;

t:\ftemp&gt;

&gt;But the bad news is the static-content for the before-region does not appear

I am seeing the static content, so I'm not sure how to mimic the 
problems you are experiencing.

Perhaps someone on the list with FOP experience can recognize the 
differences in behaviours.

. . . . . . . . . . . . . . Ken

--
Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
Interested in other classes?  http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305424.html</link>
</item><item>
<title>Re: [xsl] string search - 10/27/2009 5:40:00 PM</title>
<description><![CDATA[<pre>That's fine... if you spec out the problem more fully with a complete
set of possible inputs and required out, and the xslt processer and
version you are using, then you should get a solution.

2009/10/27 Skopik Pavel &lt;Pavel.Skopik@aipsafe.cz&gt;:
&gt; Hello,
&gt;
&gt; I have come across an issue related to string search which seems to be much advanced then just testing its occurence or positon.
&gt;
&gt; My XML source has a node, which contains list of organizations and their roles. First comes the role, second the name of the subject. The subject and its role may be surounded by other text. What I need to do is to extract the name of the subject which comes after the name of the role.
&gt;
&gt; Source text:
&gt; Text text text. Approves: Ministry of whatever. Text Text.
&gt;
&gt; Desired result:
&gt; Ministry of whatever
&gt;
&gt; Of course there can be punctuation characters around the name of the subject, spaces etc.
&gt;
&gt; Do you think it is feasable even to try do something like this or just leave it off and try to solve this situation with different technology? (I am inclined to the second option, but would like to hear you opinion).
&gt;
&gt; Best regards,
&gt;
&gt; Pavel &#169;kop&#237;k
&gt;
&gt;
&gt;
&gt;
&gt;
&gt; __________ Informace od ESET NOD32 Antivirus, verze databaze 4548 (20091027) __________
&gt;
&gt; Tuto zpravu proveril ESET NOD32 Antivirus.
&gt;
&gt; http://www.eset.cz
&gt;
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive: &#160;http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;



-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305423.html</link>
</item><item>
<title>Re: [xsl] string search - 10/27/2009 5:39:00 PM</title>
<description><![CDATA[<pre>With the given (sketchy) specification it would be difficult with
*any* technology. How is the end of the &quot;name of the subject&quot; defined?
How many roles are there? Is it guaranteed that no role name occurs in
the &quot;Text text text&quot; preceding the actual role? Is matching to be done
heeding case? Etc., etc.
-W

2009/10/27 Skopik Pavel &lt;Pavel.Skopik@aipsafe.cz&gt;
&gt;
&gt; Hello,
&gt;
&gt; I have come across an issue related to string search which seems to be much advanced then just testing its occurence or positon.
&gt;
&gt; My XML source has a node, which contains list of organizations and their roles. First comes the role, second the name of the subject. The subject and its role may be surounded by other text. What I need to do is to extract the name of the subject which comes after the name of the role.
&gt;
&gt; Source text:
&gt; Text text text. Approves: Ministry of whatever. Text Text.
&gt;
&gt; Desired result:
&gt; Ministry of whatever
&gt;
&gt; Of course there can be punctuation characters around the name of the subject, spaces etc.
&gt;
&gt; Do you think it is feasable even to try do something like this or just leave it off and try to solve this situation with different technology? (I am inclined to the second option, but would like to hear you opinion).
&gt;
&gt; Best regards,
&gt;
&gt; Pavel &#169;kop&#237;k
&gt;
&gt;
&gt;
&gt;
&gt;
&gt; __________ Informace od ESET NOD32 Antivirus, verze databaze 4548 (20091027) __________
&gt;
&gt; Tuto zpravu proveril ESET NOD32 Antivirus.
&gt;
&gt; http://www.eset.cz
&gt;
&gt;
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive: &#160;http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305422.html</link>
</item><item>
<title>[xsl] string search - 10/27/2009 5:34:00 PM</title>
<description><![CDATA[<pre>Hello,
 
I have come across an issue related to string search which seems to be much advanced then just testing its occurence or positon.
 
My XML source has a node, which contains list of organizations and their roles. First comes the role, second the name of the subject. The subject and its role may be surounded by other text. What I need to do is to extract the name of the subject which comes after the name of the role. 
 
Source text:
Text text text. Approves: Ministry of whatever. Text Text.
 
Desired result:
Ministry of whatever
 
Of course there can be punctuation characters around the name of the subject, spaces etc.
 
Do you think it is feasable even to try do something like this or just leave it off and try to solve this situation with different technology? (I am inclined to the second option, but would like to hear you opinion).
 
Best regards,
 
Pavel &#169;kop&#237;k



 

__________ Informace od ESET NOD32 Antivirus, verze databaze 4548 (20091027) __________

Tuto zpravu proveril ESET NOD32 Antivirus.

http://www.eset.cz
 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305421.html</link>
</item><item>
<title>[xsl] FOP transform region issue - 10/27/2009 5:29:00 PM</title>
<description><![CDATA[<pre>OK, following instructions,
I have only one flow for the body and static-content for the before-region.

Structure looks like this:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;xsl:stylesheet version=&quot;1.1&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; xmlns:fo=&quot;http://www.w3.org/1999/XSL/Format&quot; exclude-result-prefixes=&quot;fo&quot;&gt;
&lt;xsl:output method=&quot;xml&quot; version=&quot;1.0&quot; omit-xml-declaration=&quot;no&quot; indent=&quot;yes&quot;/&gt;&lt;xsl:strip-space elements=&quot;*&quot;/&gt;
&lt;xsl:template match=&quot;TEAMS_ASSET_FILE&quot;&gt;
&#160;&#160;&lt;fo:root&gt;
&#160;&#160;&#160;&lt;fo:layout-master-set&gt;
&#160;&#160;&#160;&#160;&lt;fo:simple-page-master master-name=&quot;cover_letter&quot; page-width=&quot;8.5in&quot; page-height=&quot;11in&quot; margin-top=&quot;0.5in&quot; margin-bottom=&quot;.5in&quot; margin-left=&quot;0.5in&quot; margin-right=&quot;1in&quot;&gt;
&#160;&#160;&#160;&#160;&#160;&lt;fo:region-body margin-left=&quot;0.50in&quot; margin-top=&quot;1.25in&quot; /&gt;
&#160;&#160;&#160;&#160;&#160;&lt;fo:region-before extent=&quot;1in&quot;/&gt;
&#160;&#160;&#160;&#160;&lt;/fo:simple-page-master&gt;
&#160;&#160;&#160;&lt;/fo:layout-master-set&gt;
&#160;&#160;&#160;
&#160;&#160;&#160;&lt;fo:page-sequence master-reference=&quot;cover_letter&quot; force-page-count=&quot;no-force&quot;&gt;
&#160;&#160;&#160;
&#160;&#160;&#160;&#160;&lt;fo:static-content flow-name=&quot;xsl-region-before&quot;&gt; &lt;!-- none of this is appearing !!! --&gt;
&#160;&#160;&#160;&#160;&#160;&lt;fo:table table-layout=&quot;fixed&quot;&gt;
&#160;&#160;&#160;&#160;&#160;&lt;/fo:table&gt;
&#160;&#160;&#160;&#160;&lt;/fo:static-content&gt;
&#160;&#160;&#160;&#160;&lt;fo:flow flow-name=&quot;xsl-region-body&quot;&gt;
&#160;&#160;&#160;&#160;&#160;&lt;fo:block font-family=&quot;LinotypeSyntax&quot; font-size=&quot;8pt&quot; xmlns:helper=&quot;xalan://com.artesia.ps.misc.Helper&quot;&gt;
&#160;&#160;&#160;&#160;&#160;&lt;/fo:block&gt;
&#160;&#160;&#160;&#160;&lt;/fo:flow&gt; &lt;!-- for the body --&gt;
&#160;&#160;&#160;&lt;/fo:page-sequence&gt;
&#160;&#160;&lt;/fo:root&gt;
&lt;/xsl:template&gt;
&#160;
&lt;/xsl:stylesheet&gt;
&#160;
(For simplicity's sake, I removed the after-region. since this is a one-page page-sequence, the page count is not necessary.)

Oddly enough, I checked to make sure that=A0all regions=A0still transform perfectly in SPY (I am using the built-in XSLT engine to perform XSLT part, and the FOP-0.95 for the FO).
But the bad news is the static-content for the before-region does not appear in the java transformation even though the body transforms fine.=20

I get these log messages:
using the=A0org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser as SAX2 Parser
building formatting object tree
setting up fonts
Parsing of document complete, stopping renderer
Initial heap size: 76700Kb
Current heap size: 76700Kb
Total memory used: 0Kb
Memory use is indicative; no GC was performed
These figures should not be used comparatively
Total time used: 10ms
Pages rendered: 0


      

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305420.html</link>
</item><item>
<title>Re: [xsl] Can an XSLT document invoke arbitrary extension functions? - 10/26/2009 10:44:00 PM</title>
<description><![CDATA[<pre>Hi,

I scanned the slides cited and I actually found nothing to disagree 
with (though it's not my area of expertise). The author is clearly 
talking about XSLT being used for things it wasn't primarily intended 
for by developers who are in over their heads and haven't come to 
terms with what XSLT or XSLT engines can do. If this makes it a 
security hazard in that application context, that's not really about 
XSLT but about the way it's being used.

As I see it, that kind of problem actually goes with the territory of 
its being a powerful and capable technology, not something always to 
be avoided on principle.

I agree that the particular example of a Xalan extension supposedly 
being used to execute arbitrary code is over the top; but the 
argument being made in the slides doesn't actually depend on this example.

Cheers,
Wendell

At 04:40 PM 10/26/2009, Roger wrote:
&gt;Hi Folks,
&gt;
&gt;Below is an XSLT transform that - supposedly - opens a DOS command 
&gt;prompt. I saw the XSLT transform in this [1] briefing (slide 132). I 
&gt;ran it. It doesn't work; it just produces an error....


======================================================================
Wendell Piez                            mailto:wapiez@mulberrytech.com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
   Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305381.html</link>
</item><item>
<title>Re: [xsl] Can an XSLT document invoke arbitrary extension functions? - 10/26/2009 9:43:00 PM</title>
<description><![CDATA[<pre>An XSLT transformation is just a program execution.

Allowing unknown programs to run on a box is a security issue of *that
box*, not a security issue of the programming language, in which the
program is written.


-- 
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play





On Mon, Oct 26, 2009 at 1:40 PM, Costello, Roger L. &lt;costello@mitre.org&gt; wrote:
&gt;
&gt; Hi Folks,
&gt;
&gt; Below is an XSLT transform that - supposedly - opens a DOS command prompt. I saw the XSLT transform in this [1] briefing (slide 132). I ran it. It doesn't work; it just produces an error.
&gt;
&gt; The briefing seems to suggest that XSLT is riddled with security leaks, as any XSLT transform can invoke pretty much any arbitrary function (apparently including, as the below XSLT transform shows, any arbitrary Windows function).
&gt;
&gt; Questions:
&gt;
&gt; 1. Should the below XSLT Transform work? (i.e. is there simply a minor bug in it, that when fixed, would make it operate as desired?)
&gt;
&gt; 2. Is there any control over the set of extension functions provided by XSLT processors?
&gt;
&gt; 3. How do you respond to the briefing's suggestions that XSLT is riddled with security leaks? (I realize this is a broad question; any thoughts you have would be appreciated)
&gt;
&gt;
&gt; &lt;?xml version=&quot;1.0&quot;?&gt;
&gt; &lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160;xmlns:rt=&quot;http://xml.apache.org/xalan/java/java.lang.Runtime&quot;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160;xmlns:ob=&quot;http://xml.apache.org/xalan/java/java.lang.Object&quot;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160;extension-element-prefixes=&quot;rt ob&quot;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160;version=&quot;1.0&quot;&gt;
&gt;
&gt;
&gt; &#194;&#160; &#194;&#160;&lt;xsl:template match=&quot;/&quot;&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160;&lt;xsl:variable name=&quot;runTimeObject&quot; select=&quot;rt:getRuntime()&quot;/&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160;&lt;xsl:variable name=&quot;command&quot;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; select=&quot;rt:exec($runTimeObject, &amp;apos;c:\Windows\system32\cmd.exe&amp;apos;)&quot;/&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160;&lt;xsl:variable name=&quot;commandAsString&quot; select=&quot;ob:toString($command)&quot;/&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160;&lt;xsl:value-of select=&quot;$commandAsString&quot;/&gt;
&gt; &#194;&#160; &#194;&#160;&lt;/xsl:template&gt;
&gt;
&gt; &lt;/xsl:stylesheet&gt;
&gt;
&gt;
&gt; /Roger
&gt;
&gt;
&gt; [1] https://www.isecpartners.com/files/iSEC_HILL_AttackingXMLSecurity_bh07.pdf
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive: &#194;&#160;http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt;
&gt;

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305378.html</link>
</item><item>
<title>Re: [xsl] Can an XSLT document invoke arbitrary extension functions? - 10/26/2009 9:08:00 PM</title>
<description><![CDATA[<pre>Costello, Roger L. wrote:

  Hi,

&gt; The briefing seems to suggest that XSLT is riddled with security
&gt; leaks, as any XSLT transform can invoke pretty much any
&gt; arbitrary function (apparently including, as the below XSLT
&gt; transform shows, any arbitrary Windows function).

  A processor can provide such extension functions, sure.  But
well, the same way you can do pretty weird things in Java or any
other programming languages.  This is not a security hole, this is
a feature you can use or not.  Of course, if you plan to execute a
program coming from the wild wild world, you have to very carefully
disable those features on your processor.

  Regards,

-- 
Florent Georges
http://www.fgeorges.org/



















      


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305377.html</link>
</item><item>
<title>RE: [xsl] Can an XSLT document invoke arbitrary extension functions? - 10/26/2009 8:59:00 PM</title>
<description><![CDATA[<pre>&gt; 
&gt; The briefing seems to suggest that XSLT is riddled with 
&gt; security leaks, as any XSLT transform can invoke pretty much 
&gt; any arbitrary function (apparently including, as the below 
&gt; XSLT transform shows, any arbitrary Windows function). 
&gt; 
&gt; Questions:
&gt; 
&gt; 1. Should the below XSLT Transform work? (i.e. is there 
&gt; simply a minor bug in it, that when fixed, would make it 
&gt; operate as desired?)
&gt; 
&gt; 2. Is there any control over the set of extension functions 
&gt; provided by XSLT processors?
&gt; 
&gt; 3. How do you respond to the briefing's suggestions that XSLT 
&gt; is riddled with security leaks? (I realize this is a broad 
&gt; question; any thoughts you have would be appreciated)
&gt; 

1. The set of extension functions provided by a processors is defined by
that processor, not by the language specification. So the answer to (1)
depends on which processor you are using.

2. Ditto. Saxon has always had an option to disable all extension functions,
for this reason. The latest release of Saxon goes beyond this, by allowing
you to restrict the processor to use only extension functions that have been
pre-registered with the processor: so provided you trust the application
that invokes the processor, you don't need to trust the stylesheet.

3. It's rather emotive language, but there is certainly an issue here that
implementors and users need to be aware of. In the early days of XSLT the
W3C ran a service to run user-uploaded transformations using James Clark's
xt processor, which at the time had no way to disable extension functions,
and I demonstrated that it was possible to use this to obtain a full listing
of the server filestore. (I could equally have read or deleted files if I
had been so inclined). For a short time before I spotted it, Software AG
were doing the same thing. So it's right to draw attention to the risk.

Also of course, XSLT is Turing-complete, so it is eminently capable of
denial-of-service attacks. The bottom line is that a stylesheet is a
program, and if you really care about security then you shouldn't run
untrusted programs, whatever language they are written in.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305374.html</link>
</item><item>
<title>Re: [xsl] Can an XSLT document invoke arbitrary extension functions? - 10/26/2009 8:54:00 PM</title>
<description><![CDATA[<pre>At 2009-10-26 16:40 -0400, Costello, Roger L. wrote:
&gt;Below is an XSLT transform that - supposedly - opens a DOS command 
&gt;prompt. I saw the XSLT transform in this [1] briefing (slide 132). I 
&gt;ran it. It doesn't work; it just produces an error.

Right, because you haven't asked the XSLT processor if it supports 
the &quot;getRuntime()&quot; function in the given namespace.  If you try 
invoking a function that does not exist, the specification states it 
is an error:

   http://www.w3.org/TR/1999/REC-xslt-19991116#section-Extension-Functions
   &quot;If such an extension function occurs in an expression and the extension
    function is actually called, the XSLT processor must signal an error.&quot;

The way you check is with the function-available() function:

   http://www.w3.org/TR/1999/REC-xslt-19991116#function-function-available

&gt;1. Should the below XSLT Transform work? (i.e. is there simply a 
&gt;minor bug in it, that when fixed, would make it operate as desired?)

The semantics of extension functions are up to the definition and how 
it is supported by the processor.  It looks like a processor that 
supports what you have would work, but how many processors support it?

&gt;2. Is there any control over the set of extension functions provided 
&gt;by XSLT processors?

&quot;control&quot;?  An XSLT processor has a set of extension functions or it 
doesn't.  If the processor offers at invocation time the ability to 
turn on or off functions, then I suppose one could then &quot;control&quot; 
what extension functions are available in an environment invoked for 
arbitrary stylesheets.

&gt;3. How do you respond to the briefing's suggestions that XSLT is 
&gt;riddled with security leaks? (I realize this is a broad question; 
&gt;any thoughts you have would be appreciated)

There is *nothing* that I know of in the standard XSLT specification 
that gives an outside program control.  What any particular processor 
offers to stylesheets by way of extensions is up to the processor and 
is outside the definition of the specification.

So, I would say that XSLT has zero security issues but XSLT 
processors (like any other application) may have their own problems 
if they implement anything beyond the standard definition.

I think it is unfair to criticize the specification as unsafe when 
safe implementations of the specification can be written.  A 
processor is not required to support any extension at all.  I would 
think processor writers could offer a &quot;safe mode&quot; if this was a 
concern for their users.

I hope this helps.

. . . . . . . . . . Ken


--
Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
Interested in other classes?  http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305373.html</link>
</item><item>
<title>[xsl] Can an XSLT document invoke arbitrary extension functions? - 10/26/2009 8:41:00 PM</title>
<description><![CDATA[<pre>Hi Folks,

Below is an XSLT transform that - supposedly - opens a DOS command prompt. I saw the XSLT transform in this [1] briefing (slide 132). I ran it. It doesn't work; it just produces an error.

The briefing seems to suggest that XSLT is riddled with security leaks, as any XSLT transform can invoke pretty much any arbitrary function (apparently including, as the below XSLT transform shows, any arbitrary Windows function). 

Questions:

1. Should the below XSLT Transform work? (i.e. is there simply a minor bug in it, that when fixed, would make it operate as desired?)

2. Is there any control over the set of extension functions provided by XSLT processors?

3. How do you respond to the briefing's suggestions that XSLT is riddled with security leaks? (I realize this is a broad question; any thoughts you have would be appreciated)


&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
                xmlns:rt=&quot;http://xml.apache.org/xalan/java/java.lang.Runtime&quot;
                xmlns:ob=&quot;http://xml.apache.org/xalan/java/java.lang.Object&quot;
                extension-element-prefixes=&quot;rt ob&quot;
                version=&quot;1.0&quot;&gt;


    &lt;xsl:template match=&quot;/&quot;&gt;
        &lt;xsl:variable name=&quot;runTimeObject&quot; select=&quot;rt:getRuntime()&quot;/&gt;
        &lt;xsl:variable name=&quot;command&quot; 
           select=&quot;rt:exec($runTimeObject, &amp;apos;c:\Windows\system32\cmd.exe&amp;apos;)&quot;/&gt;
        &lt;xsl:variable name=&quot;commandAsString&quot; select=&quot;ob:toString($command)&quot;/&gt;
        &lt;xsl:value-of select=&quot;$commandAsString&quot;/&gt;
    &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;


/Roger


[1] https://www.isecpartners.com/files/iSEC_HILL_AttackingXMLSecurity_bh07.pdf
--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305372.html</link>
</item><item>
<title>Re: [xsl] FOP flow question - 10/26/2009 8:18:00 PM</title>
<description><![CDATA[<pre>At 2009-10-26 10:36 -0700, mark bordelon wrote:
&gt;I will eventually learn all this at a class I am taking with Ken, 
&gt;but need this working before then, unfortunately.

Yes, all of this is covered in the classroom.

Note to others:  there are still seats remaining for both the 
XSLT/XQuery class next week and the XSL-FO class the following week 
... please see here for details:

   http://www.CraneSoftwrights.com/index.html#Crane200910IAD

&gt;1) (region-bfore) I am getting errors about having two flow tags.

Indeed.  In XSL-FO 1.0 only one flow is allowed (any number are 
allowed in 1.1, but you only need one).

&gt;When I change the first to static-content, nothing appears at all in 
&gt;this region.

That surprises me.  From your stylesheet I would have expected the 
content to show, but to be in conflict with the body content on the page.

&gt;How can you put text into two regions of the same page-sequence?

You use multiple &lt;fo:static-content flow-name=&quot;&quot;&gt; elements, one for 
each of the perimeter regions you need content in, and then one 
&lt;fo:flow&gt; that triggers the pagination.

&gt;2) (region-after) The &quot;denominator&quot; of the page footer does not 
&gt;display. I have looked through the documentation and cannot figure 
&gt;what is wrong.

I'm unfamiliar with the use of &quot;denominator&quot; in publishing, and I 
don't see the word in your stylesheet fragment.

But I do note that your body-region doesn't have any margin to 
accommodate the after-region ... only the before and left margins are 
specified for the body-region.  Your body-region should have a bottom 
margin at least the size of the extent of the page's after-region.

An error is not generated in the case of the overlap of regions, 
because there are some strategies where the overlap is very useful, 
as illustrated in the free UN Layout Key stylesheets for UBL on our 
web site:  the background is painted with XSL-FO and the foreground 
is overlaid on top with more XSL-FO.

I hope this helps.

. . . . . . . . . . . Ken

&gt;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt;
&gt;&lt;xsl:stylesheet version=&quot;1.1&quot; 
&gt;xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; 
&gt;xmlns:fo=&quot;http://www.w3.org/1999/XSL/Format&quot; exclude-result-prefixes=&quot;fo&quot;&gt;
&gt;&lt;xsl:output method=&quot;xml&quot; version=&quot;1.0&quot; omit-xml-declaration=&quot;no&quot; 
&gt;indent=&quot;yes&quot;/&gt;&lt;xsl:strip-space elements=&quot;*&quot;/&gt;
&gt;
&gt;&lt;!--master template--&gt;
&gt;&lt;xsl:template match=&quot;TEAMS_ASSET_FILE&quot;&gt;
&gt;&lt;fo:root&gt;
&gt;&lt;fo:layout-master-set&gt;
&gt;&lt;fo:simple-page-master master-name=&quot;cover_letter&quot; page-width=&quot;8.5in&quot; 
&gt;page-height=&quot;11in&quot; margin-top=&quot;0.5in&quot; margin-bottom=&quot;.5in&quot; 
&gt;margin-left=&quot;0.5in&quot; margin-right=&quot;1in&quot;&gt;
&gt;         &lt;fo:region-body margin-left=&quot;0.50in&quot; margin-top=&quot;1.25in&quot; /&gt;
&gt;         &lt;fo:region-before extent=&quot;1in&quot;/&gt;
&gt;         &lt;fo:region-after extent=&quot;0.5in&quot;/&gt;
&gt;&lt;/fo:simple-page-master&gt;
&gt;&lt;/fo:layout-master-set&gt;
&gt;
&gt;&lt;fo:page-sequence master-reference=&quot;cover_letter&quot; force-page-count=&quot;no-force&quot;&gt;
&gt;
&gt;&lt;fo:flow flow-name=&quot;xsl-region-before&quot;&gt;
&gt;&lt;fo:table table-layout=&quot;fixed&quot;&gt;
&gt;&lt;/fo:table&gt;
&gt;&lt;/fo:flow&gt;
&gt;
&gt;&lt;fo:static-content flow-name=&quot;xsl-region-after&quot;&gt;
&gt;&lt;fo:block font-family=&quot;LinotypeSyntaxItalics&quot; font-size=&quot;8pt&quot; 
&gt;text-align=&quot;right&quot;&gt;
&gt;Page &lt;fo:page-number/&gt; of &lt;fo:page-number-citation ref-id=&quot;last-page&quot;/&gt;
&gt;&lt;/fo:block&gt;
&gt;&lt;/fo:static-content&gt;
&gt;
&gt;&lt;fo:flow flow-name=&quot;xsl-region-body&quot;&gt;
&gt;...content...
&gt;&lt;/fo:flow&gt;
&gt;
&gt;&lt;/fo:page-sequence&gt;
&gt;
&gt;&lt;/fo:root&gt;
&gt;&lt;/xsl:template&gt;
&gt;
&gt;&lt;/xsl:stylesheet&gt;


--
Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
Interested in other classes?  http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305371.html</link>
</item><item>
<title>Re: [xsl] &quot;Concatenate two element values as an attribute value&quot;. ( - 10/26/2009 6:27:00 PM</title>
<description><![CDATA[<pre>David Galligani wrote:

&gt;&gt;                            &lt;a 
&gt;&gt; href=&quot;{/webenmr/calculation/webinfo/@workingdir}/{@filename}&quot;&gt; ...
&gt;&gt;                                                        &lt;/a&gt;
&gt; and
&gt;&gt;   &lt;a
&gt;&gt; href=&quot;{ancestor::calculation/webinfo/@workingdir}/{@filename}&quot;&gt;...&lt;/a&gt;
&gt;&gt;   
&gt; 
&gt; Output a correct href , even in if there's a :
&gt; &lt;xsl:value-of select=&quot;@filename}&quot;/&gt;
&gt; between the two &lt;a&gt; and &lt;/a&gt; tags I get an empty page :)

The output of your XSLT stylesheet should be an HTML document and HTML 
documents, at least when rendered in the browser window, do not have 
pages. You only get pages or empty pages when you print an HTML 
document. Do you use any print stylesheet that could have CSS settings 
enforcing a page break?

How does the resulting HTML markup look exactly?

Generally when you develop an XSLT stylesheet to produce a HTML document 
I wouldn't start with rendering that result directly in the browser, 
rather I would look at the serialized transformation result in a file 
and inspect the HTML markup created in a editor or at least in console 
window.

-- 

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305366.html</link>
</item><item>
<title>[xsl] FOP flow question - 10/26/2009 5:37:00 PM</title>
<description><![CDATA[<pre>Dear Members,

After a break from fop frustration, I have reduced my fop transform to the simplest as I build it up, studying from ww3schools ftp xslt tutorial. Unfortuantely, even here I am having mixed success that someone here might be able to help with. I will eventually learn all this at a class I am taking with Ken, but need this working before then, unfortunately. Any help much appreciated!

1) (region-bfore) I am getting errors about having two flow tags. When I change the first to static-content, nothing appears at all in this region.
How can you put text into two regions of the same page-sequence?

2) (region-after) The &quot;denominator&quot; of the page footer does not display. I have looked through the documentation and cannot figure what is wrong.

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;

&lt;xsl:stylesheet version=&quot;1.1&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; xmlns:fo=&quot;http://www.w3.org/1999/XSL/Format&quot; exclude-result-prefixes=&quot;fo&quot;&gt;
&lt;xsl:output method=&quot;xml&quot; version=&quot;1.0&quot; omit-xml-declaration=&quot;no&quot; indent=&quot;yes&quot;/&gt;&lt;xsl:strip-space elements=&quot;*&quot;/&gt;

&lt;!--master template--&gt;
&lt;xsl:template match=&quot;TEAMS_ASSET_FILE&quot;&gt;
&lt;fo:root&gt;
&lt;fo:layout-master-set&gt;
&lt;fo:simple-page-master master-name=&quot;cover_letter&quot; page-width=&quot;8.5in&quot; page-height=&quot;11in&quot; margin-top=&quot;0.5in&quot; margin-bottom=&quot;.5in&quot; margin-left=&quot;0.5in&quot; margin-right=&quot;1in&quot;&gt;
	&lt;fo:region-body margin-left=&quot;0.50in&quot; margin-top=&quot;1.25in&quot; /&gt;
	&lt;fo:region-before extent=&quot;1in&quot;/&gt;
	&lt;fo:region-after extent=&quot;0.5in&quot;/&gt;
&lt;/fo:simple-page-master&gt;
&lt;/fo:layout-master-set&gt;
			
&lt;fo:page-sequence master-reference=&quot;cover_letter&quot; force-page-count=&quot;no-force&quot;&gt;
						
&lt;fo:flow flow-name=&quot;xsl-region-before&quot;&gt; 
&lt;fo:table table-layout=&quot;fixed&quot;&gt;
&lt;/fo:table&gt;
&lt;/fo:flow&gt;
				
&lt;fo:static-content flow-name=&quot;xsl-region-after&quot;&gt;
&lt;fo:block font-family=&quot;LinotypeSyntaxItalics&quot; font-size=&quot;8pt&quot; text-align=&quot;right&quot;&gt;
Page &lt;fo:page-number/&gt; of &lt;fo:page-number-citation ref-id=&quot;last-page&quot;/&gt;
&lt;/fo:block&gt;
&lt;/fo:static-content&gt;

&lt;fo:flow flow-name=&quot;xsl-region-body&quot;&gt;
...content...
&lt;/fo:flow&gt;

&lt;/fo:page-sequence&gt;

&lt;/fo:root&gt;
&lt;/xsl:template&gt;
	
&lt;/xsl:stylesheet&gt;


      

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305363.html</link>
</item><item>
<title>RE: [xsl] &quot;Concatenate two element values as an attribute value&quot;. ( - 10/26/2009 2:27:00 PM</title>
<description><![CDATA[<pre>&gt; Michael , surely you'r right ... I've been told to learn 
&gt; xml/xsl and to complete a job in a week , so It's not easy a 
&gt; task  , and probably I missed a lot of concept ...

You should have refused the task. Very few people are capable of learning a
new language under such time pressure. I certainly wouldn't attempt it.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305355.html</link>
</item><item>
<title>[xsl] &quot;Concatenate two element values as an attribute value&quot;. ( was - 10/26/2009 2:02:00 PM</title>
<description><![CDATA[<pre>First of all many thx to everybody ...
I apologize if I posted a non-correct mail to the list .
With your hints , it &quot;almost&quot; works :)

&gt;
&gt;                            &lt;a 
&gt; href=&quot;{/webenmr/calculation/webinfo/@workingdir}/{@filename}&quot;&gt; ...
&gt;                             
&gt;                            &lt;/a&gt;
and
&gt;   &lt;a
&gt; href=&quot;{ancestor::calculation/webinfo/@workingdir}/{@filename}&quot;&gt;...&lt;/a&gt;
&gt;   

Output a correct href , even in if there's a :
&lt;xsl:value-of select=&quot;@filename}&quot;/&gt;
between the two &lt;a&gt; and &lt;/a&gt; tags I get an empty page :)
&gt; I think you're having problems because you haven't understood the concept of
&gt; the context node/item, or the details of when and how it changes.

Michael , surely you'r right ... I've been told to learn xml/xsl and to 
complete a job in a week ,
so It's not easy a task  , and probably I missed a lot of concept ...


Thx again

D.



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305354.html</link>
</item><item>
<title>Re: [xsl] Variables - 10/26/2009 11:54:00 AM</title>
<description><![CDATA[<pre>You will improve the chances that you will receive prompt and helpful 
responses on XSL-List by:

   - asking specific enough questions that answers are possible. Describe
     what you are trying to do, how you approached it, what happened, and
     why you don't like the result you got

     In your case, select one question (you mention &quot;several problems&quot;)
     and focus on it. Ask any other questions separately.

   - supplying small samples of files that illustrate your question or
     problem. For example, an XML file, an XSLT stylesheet, the result
     you got, and the result you want - all in miniature (and remembering
     that everything posted to XSL-List is archived in public)

     Create the smallest possible XML document and smallest possible
     XSLT that shows how you are trying to create the hyperlink. Leave
     out anything that is not related to this small issue.

   - describing the topic of your question concisely in the subject line
     Good subject lines - those that describe the subject matter of your
     message - not only increase the chances that you will receive answers
     to questions or responses to comments, they also make your message
     and any replies to it accessible in the list archives.

     In this case, you might want to describe your question as:
     &quot;Concatenate two element values as an attribute value&quot;.


Instructions on subscribing to XSL-List are available at 
http://www.mulberrytech.com/xsl/xsl-list/index.html
and the XSL-List archives are at 
http://www.biglist.com/lists/xsl-list/archives/

-- Tommie



&gt;Hi all ,
&gt;I' m a complete newbie in xml/xsl , and I'm having several problems .
&gt;I have the following xml :
&gt;
&gt;&lt;webenmr&gt;
&gt;&lt;calculation&gt;
&gt;&lt;webinfo workingdir=&quot;x_10_2009&quot; /&gt;
&gt;&lt;protocol name=&quot;xplor&quot; type=&quot;pm&quot;&gt;
&gt;&lt;parameter init_t=&quot;2500&quot; high_step=&quot;10000&quot; cool_step=&quot;10000&quot;
&gt;end_count=&quot;5&quot; loop_count=&quot;3&quot; timestep=&quot;0.005&quot; n_thread=&quot;20&quot; /&gt;
&gt;&lt;structure&gt;
&gt;&lt;struct_file&gt;protein.psf&lt;/struct_file&gt;
&gt;&lt;struct_file&gt;CA2.psf&lt;/struct_file&gt;
&gt;&lt;struct_file&gt;axis_new_501.psf&lt;/struct_file&gt;
&gt;&lt;struct_file&gt;axis_new_502.psf&lt;/struct_file&gt;
&gt;&lt;struct_file&gt;axis_new_503.psf&lt;/struct_file&gt;
&gt;&lt;/structure&gt;
&gt;&lt;parameter_md&gt;
&gt;&lt;param_file&gt;par_axis_3.pro&lt;/param_file&gt;
&gt;&lt;param_file&gt;ca.par&lt;/param_file&gt;
&gt;&lt;/parameter_md&gt;
&gt;&lt;coordinate&gt;
&gt;&lt;coord_file&gt;protein.pdb&lt;/coord_file&gt;
&gt;&lt;coord_file&gt;ca.pdb&lt;/coord_file&gt;
&gt;&lt;coord_file&gt;axis_xyzo_3_501.pdb&lt;/coord_file&gt;
&gt;&lt;coord_file&gt;axis_xyzo_3_502.pdb&lt;/coord_file&gt;
&gt;&lt;coord_file&gt;axis_xyzo_3_503.pdb&lt;/coord_file&gt;
&gt;&lt;/coordinate&gt;
&gt;&lt;noe&gt;
&gt;    &lt;cls name=&quot;tensor&quot; scale=&quot;1000&quot;&gt;
&gt;     &lt;noe_file&gt;tensors.tbl&lt;/noe_file&gt;
&gt;    &lt;/cls&gt;
&gt;    &lt;cls name=&quot;noe&quot; scale=&quot;50&quot;&gt;
&gt;     &lt;noe_file&gt;calbindin_NOE.tbl&lt;/noe_file&gt;
&gt;     &lt;noe_file&gt;metalcenter.tbl&lt;/noe_file&gt;
&gt;    &lt;/cls&gt;
&gt;   &lt;/noe&gt;
&gt;   &lt;dih&gt;
&gt;    &lt;dih_file&gt;calbindin_ACO.tbl&lt;/dih_file&gt;
&gt;   &lt;/dih&gt;
&gt;   &lt;xpcs xpcs_file=&quot;calbindin_PCS_ce.tbl&quot; xclass=&quot;pcsce&quot; t1=&quot;521.4&quot; 
&gt;t2=&quot;-175.5&quot; fmed=&quot;20&quot; scale=&quot;5.0&quot; /&gt;
&gt;   &lt;xpcs xpcs_file=&quot;calbindin_PCS_dy.tbl&quot; xclass=&quot;pcsdy&quot; t1=&quot;9041.9&quot; 
&gt;t2=&quot;-5601.7&quot; fmed=&quot;20&quot; scale=&quot;0.25&quot; /&gt;
&gt;   &lt;xpcs xpcs_file=&quot;calbindin_PCS_yb.tbl&quot; xclass=&quot;pcsyb&quot; t1=&quot;1978.7&quot; 
&gt;t2=&quot;-923.3&quot; fmed=&quot;20&quot; scale=&quot;1.25&quot; /&gt;
&gt;   &lt;xrdc xrdc_file=&quot;calbindin_RDC_ce.tbl&quot; xclass=&quot;rdcce&quot; t1=&quot;-0.424&quot; 
&gt;t2=&quot;0.143&quot; fmed=&quot;20&quot; scale=&quot;1.0&quot; /&gt;
&gt;   &lt;xrdc xrdc_file=&quot;calbindin_RDC_dy.tbl&quot; xclass=&quot;rdcdy&quot; t1=&quot;-7.348&quot; 
&gt;t2=&quot;4.552&quot; fmed=&quot;20&quot; scale=&quot;0.05&quot; /&gt;
&gt;   &lt;xrdc xrdc_file=&quot;calbindin_RDC_yb.tbl&quot; xclass=&quot;rdcyb&quot; t1=&quot;-1.608&quot; 
&gt;t2=&quot;0.750&quot; fmed=&quot;20&quot; scale=&quot;0.25&quot; /&gt;
&gt;   &lt;metal_parameter type=&quot;xml&quot;&gt;
&gt;    &lt;convert type=&quot;xplor,amber&quot; /&gt;
&gt;    &lt;type_name name=&quot;M1&quot; element=&quot;Ca&quot; mass=&quot;40.080&quot; eps=&quot;0.05&quot; /&gt;
&gt;   &lt;/metal_parameter&gt;
&gt;   &lt;metal_topology type=&quot;xml&quot;&gt;
&gt;    &lt;res name=&quot;XM1&quot;&gt;
&gt;     &lt;atom_name name=&quot;CA2&quot; type_name=&quot;M1&quot; charge=&quot;2.0&quot; num=&quot;1&quot; /&gt;
&gt;    &lt;/res&gt;
&gt;   &lt;/metal_topology&gt;
&gt;   &lt;analysis comp_sel=&quot;name CA&quot; top_frac=&quot;0.2&quot; /&gt;
&gt;  &lt;/protocol&gt;
&gt;  &lt;output name=&quot;xplor&quot;&gt;
&gt;   &lt;iteration number=&quot;1&quot;&gt;
&gt;    &lt;pdb_info directory=&quot;./input_9/&quot;
&gt;filename=&quot;ite_1_d_input_9_pdb_sa1_1.pdb&quot;&gt;
&gt;&lt;XPCS_tensor A1=&quot;554.334203883598&quot; energy_pcs=&quot;0.958539032156901&quot;
&gt;A2=&quot;-166.871736148801&quot; class=&quot;pcsce&quot;
&gt;total_energy=&quot;89.1003471455398&quot; /&gt;
&gt;&lt;/pdb_info&gt;
&gt;&lt;pdb_info directory=&quot;./input_9/&quot;
&gt;filename=&quot;ite_1_d_input_9_pdb_sa1_2.pdb&quot;&gt;
&gt;&lt;XPCS_tensor A1=&quot;541.035035882894&quot; energy_pcs=&quot;1.39407060526426&quot;
&gt;A2=&quot;-159.967740084884&quot; class=&quot;pcsce&quot;
&gt;total_energy=&quot;188.041801829022&quot; /&gt;
&gt;&lt;/pdb_info&gt;
&gt;&lt;pdb_info directory=&quot;./input_9/&quot;
&gt;filename=&quot;ite_1_d_input_9_pdb_sa1_3.pdb&quot;&gt;
&gt;&lt;XPCS_tensor A1=&quot;535.219580534061&quot; energy_pcs=&quot;1.32367130882385&quot;
&gt;A2=&quot;-175.784774140119&quot; class=&quot;pcsce&quot;
&gt;total_energy=&quot;90.7929905009074&quot; /&gt;
&gt;&lt;/pdb_info&gt;
&gt;[...]
&gt;
&gt;and the xsl  ( which probably will be infested with errors :) ):
&gt;
&gt;&lt;?xml version=&quot;1.0&quot;?&gt;
&gt;&lt;xsl:stylesheet version=&quot;1.0&quot; 
&gt;xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt;
&gt;&lt;xsl:output method=&quot;html&quot; encoding=&quot;UTF-8&quot;/&gt;
&gt;
&gt;    &lt;xsl:template match=&quot;/&quot;&gt;
&gt;        &lt;html&gt;
&gt;&lt;head&gt;
&gt;&lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&gt;&lt;title&gt;ENMRWEBUI&lt;/title&gt;
&gt;
&gt;
&gt;&lt;!--&lt;link xmlns=&quot;http://www.w3.org/1999/xhtml&quot; type=&quot;text/css&quot; href=&quot;&quot; /&gt;--&gt;
&gt;
&gt;&lt;!--&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;print&quot; 
&gt;href=&quot;css/enmrwebui.css&quot; /&gt;--&gt;
&gt;&lt;/head&gt;&lt;body&gt;
&gt;        &lt;!--&lt;xsl:if test=&quot;@name='xplor'&quot;&gt;--&gt;
&gt;            &lt;xsl:if test=&quot;webenmr/calculation&quot;&gt;
&gt;                &lt;xsl:if test=&quot;webinfo&quot;&gt;
&gt;                &lt;xsl:value-of select=&quot;@workingdir&quot;/&gt;
&gt;                &lt;/xsl:if&gt;
&gt;                 &lt;xsl:if test=&quot;webenmr/calculation/output/iteration&quot;&gt;
&gt;                    &lt;table id=&quot;outputTable&quot;&gt;
&gt;                     &lt;xsl:for-each 
&gt;select=&quot;webenmr/calculation/output/iteration&quot;&gt;
&gt;                        &lt;tr&gt;&lt;th&gt;Iteration
&gt;                            &lt;/th&gt;
&gt;                     
&gt;                            &lt;td&gt;
&gt;                                &lt;xsl:value-of select=&quot;@number&quot;/&gt;
&gt;                          
&gt;                            &lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;
&gt;
&gt;                         &lt;/tr&gt;
&gt;            
&gt;                        &lt;xsl:for-each select=&quot;pdb_info&quot;&gt;
&gt;                             &lt;tr&gt;
&gt;                                &lt;th&gt;File&lt;/th&gt;
&gt;                                &lt;td&gt;&lt;a href=&quot;file_pdb/&quot;&gt;
&gt;                                  
&gt;                                    &lt;xsl:value-of select=&quot;@filename&quot;/&gt;
&gt;                                    &lt;/a&gt;
&gt;                                &lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;
&gt;                             &lt;/tr&gt;
&gt;                          
&gt;                                        &lt;xsl:if test=&quot;XPCS_tensor&quot;&gt;
&gt;                                &lt;tr&gt;
&gt;                                    &lt;th&gt;XPCS Tensor A1 
&gt;&lt;/th&gt;&lt;th&gt;Energy PCS&lt;/th&gt;&lt;th&gt;A2&lt;/th&gt;&lt;th&gt;Class&lt;/th&gt;&lt;th&gt;Total 
&gt;Energy&lt;/th&gt;
&gt;                                &lt;/tr&gt;
&gt;                              
&gt;                                &lt;xsl:for-each select=&quot;XPCS_tensor&quot;&gt;
&gt;                                  
&gt;                                &lt;tr&gt;
&gt;                                    &lt;td&gt;&lt;xsl:value-of select=&quot;@A1&quot;/&gt; &lt;/td&gt;
&gt;                              
&gt;                                    &lt;td&gt; &lt;xsl:value-of 
&gt;select=&quot;@energy_pcs&quot;/&gt;&lt;/td&gt;
&gt;                             
&gt;                                    &lt;td&gt;&lt;xsl:value-of select=&quot;@A2&quot;/&gt; &lt;/td&gt;
&gt;                             
&gt;                                    &lt;td&gt;&lt;xsl:value-of select=&quot;@class&quot;/&gt;&lt;/td&gt;
&gt;                              
&gt;                                    &lt;td&gt; &lt;xsl:value-of 
&gt;select=&quot;@total_energy&quot;/&gt;&lt;/td&gt;
&gt;                                &lt;/tr&gt;  
&gt;                                &lt;/xsl:for-each&gt;
&gt;                                &lt;/xsl:if&gt;
&gt;                               [...]
&gt;
&gt;I want to concatenate the &quot;workingdir&quot; and &quot;filename&quot; values in an 
&gt;hyperlink , something like &lt;a href='workingdir/filename'&gt;File&lt;/a&gt;
&gt;but atm nothing seems to work .
&gt;I'm sure it' s a silly thing , but I have already lost 2 days trying 
&gt;to achieve it , and I was wondering if someone could help me .
&gt;Many thx in advance .
&gt;
&gt;David
&gt;
&gt;P.S.: I hope you can understand my english ...
&gt;
&gt;
&gt;--~------------------------------------------------------------------
&gt;XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt;To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt;or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt;--~--


-- 

======================================================================
B. Tommie Usdin                        mailto:btusdin@mulberrytech.com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                           Phone: 301/315-9631
Suite 207                                    Direct Line: 301/315-9634
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
   Mulberry Technologies: A Consultancy Specializing in XML and SGML
======================================================================

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305346.html</link>
</item><item>
<title>Re: [xsl] Variables - 10/26/2009 11:49:00 AM</title>
<description><![CDATA[<pre>David Galligani wrote:

&gt; &lt;webenmr&gt;
&gt; &lt;calculation&gt;
&gt; &lt;webinfo workingdir=&quot;x_10_2009&quot; /&gt;

&gt;  &lt;output name=&quot;xplor&quot;&gt;
&gt;   &lt;iteration number=&quot;1&quot;&gt;
&gt;    &lt;pdb_info directory=&quot;./input_9/&quot;
&gt; filename=&quot;ite_1_d_input_9_pdb_sa1_1.pdb&quot;&gt;

&gt;                                    &lt;xsl:for-each select=&quot;pdb_info&quot;&gt;
&gt;                             &lt;tr&gt;
&gt;                                &lt;th&gt;File&lt;/th&gt;
&gt;                                &lt;td&gt;&lt;a href=&quot;file_pdb/&quot;&gt;
&gt;                                                                      
&gt; &lt;xsl:value-of select=&quot;@filename&quot;/&gt;

&gt; I want to concatenate the &quot;workingdir&quot; and &quot;filename&quot; values in an 
&gt; hyperlink , something like &lt;a href='workingdir/filename'&gt;File&lt;/a&gt;
&gt; but atm nothing seems to work .

Does
                            &lt;a 
href=&quot;{/webenmr/calculation/webinfo/@workingdir}/{@filename}&quot;&gt;
                              &lt;xsl:value-of select=&quot;@filename}&quot;/&gt;
                            &lt;/a&gt;

give you what you want?

-- 

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305345.html</link>
</item><item>
<title>RE: [xsl] Variables - 10/26/2009 11:47:00 AM</title>
<description><![CDATA[<pre>Firstly, xsl:if doesn't change the context node, so this

    &lt;xsl:if test=&quot;webenmr/calculation&quot;&gt;
        &lt;xsl:if test=&quot;webinfo&quot;&gt;
            &lt;xsl:value-of select=&quot;@workingdir&quot;/&gt;

should probably be something like this:

    &lt;xsl:if test=&quot;webenmr/calculation&quot;&gt;
        &lt;xsl:if test=&quot;webemr/calculation/webinfo&quot;&gt;
            &lt;xsl:value-of select=&quot;webemr/calculation/webinfo/@workingdir&quot;/&gt;

Assuming the context node is a pdb_info, you can output your hyperlink like
this:

    &lt;a
href=&quot;{ancestor::calculation/webinfo/@workingdir}/{@filename}&quot;&gt;...&lt;/a&gt;

I think you're having problems because you haven't understood the concept of
the context node/item, or the details of when and how it changes. Also: try
to take advantage of apply-templates and template rules, rather than
wrapping everying in deeply-nested for-each loops.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 

 

&gt; -----Original Message-----
&gt; From: David Galligani [mailto:galligani@cerm.unifi.it] 
&gt; Sent: 26 October 2009 11:29
&gt; To: xsl-list@lists.mulberrytech.com
&gt; Subject: [xsl] Variables 
&gt; 
&gt; Hi all ,
&gt; I' m a complete newbie in xml/xsl , and I'm having several problems .
&gt; I have the following xml :
&gt; 
&gt; &lt;webenmr&gt;
&gt; &lt;calculation&gt;
&gt; &lt;webinfo workingdir=&quot;x_10_2009&quot; /&gt;
&gt; &lt;protocol name=&quot;xplor&quot; type=&quot;pm&quot;&gt;
&gt; &lt;parameter init_t=&quot;2500&quot; high_step=&quot;10000&quot; cool_step=&quot;10000&quot;
&gt; end_count=&quot;5&quot; loop_count=&quot;3&quot; timestep=&quot;0.005&quot; n_thread=&quot;20&quot; 
&gt; /&gt; &lt;structure&gt; &lt;struct_file&gt;protein.psf&lt;/struct_file&gt;
&gt; &lt;struct_file&gt;CA2.psf&lt;/struct_file&gt;
&gt; &lt;struct_file&gt;axis_new_501.psf&lt;/struct_file&gt;
&gt; &lt;struct_file&gt;axis_new_502.psf&lt;/struct_file&gt;
&gt; &lt;struct_file&gt;axis_new_503.psf&lt;/struct_file&gt;
&gt; &lt;/structure&gt;
&gt; &lt;parameter_md&gt;
&gt; &lt;param_file&gt;par_axis_3.pro&lt;/param_file&gt;
&gt; &lt;param_file&gt;ca.par&lt;/param_file&gt;
&gt; &lt;/parameter_md&gt;
&gt; &lt;coordinate&gt;
&gt; &lt;coord_file&gt;protein.pdb&lt;/coord_file&gt;
&gt; &lt;coord_file&gt;ca.pdb&lt;/coord_file&gt;
&gt; &lt;coord_file&gt;axis_xyzo_3_501.pdb&lt;/coord_file&gt;
&gt; &lt;coord_file&gt;axis_xyzo_3_502.pdb&lt;/coord_file&gt;
&gt; &lt;coord_file&gt;axis_xyzo_3_503.pdb&lt;/coord_file&gt;
&gt; &lt;/coordinate&gt;
&gt; &lt;noe&gt;
&gt;     &lt;cls name=&quot;tensor&quot; scale=&quot;1000&quot;&gt;
&gt;      &lt;noe_file&gt;tensors.tbl&lt;/noe_file&gt;
&gt;     &lt;/cls&gt;
&gt;     &lt;cls name=&quot;noe&quot; scale=&quot;50&quot;&gt;
&gt;      &lt;noe_file&gt;calbindin_NOE.tbl&lt;/noe_file&gt;
&gt;      &lt;noe_file&gt;metalcenter.tbl&lt;/noe_file&gt;
&gt;     &lt;/cls&gt;
&gt;    &lt;/noe&gt;
&gt;    &lt;dih&gt;
&gt;     &lt;dih_file&gt;calbindin_ACO.tbl&lt;/dih_file&gt;
&gt;    &lt;/dih&gt;
&gt;    &lt;xpcs xpcs_file=&quot;calbindin_PCS_ce.tbl&quot; xclass=&quot;pcsce&quot; t1=&quot;521.4&quot; 
&gt; t2=&quot;-175.5&quot; fmed=&quot;20&quot; scale=&quot;5.0&quot; /&gt;
&gt;    &lt;xpcs xpcs_file=&quot;calbindin_PCS_dy.tbl&quot; xclass=&quot;pcsdy&quot; t1=&quot;9041.9&quot; 
&gt; t2=&quot;-5601.7&quot; fmed=&quot;20&quot; scale=&quot;0.25&quot; /&gt;
&gt;    &lt;xpcs xpcs_file=&quot;calbindin_PCS_yb.tbl&quot; xclass=&quot;pcsyb&quot; t1=&quot;1978.7&quot; 
&gt; t2=&quot;-923.3&quot; fmed=&quot;20&quot; scale=&quot;1.25&quot; /&gt;
&gt;    &lt;xrdc xrdc_file=&quot;calbindin_RDC_ce.tbl&quot; xclass=&quot;rdcce&quot; t1=&quot;-0.424&quot; 
&gt; t2=&quot;0.143&quot; fmed=&quot;20&quot; scale=&quot;1.0&quot; /&gt;
&gt;    &lt;xrdc xrdc_file=&quot;calbindin_RDC_dy.tbl&quot; xclass=&quot;rdcdy&quot; t1=&quot;-7.348&quot; 
&gt; t2=&quot;4.552&quot; fmed=&quot;20&quot; scale=&quot;0.05&quot; /&gt;
&gt;    &lt;xrdc xrdc_file=&quot;calbindin_RDC_yb.tbl&quot; xclass=&quot;rdcyb&quot; t1=&quot;-1.608&quot; 
&gt; t2=&quot;0.750&quot; fmed=&quot;20&quot; scale=&quot;0.25&quot; /&gt;
&gt;    &lt;metal_parameter type=&quot;xml&quot;&gt;
&gt;     &lt;convert type=&quot;xplor,amber&quot; /&gt;
&gt;     &lt;type_name name=&quot;M1&quot; element=&quot;Ca&quot; mass=&quot;40.080&quot; eps=&quot;0.05&quot; /&gt;
&gt;    &lt;/metal_parameter&gt;
&gt;    &lt;metal_topology type=&quot;xml&quot;&gt;
&gt;     &lt;res name=&quot;XM1&quot;&gt;
&gt;      &lt;atom_name name=&quot;CA2&quot; type_name=&quot;M1&quot; charge=&quot;2.0&quot; num=&quot;1&quot; /&gt;
&gt;     &lt;/res&gt;
&gt;    &lt;/metal_topology&gt;
&gt;    &lt;analysis comp_sel=&quot;name CA&quot; top_frac=&quot;0.2&quot; /&gt;
&gt;   &lt;/protocol&gt;
&gt;   &lt;output name=&quot;xplor&quot;&gt;
&gt;    &lt;iteration number=&quot;1&quot;&gt;
&gt;     &lt;pdb_info directory=&quot;./input_9/&quot;
&gt; filename=&quot;ite_1_d_input_9_pdb_sa1_1.pdb&quot;&gt;
&gt; &lt;XPCS_tensor A1=&quot;554.334203883598&quot; energy_pcs=&quot;0.958539032156901&quot;
&gt; A2=&quot;-166.871736148801&quot; class=&quot;pcsce&quot;
&gt; total_energy=&quot;89.1003471455398&quot; /&gt;
&gt; &lt;/pdb_info&gt;
&gt; &lt;pdb_info directory=&quot;./input_9/&quot;
&gt; filename=&quot;ite_1_d_input_9_pdb_sa1_2.pdb&quot;&gt;
&gt; &lt;XPCS_tensor A1=&quot;541.035035882894&quot; energy_pcs=&quot;1.39407060526426&quot;
&gt; A2=&quot;-159.967740084884&quot; class=&quot;pcsce&quot;
&gt; total_energy=&quot;188.041801829022&quot; /&gt;
&gt; &lt;/pdb_info&gt;
&gt; &lt;pdb_info directory=&quot;./input_9/&quot;
&gt; filename=&quot;ite_1_d_input_9_pdb_sa1_3.pdb&quot;&gt;
&gt; &lt;XPCS_tensor A1=&quot;535.219580534061&quot; energy_pcs=&quot;1.32367130882385&quot;
&gt; A2=&quot;-175.784774140119&quot; class=&quot;pcsce&quot;
&gt; total_energy=&quot;90.7929905009074&quot; /&gt;
&gt; &lt;/pdb_info&gt;
&gt; [...]
&gt; 
&gt; and the xsl  ( which probably will be infested with errors :) ):
&gt; 
&gt; &lt;?xml version=&quot;1.0&quot;?&gt;
&gt; &lt;xsl:stylesheet version=&quot;1.0&quot; 
&gt; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt;
&gt; &lt;xsl:output method=&quot;html&quot; encoding=&quot;UTF-8&quot;/&gt;
&gt; 
&gt;     &lt;xsl:template match=&quot;/&quot;&gt;
&gt;         &lt;html&gt;
&gt; &lt;head&gt;
&gt; &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; 
&gt; charset=utf-8&quot; /&gt; &lt;title&gt;ENMRWEBUI&lt;/title&gt;
&gt; 
&gt; 
&gt; &lt;!--&lt;link xmlns=&quot;http://www.w3.org/1999/xhtml&quot; 
&gt; type=&quot;text/css&quot; href=&quot;&quot; /&gt;--&gt;
&gt; 
&gt; &lt;!--&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;print&quot; 
&gt; href=&quot;css/enmrwebui.css&quot; /&gt;--&gt;
&gt; &lt;/head&gt;&lt;body&gt;
&gt;         &lt;!--&lt;xsl:if test=&quot;@name='xplor'&quot;&gt;--&gt;
&gt;             &lt;xsl:if test=&quot;webenmr/calculation&quot;&gt;
&gt;                 &lt;xsl:if test=&quot;webinfo&quot;&gt;
&gt;                 &lt;xsl:value-of select=&quot;@workingdir&quot;/&gt;
&gt;                 &lt;/xsl:if&gt;
&gt;                  &lt;xsl:if test=&quot;webenmr/calculation/output/iteration&quot;&gt;
&gt;                     &lt;table id=&quot;outputTable&quot;&gt;
&gt;                      &lt;xsl:for-each
&gt; select=&quot;webenmr/calculation/output/iteration&quot;&gt;
&gt;                         &lt;tr&gt;&lt;th&gt;Iteration
&gt;                             &lt;/th&gt;
&gt;                       
&gt;                             &lt;td&gt;
&gt;                                 &lt;xsl:value-of select=&quot;@number&quot;/&gt;
&gt;                            
&gt;                             &lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;
&gt; 
&gt;                          &lt;/tr&gt;
&gt;              
&gt;                         &lt;xsl:for-each select=&quot;pdb_info&quot;&gt;
&gt;                              &lt;tr&gt;
&gt;                                 &lt;th&gt;File&lt;/th&gt;
&gt;                                 &lt;td&gt;&lt;a href=&quot;file_pdb/&quot;&gt;
&gt;                                    
&gt;                                     &lt;xsl:value-of select=&quot;@filename&quot;/&gt;
&gt;                                     &lt;/a&gt;
&gt;                                 &lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;
&gt;                              &lt;/tr&gt;
&gt;                            
&gt;                                         &lt;xsl:if test=&quot;XPCS_tensor&quot;&gt;
&gt;                                 &lt;tr&gt;
&gt;                                     &lt;th&gt;XPCS Tensor A1 
&gt; &lt;/th&gt;&lt;th&gt;Energy PCS&lt;/th&gt;&lt;th&gt;A2&lt;/th&gt;&lt;th&gt;Class&lt;/th&gt;&lt;th&gt;Total Energy&lt;/th&gt;
&gt;                                 &lt;/tr&gt;
&gt;                                
&gt;                                 &lt;xsl:for-each select=&quot;XPCS_tensor&quot;&gt;
&gt;                                    
&gt;                                 &lt;tr&gt;
&gt;                                     &lt;td&gt;&lt;xsl:value-of 
&gt; select=&quot;@A1&quot;/&gt; &lt;/td&gt;
&gt;                                
&gt;                                     &lt;td&gt; &lt;xsl:value-of 
&gt; select=&quot;@energy_pcs&quot;/&gt;&lt;/td&gt;
&gt;                               
&gt;                                     &lt;td&gt;&lt;xsl:value-of 
&gt; select=&quot;@A2&quot;/&gt; &lt;/td&gt;
&gt;                               
&gt;                                     &lt;td&gt;&lt;xsl:value-of 
&gt; select=&quot;@class&quot;/&gt;&lt;/td&gt;
&gt;                                
&gt;                                     &lt;td&gt; &lt;xsl:value-of 
&gt; select=&quot;@total_energy&quot;/&gt;&lt;/td&gt;
&gt;                                 &lt;/tr&gt;   
&gt;                                 &lt;/xsl:for-each&gt;
&gt;                                 &lt;/xsl:if&gt;
&gt;                                [...]
&gt; 
&gt; I want to concatenate the &quot;workingdir&quot; and &quot;filename&quot; values 
&gt; in an hyperlink , something like &lt;a 
&gt; href='workingdir/filename'&gt;File&lt;/a&gt;
&gt; but atm nothing seems to work .
&gt; I'm sure it' s a silly thing , but I have already lost 2 days 
&gt; trying to achieve it , and I was wondering if someone could help me .
&gt; Many thx in advance .
&gt; 
&gt; David
&gt; 
&gt; P.S.: I hope you can understand my english ...
&gt; 
&gt; 
&gt; --~------------------------------------------------------------------
&gt; XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
&gt; To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
&gt; or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
&gt; --~--
&gt; 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: &lt;mailto:xsl-list-unsubscribe@lists.mulberrytech.com&gt;
--~--</pre>]]></description>
<link>http://www.altova.com/list/xsl-list/200910/msg1000305344.html</link>
</item><item>
<title>[xsl] Variables - 10/26/2009 11:27:00 AM</title>
<description><![CDATA[<pre>Hi all ,
I' m a complete newbie in xml/xsl , and I'm having several problems .
I have the following xml :

&lt;webenmr&gt;
&lt;calculation&gt;
&lt;webinfo workingdir=&quot;x_10_2009&quot; /&gt;
&lt;protocol name=&quot;xplor&quot; type=&quot;pm&quot;&gt;
&lt;parameter init_t=&quot;2500&quot; high_step=&quot;10000&quot; cool_step=&quot;10000&quot;
end_count=&quot;5&quot; loop_count=&quot;3&quot; timestep=&quot;0.005&quot; n_thread=&quot;20&quot; /&gt;
&lt;structure&gt;
&lt;struct_file&gt;protein.psf&lt;/struct_file&gt;
&lt;struct_file&gt;CA2.psf&lt;/struct_file&gt;
&lt;struct_file&gt;axis_new_501.psf&lt;/struct_file&gt;
&lt;struct_file&gt;axis_new_502.psf&lt;/struct_file&gt;
&lt;struct_file&gt;axis_new_503.psf&lt;/struct_file&gt;
&lt;/structure&gt;
&lt;parameter_md&gt;
&lt;param_file&gt;par_axis_3.pro&lt;/param_file&gt;
&lt;param_file&gt;ca.par&lt;/param_file&gt;
&lt;/parameter_md&gt;
&lt;coordinate&gt;
&lt;coord_file&gt;protein.pdb&lt;/coord_file&gt;
&lt;coord_file&gt;ca.pdb&lt;/coord_file&gt;
&lt;coord_file&gt;axis_xyzo_3_501.pdb&lt;/coord_file&gt;
&lt;coord_file&gt;axis_xyzo_3_502.pdb&lt;/coord_file&gt;
&lt;coord_file&gt;axis_xyzo_3_503.pdb&lt;/coord_file&gt;
&lt;/coordinate&gt;
&lt;noe&gt;
    &lt;cls name=&quot;tensor&quot; scale=&quot;1000&quot;&gt;
     &lt;noe_file&gt;tensors.tbl&lt;/noe_file&gt;
    &lt;/cls&gt;
    &lt;cls name=&quot;noe&quot; scale=&quot;50&quot;&gt;
     &lt;noe_file&gt;calbindin_NOE.tbl&lt;/noe_file&gt;
     &lt;noe_file&gt;metalcenter.tbl&lt;/noe_file&gt;
    &lt;/cls&gt;
   &lt;/noe&gt;
   &lt;dih&gt;
    &lt;dih_file&gt;calbindin_ACO.tbl&lt;/dih_file&gt;
   &lt;/dih&gt;
   &lt;xpcs xpcs_file=&quot;calbindin_PCS_ce.tbl&quot; xclass=&quot;pcsce&quot; t1=&quot;521.4&quot; 
t2=&quot;-175.5&quot; fmed=&quot;20&quot; scale=&quot;5.0&quot; /&gt;
   &lt;xpcs xpcs_file=&quot;calbindin_PCS_dy.tbl&quot; xclass=&quot;pcsdy&quot; t1=&quot;9041.9&quot; 
t2=&quot;-5601.7&quot; fmed=&quot;20&quot; scale=&quot;0.25&quot; /&gt;
   &lt;xpcs xpcs_file=&quot;calbindin_PCS_yb.tbl&quot; xclass=&quot;pcsyb&quot; t1=&quot;1978.7&quot; 
t2=&quot;-923.3&quot; fmed=&quot;20&quot; scale=&quot;1.25&quot; 