<?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>[xsl] File URI / EXPath / Saxon - 11/21/2009 12:24:00 AM</title>
<description><![CDATA[<pre>Hey list,

in my XSLT, I'm passing an absolute URI of the file which I want
EXPath to create for me as a parameter.

Using getRealPath() in Java gives backslashes on Windows, so I replace
them with forward ones and this is the value I pass:
file:///C:/Users/Martynas/WebRoot/odf2epub/build/web/epub/test.epub

But then running the stylesheet gives errors:

net.sf.saxon.trans.XPathException: Invalid URI:
file:///C:\Users\Martynas\WebRoot\odf2epub\build\web\epub\test.epub
        at org.expath.saxon.Zip.fileFromURI(Zip.java:261)
        at org.expath.saxon.Zip.analyseHref(Zip.java:239)
        at org.expath.saxon.Zip.zipFile(Zip.java:305)

And the file path is shown with backslashes again. Backslashes are not
allowed in URIs as far as I know, but the parameter value is without
them.
Any ideas on what's going wrong? I'm running Saxon on Windows.

Martynas

--~------------------------------------------------------------------
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/msg1000307217.html</link>
</item><item>
<title>RE: [xsl] How to include ' in the argument of &lt;translate&gt; function - 11/20/2009 11:48:00 PM</title>
<description><![CDATA[<pre>The least confusing way to do this is to use variables:

&lt;xsl:variable name=&quot;apos&quot;&gt;'&lt;/xsl:variable&gt;

then &lt;xsl:value-of select=&quot;translate($in, $apos, '')&quot;/&gt;

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay  

&gt; -----Original Message-----
&gt; From: Mak, Lucas Wing Kau [mailto:makw@mail.lib.msu.edu] 
&gt; Sent: 20 November 2009 21:46
&gt; To: xsl-list@lists.mulberrytech.com
&gt; Subject: [xsl] How to include ' in the argument of 
&gt; &lt;translate&gt; function
&gt; 
&gt; I am trying to replace the apostrophe (') with a space by the 
&gt; &lt;translate&gt; function but oXygen gave me an error message 
&gt; (&quot;unmatched quote in expression&quot;) when I put &amp;apos; in the 
&gt; second argument. How can I resolve that?
&gt; 
&gt; Thanks,
&gt; 
&gt; Lucas
&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/msg1000307215.html</link>
</item><item>
<title>Re: [xsl] How to include ' in the argument of &lt;translate&gt; function - 11/20/2009 9:53:00 PM</title>
<description><![CDATA[<pre>At 2009-11-20 16:46 -0500, Mak, Lucas Wing Kau wrote:
&gt;I am trying to replace the apostrophe (') with a space by the 
&gt;&lt;translate&gt; function but oXygen gave me an error message (&quot;unmatched 
&gt;quote in expression&quot;) when I put &amp;apos; in the second argument. How 
&gt;can I resolve that?

You aren't showing your current code for volunteers to analyze where 
you are going wrong.

You have to distinguish attribute delimiters from string delimiters.

For example, this should work just fine:

   select='translate($old,&quot;&amp;apos;&quot;,&quot;&quot;)'

... because I'm using single quotes as my attribute delimiter and 
double quotes for my string delimiters.  That choice of string 
delimiter allows me to embed an apostrophe in the string, which I do 
with the entity reference.

Remember that entity substitution happens long before the syntax 
analysis of the function call, so if you had:

   select=&quot;translate($old,'&amp;apos;','')&quot;

... then you would get an error because that is *no* different from:

   select=&quot;translate($old,''','')&quot;

I hope this helps.

. . . . . . . . . Ken


--
Vote for your XML training:   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/msg1000307210.html</link>
</item><item>
<title>[xsl] How to include ' in the argument of &lt;translate&gt; function - 11/20/2009 9:47:00 PM</title>
<description><![CDATA[<pre>I am trying to replace the apostrophe (') with a space by the &lt;translate&gt; function but oXygen gave me an error message (&quot;unmatched quote in expression&quot;) when I put &amp;apos; in the second argument. How can I resolve that?

Thanks,

Lucas

--~------------------------------------------------------------------
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/msg1000307209.html</link>
</item><item>
<title>Re: [xsl] XSLT for XSL-FO internal-destination - 11/20/2009 7:15:00 PM</title>
<description><![CDATA[<pre>David,

I'm still not quite clear about how to connect the id from the href to the id at the heading of each page. Just to clarify, here is a simplified stylesheet (test.xsl), XML table of contents page (text.xml), and two XHTML source files (file_one.htm and file_two.htm). I'm calling the text.xml file that points to the file_one.htm and file_two.htm source files.

For the purposes of this example, I've moved all the files into the same directory, but is the purpose of the translate function merely to remove special characters the directory path in order to create an id? If so, perhaps it's not necessary in this latest example:

--------------------
test.xsl
--------------------

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;xsl:stylesheet version=&quot;1.0&quot;
                xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
                xmlns:fo=&quot;http://www.w3.org/1999/XSL/Format&quot;&gt; 

&lt;xsl:template match=&quot;/&quot;&gt;
   &lt;fo:root&gt;
	  &lt;fo:layout-master-set&gt;

    &lt;!-- Simple Page Master for body --&gt;
    &lt;fo:simple-page-master
    	master-name=&quot;only&quot;
    	page-height=&quot;29.7cm&quot;
    	page-width=&quot;15cm&quot;
    	margin-top=&quot;1cm&quot;
    	margin-bottom=&quot;2cm&quot;
    	margin-left=&quot;1cm&quot;
    	margin-right=&quot;1cm&quot;&gt;
        	&lt;fo:region-body
        		   region-name=&quot;xsl-region-body&quot;
        		   margin=&quot;2cm&quot; /&gt;
        	&lt;fo:region-before
        		   region-name=&quot;xsl-region-before&quot;
        		   extent=&quot;3cm&quot;
        			display-align=&quot;before&quot; /&gt;
        	&lt;fo:region-after region-name=&quot;footer&quot; extent=&quot;0.5in&quot;/&gt;
        	&lt;fo:region-start
        			region-name=&quot;xsl-region-start&quot;
        			 extent=&quot;2cm&quot;/&gt;
        	&lt;fo:region-end
        			region-name=&quot;xsl-region-end&quot;
        			 extent=&quot;2cm&quot;/&gt;
    &lt;/fo:simple-page-master&gt;
    &lt;/fo:layout-master-set&gt;
            
    &lt;!-- Page sequence for body pages --&gt;
	&lt;fo:page-sequence master-reference=&quot;only&quot; format=&quot;1&quot;&gt;
    	     &lt;fo:static-content flow-name=&quot;footer&quot;&gt;
                &lt;fo:block text-align=&quot;center&quot;&gt;
                   &lt;fo:page-number/&gt;
                 &lt;/fo:block&gt;
            &lt;/fo:static-content&gt;
              &lt;fo:flow flow-name=&quot;xsl-region-body&quot;&gt;
                   &lt;fo:block&gt;
                        &lt;xsl:for-each select=&quot;//TocEntry&quot;&gt;
                         &lt;!--Added id here for each page --&gt;
                                      &lt;fo:block id=&quot;{@Link}&quot;/&gt;
                            &lt;xsl:for-each select=&quot;document(@Link)//body&quot;&gt;
                              &lt;xsl:apply-templates/&gt;
                            &lt;/xsl:for-each&gt;

                        &lt;/xsl:for-each&gt;
                         &lt;fo:inline keep-together.within-line=&quot;always&quot;/&gt;
                   &lt;/fo:block&gt;
              &lt;/fo:flow&gt;
   &lt;/fo:page-sequence&gt;
&lt;/fo:root&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match=&quot;p|P&quot;&gt;
    &lt;fo:block  
      font-family=&quot;Arial&quot;
      font-size=&quot;10pt&quot;
      space-before=&quot;12pt&quot;
      space-after=&quot;12pt&quot;
      text-align=&quot;justify&quot;&gt;
		 &lt;xsl:apply-templates/&gt;
    &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match=&quot;a|A&quot;&gt;
   &lt;fo:inline&gt;
      &lt;fo:basic-link color=&quot;blue&quot;&gt;
              &lt;xsl:attribute name=&quot;internal-destination&quot;&gt;
                 &lt;xsl:value-of select=&quot;translate(@href,':/','')&quot;/&gt;
                  &lt;xsl:apply-templates /&gt;
              &lt;/xsl:attribute&gt;
              &lt;xsl:apply-templates/&gt;
      &lt;/fo:basic-link&gt;
    &lt;/fo:inline&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;

--------------------
test.xml (acts as a table of contents in online help)
--------------------
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;test.xsl&quot;?&gt;

&lt;Toc
  Version=&quot;1&quot;&gt;
    &lt;TocEntry
      Title=&quot;file_one.htm&quot;
      Link=&quot;file_one.htm&quot; /&gt;
    &lt;TocEntry
      Title=&quot;file_two.htm&quot;
      Link=&quot;file_two.htm&quot; /&gt;
&lt;/Toc&gt;

--------------------
file_one.htm
--------------------
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;html&gt;
    &lt;head&gt;
       &lt;title&gt; &lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;p&gt;Link example: &lt;a href=&quot;file_two.htm&quot;&gt;Link to file two. &lt;/a&gt; &lt;/p&gt;
    &lt;/body&gt;
&lt;/html&gt; 

--------------------
file_two.htm
--------------------
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;html&gt;
    &lt;head&gt;
       &lt;title&gt; &lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;p&gt;Text in file two. &lt;/p&gt;
    &lt;/body&gt;
&lt;/html&gt; 

Thanks,

Rob


--- On Fri, 11/20/09, David Carlisle &lt;davidc@nag.co.uk&gt; wrote:

&gt; From: David Carlisle &lt;davidc@nag.co.uk&gt;
&gt; Subject: Re: [xsl] XSLT for XSL-FO internal-destination
&gt; To: xsl-list@lists.mulberrytech.com
&gt; Cc: xsl-list@lists.mulberrytech.com
&gt; Date: Friday, November 20, 2009, 8:48 AM
&gt; 
&gt; 
&gt; well you're leaving me to guess a lot about your uinput
&gt; structure, but
&gt; I'd guess that 
&gt; 
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;
&gt; &#160;&#160;&#160;&lt;fo:block id=&quot;{@href}&quot;&gt;
&gt; 
&gt; &#160; &#160; &#160; &#160; &#160;&#160;&#160;
&gt; &#160;&#160;&#160; &#160;&#160;&#160; &lt;xsl:for-each
&gt; select=&quot;//TocEntry&quot;&gt;
&gt; &#160; &#160; &#160; &#160; &#160;&#160;&#160;
&gt; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;
&gt; &lt;xsl:for-each select=&quot;document(@Link)//body&quot;&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;
&gt; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;
&gt; &#160; &lt;xsl:apply-templates/&gt;
&gt; 
&gt; 
&gt; just puts in a single id (with possibly empty value) at the
&gt; top of teh
&gt; document
&gt; you want an id for each file inclusion so perhaps
&gt; 
&gt; 
&gt; 
&gt; 
&gt; &#160; &#160; &#160; &#160; &#160;&#160;&#160;
&gt; &#160;&#160;&#160; &#160;&#160;&#160; &lt;xsl:for-each
&gt; select=&quot;//TocEntry&quot;&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;
&gt; &#160; &#160; &#160; &lt;fo:block id=&quot;{@Link}&quot;/&gt;
&gt; &#160; &#160; &#160; &#160; &#160;&#160;&#160;
&gt; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;
&gt; &lt;xsl:for-each select=&quot;document(@Link)//body&quot;&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;
&gt; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;
&gt; &#160; &lt;xsl:apply-templates/&gt;
&gt; David
&gt; 
&gt; ________________________________________________________________________
&gt; The Numerical Algorithms Group Ltd is a company registered
&gt; in England
&gt; and Wales with company number 1249803. The registered
&gt; office is:
&gt; Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United
&gt; Kingdom.
&gt; 
&gt; This e-mail has been scanned for all viruses by Star. The
&gt; service is
&gt; powered by MessageLabs. 
&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/200911/msg1000307205.html</link>
</item><item>
<title>Re: [xsl] Decoding %-escaped chars in URI - 11/20/2009 5:58:00 PM</title>
<description><![CDATA[<pre>James A. Robinson wrote:

&gt; At when point when I was playing around with making a useful
&gt; library for URI manipulation per RFC 398, I put the following
&gt; together, don't know if it might be useful to the original
&gt; poster.

  Thanks.  If I am right, that does decode only unreserved chars.
But as the target of the decoded string is a human, I really want
to decode everything.  Actually I ended up with something very
similar (but simpler as it decodes everything encoded).

  Thanks!

-- 
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/msg1000307196.html</link>
</item><item>
<title>Re: [xsl] Decoding %-escaped chars in URI - 11/20/2009 5:52:00 PM</title>
<description><![CDATA[<pre>&gt; As a matter of interest, what's the use case?
&gt; 
&gt; I think the only reasons it's not there are (a) absence of a use case, and
&gt; (b) difficulty in the detail of specifying it: what do you do for example
&gt; with percent signs that aren't followed by two hex digits.

I think people I've talked to about this generally have in mind the equiv
of perl's URI::Escape, with the ability to either encode or decode ASCII.
Additional functionality, e.g., taking a Unicode character above the
128 range and turning it into encoded UTF-8 would be icing on the cake.

Personally, I'd have loved some basic functionality to deal with URI
escaped data at the XSLT layer, we've had several cases where data was
being over-enthusiastically encoded, e.g., apache re-encoding something
that was already encoded and Tomcat only performing one level of decoding.

Naturally the correct fix is down at the level where the mistake is
being introduced, but having the *ability* to unencode it at the XSLT
layer would have been useful.

At when point when I was playing around with making a useful library
for URI manipulation per RFC 398, I put the following together, don't
know if it might be useful to the original poster.

...

  &lt;!-- Private function to decode percent-encoded unreserved characters  --&gt;
  &lt;xsl:function name=&quot;p:pct-decode-unreserved&quot; as=&quot;xs:string?&quot;&gt;
    &lt;xsl:param name=&quot;in&quot; as=&quot;xs:string&quot;/&gt;
    &lt;xsl:sequence select=&quot;p:pct-decode-unreserved($in, ())&quot;/&gt;
   &lt;/xsl:function&gt;
  &lt;xsl:function name=&quot;p:pct-decode-unreserved&quot; as=&quot;xs:string?&quot;&gt;
    &lt;xsl:param name=&quot;in&quot; as=&quot;xs:string&quot;/&gt;
    &lt;xsl:param name=&quot;seq&quot; as=&quot;xs:string*&quot;/&gt;

    &lt;xsl:variable name=&quot;unreserved&quot; as=&quot;xs:integer+&quot;
      select=&quot;(45, 46, 48 to 57, 65 to 90, 95, 97 to 122, 126)&quot;/&gt;

    &lt;xsl:choose&gt;
      &lt;xsl:when test=&quot;not($in)&quot;&gt;
        &lt;xsl:sequence select=&quot;string-join($seq, '')&quot;/&gt;
      &lt;/xsl:when&gt;
      &lt;xsl:when test=&quot;starts-with($in, '%')&quot;&gt;
        &lt;xsl:choose&gt;
          &lt;xsl:when test=&quot;matches(substring($in, 2, 2), '^[0-9A-Fa-f][0-9A-Fa-f]$')&quot;&gt;
            &lt;xsl:variable name=&quot;s&quot; as=&quot;xs:string&quot; select=&quot;substring($in, 2, 2)&quot;/&gt;
            &lt;xsl:variable name=&quot;d&quot; as=&quot;xs:integer&quot; select=&quot;p:hex-to-dec(upper-case($s))&quot;/&gt;
            &lt;xsl:choose&gt;
              &lt;xsl:when test=&quot;$d = $unreserved&quot;&gt;
                &lt;xsl:variable name=&quot;c&quot; as=&quot;xs:string&quot; select=&quot;codepoints-to-string($d)&quot;/&gt;
                &lt;xsl:sequence select=&quot;p:pct-decode-unreserved(substring($in, 4), ($seq, $c))&quot;/&gt;
              &lt;/xsl:when&gt;
              &lt;xsl:otherwise&gt;
                &lt;xsl:sequence select=&quot;p:pct-decode-unreserved(substring($in, 4), ($seq, '%', $s))&quot;/&gt;
              &lt;/xsl:otherwise&gt;
            &lt;/xsl:choose&gt;
          &lt;/xsl:when&gt;
          &lt;xsl:when test=&quot;contains(substring($in, 2), '%')&quot;&gt;
            &lt;xsl:variable name=&quot;s&quot; as=&quot;xs:string&quot; select=&quot;substring-before(substring($in, 2), '%')&quot;/&gt;
            &lt;xsl:sequence select=&quot;p:pct-decode-unreserved(substring($in, 2 + string-length($s)), ($seq, '%', $s))&quot;/&gt;
          &lt;/xsl:when&gt;
          &lt;xsl:otherwise&gt;
            &lt;xsl:sequence select=&quot;string-join(($seq, $in), '')&quot;/&gt;
          &lt;/xsl:otherwise&gt;
        &lt;/xsl:choose&gt;
      &lt;/xsl:when&gt;
      &lt;xsl:when test=&quot;contains($in, '%')&quot;&gt;
        &lt;xsl:variable name=&quot;s&quot; as=&quot;xs:string&quot; select=&quot;substring-before($in, '%')&quot;/&gt;
        &lt;xsl:sequence select=&quot;p:pct-decode-unreserved(substring($in, string-length($s)+1), ($seq, $s))&quot;/&gt;
      &lt;/xsl:when&gt;
      &lt;xsl:otherwise&gt;
        &lt;xsl:sequence select=&quot;string-join(($seq, $in), '')&quot;/&gt;
      &lt;/xsl:otherwise&gt;
    &lt;/xsl:choose&gt;
  &lt;/xsl:function&gt;

  &lt;!-- Private function to convert a hexadecimal string into decimal --&gt;
  &lt;xsl:function name=&quot;p:hex-to-dec&quot; as=&quot;xs:integer&quot;&gt;
    &lt;xsl:param name=&quot;hex&quot; as=&quot;xs:string&quot;/&gt;

    &lt;xsl:variable name=&quot;len&quot; as=&quot;xs:integer&quot; select=&quot;string-length($hex)&quot;/&gt;
    &lt;xsl:choose&gt;
      &lt;xsl:when test=&quot;$len eq 0&quot;&gt;
        &lt;xsl:sequence select=&quot;0&quot;/&gt;
      &lt;/xsl:when&gt;
      &lt;xsl:when test=&quot;$len eq 1&quot;&gt;
        &lt;xsl:sequence select=&quot;
                 if ($hex eq '0')       then 0
            else if ($hex eq '1')       then 1
            else if ($hex eq '2')       then 2
            else if ($hex eq '3')       then 3
            else if ($hex eq '4')       then 4
            else if ($hex eq '5')       then 5
            else if ($hex eq '6')       then 6
            else if ($hex eq '7')       then 7
            else if ($hex eq '8')       then 8
            else if ($hex eq '9')       then 9
            else if ($hex = ('A', 'a')) then 10
            else if ($hex = ('B', 'b')) then 11
            else if ($hex = ('C', 'c')) then 12
            else if ($hex = ('D', 'd')) then 13
            else if ($hex = ('E', 'e')) then 14
            else if ($hex = ('F', 'f')) then 15
            else error(xs:QName('p:hex-to-dec'))
          &quot;/&gt;
      &lt;/xsl:when&gt;
      &lt;xsl:otherwise&gt;
        &lt;xsl:sequence select=&quot;
          (16 * p:hex-to-dec(substring($hex, 1, $len - 1)))
          + p:hex-to-dec(substring($hex, $len))&quot;/&gt;
      &lt;/xsl:otherwise&gt;
    &lt;/xsl:choose&gt;
  &lt;/xsl:function&gt;
...


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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/msg1000307195.html</link>
</item><item>
<title>Re: [xsl] Decoding %-escaped chars in URI - 11/20/2009 5:42:00 PM</title>
<description><![CDATA[<pre>Michael Kay wrote:

&gt; No there's no such function.

  That's sad, but at least I'm reassured about my spec searching
skills ;-)

&gt; As a matter of interest, what's the use case?

  I am writing a WebDAV client in XSLT, using the EXPath HTTP
client.  In the result, the paths are encoded (for instance if you
ask the list of resources in a collection, aka the files in a
directory).  See (in particular the example in 8.3.1):

    http://tools.ietf.org/html/rfc4918#section-8.3

  So to display the resource name to a human, I should decode it
first.

&gt; (b) difficulty in the detail of specifying it: what do you do
&gt; for example with percent signs that aren't followed by two hex
&gt; digits.

  Yes.  I've just written such a function in plain XSLT, and I
generate an error in that case.  If I am right (but I did not
check) the input is not a valid lexical URI if this is the case
(for instance &quot;http://.../a%2&quot;).

  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/msg1000307194.html</link>
</item><item>
<title>RE: [xsl] Decoding %-escaped chars in URI - 11/20/2009 4:49:00 PM</title>
<description><![CDATA[<pre>No there's no such function.

As a matter of interest, what's the use case?

I think the only reasons it's not there are (a) absence of a use case, and
(b) difficulty in the detail of specifying it: what do you do for example
with percent signs that aren't followed by two hex digits.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay  

&gt; -----Original Message-----
&gt; From: Florent Georges [mailto:lists@fgeorges.org] 
&gt; Sent: 20 November 2009 16:35
&gt; To: XSL Mulberry list
&gt; Subject: [xsl] Decoding %-escaped chars in URI
&gt; 
&gt;   Hi,
&gt; 
&gt;   I guess I simply missed it, but I need a function to 
&gt; unescape %-escaped characters in a URI (that is, the opposite 
&gt; of the function fn:encode-for-uri) and I didn't find it in 
&gt; the standard library.
&gt; 
&gt;   Did I miss it, or is it missing from the standard library 
&gt; (and if it is, why is it so?)
&gt; 
&gt;   Regards,
&gt; 
&gt; --
&gt; Florent Georges
&gt; http://www.fgeorges.org/
&gt; 
&gt; 
&gt; 
&gt; 
&gt; 
&gt; 
&gt; 
&gt; 
&gt; 
&gt; 
&gt; 
&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; 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/msg1000307192.html</link>
</item><item>
<title>[xsl] Decoding %-escaped chars in URI - 11/20/2009 4:35:00 PM</title>
<description><![CDATA[<pre>Hi,

  I guess I simply missed it, but I need a function to unescape
%-escaped characters in a URI (that is, the opposite of the
function fn:encode-for-uri) and I didn't find it in the standard
library.

  Did I miss it, or is it missing from the standard library (and
if it is, why is it so?)

  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/msg1000307191.html</link>
</item><item>
<title>RE: [xsl] Having elements defined only once with XSLT - 11/20/2009 11:16:00 AM</title>
<description><![CDATA[<pre>Hi,

Thank you for your help and good tip. I'm using the XSLT 2.0, and you
are right, temporary tree seems to be a very reasonable suggestion. 

Janne

&gt; Janne Luoma wrote:
&gt; 
&gt; &gt; Now my XSLT script process the Source XML-file so that some of the
&gt; &gt; elements ('objectA', 'objectB'. 'objectC') may be resulted in the
&gt; &gt; beginning of the result file (or may not, based on the XSLT rules).
&gt; That
&gt; &gt; XSLT script part + rules works fine!
&gt; &gt;
&gt; &gt; But in case that element ('objectB' in my sample) is defined already
&gt; in
&gt; &gt; the beginning of the result file and then the same used later in the
&gt; &gt; document, this element should be referenced by href (not generated
&gt; the
&gt; &gt; full information again!). (In cases where element is not defined in
&gt; the
&gt; &gt; beginning, it should be reported fully, this works fine!). So my
&gt; &gt; question is: How to know which objects / elements have been
&gt; &gt; handled/defined already in the output, so that I could use href in
&gt; those
&gt; &gt; cases?
&gt; 
&gt; Do you use XSLT 2.0 or 1.0?
&gt; With 2.0 you could easily transform in a first step into a temporary
&gt; tree stored in a variable and then on the second step check the
&gt; temporary tree in the variable.
&gt; With 1.0 you would need to make use of an extension function like
&gt; exsl:node-set to do this with one transformation.
&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; --~--


--~------------------------------------------------------------------
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/msg1000307182.html</link>
</item><item>
<title>Re: [xsl] Having elements defined only once with XSLT - 11/20/2009 11:02:00 AM</title>
<description><![CDATA[<pre>Janne Luoma wrote:

&gt; Now my XSLT script process the Source XML-file so that some of the
&gt; elements ('objectA', 'objectB'. 'objectC') may be resulted in the
&gt; beginning of the result file (or may not, based on the XSLT rules). That
&gt; XSLT script part + rules works fine! 
&gt; 
&gt; But in case that element ('objectB' in my sample) is defined already in
&gt; the beginning of the result file and then the same used later in the
&gt; document, this element should be referenced by href (not generated the
&gt; full information again!). (In cases where element is not defined in the
&gt; beginning, it should be reported fully, this works fine!). So my
&gt; question is: How to know which objects / elements have been
&gt; handled/defined already in the output, so that I could use href in those
&gt; cases? 

Do you use XSLT 2.0 or 1.0?
With 2.0 you could easily transform in a first step into a temporary 
tree stored in a variable and then on the second step check the 
temporary tree in the variable.
With 1.0 you would need to make use of an extension function like 
exsl:node-set to do this with one transformation.


-- 

	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/msg1000307181.html</link>
</item><item>
<title>[xsl] Having elements defined only once with XSLT - 11/20/2009 9:38:00 AM</title>
<description><![CDATA[<pre>Hi,

I'm stuck with following XSLT processing problem:

Source XML
==========
&lt;object id=&quot;objectA&quot;&gt;
            &lt;property typeName=&quot;PropA&quot;&gt;
            	&lt;value&gt;Jack&lt;/value&gt;
            &lt;/property&gt;
&lt;/object&gt;
&lt;object id=&quot;objectB&quot;&gt;
            &lt;property typeName=&quot;PropB&quot;&gt;
	            &lt;value&gt;Jim&lt;/value&gt;
            &lt;/property&gt;
&lt;/object&gt;
&lt;object id=&quot;objectC&quot;&gt;
            &lt;property typeName=&quot;PropC&quot;&gt;
           	 &lt;value&gt;John&lt;/value&gt;
            &lt;/property&gt;
&lt;/object&gt;


Now my XSLT script process the Source XML-file so that some of the
elements ('objectA', 'objectB'. 'objectC') may be resulted in the
beginning of the result file (or may not, based on the XSLT rules). That
XSLT script part + rules works fine! 

But in case that element ('objectB' in my sample) is defined already in
the beginning of the result file and then the same used later in the
document, this element should be referenced by href (not generated the
full information again!). (In cases where element is not defined in the
beginning, it should be reported fully, this works fine!). So my
question is: How to know which objects / elements have been
handled/defined already in the output, so that I could use href in those
cases? 


Expected output:
================
&lt;!-- File starts --&gt;
&lt;object id=&quot;objectB&quot;&gt;
             &lt;property typeName=&quot;PropB&quot;&gt;
  		   &lt;name&gt;Jim&lt;/name&gt;
	  &lt;/property&gt;
&lt;/object&gt;

&lt;!-- ...            --&gt;
&lt;!-- File continues --&gt;
&lt;!-- ...            --&gt;

&lt;Model&gt;
	&lt;object id=&quot;objectA&quot;&gt;
		 &lt;property typeName=&quot;PropA&quot;&gt;
			   &lt;name&gt;Jack&lt;/name&gt;
		  &lt;/property&gt;
	&lt;/object&gt;
           &lt;object href=&quot;#objectB&quot;/&gt;
	&lt;object id=&quot;objectC&quot;&gt;
		 &lt;property typeName=&quot;PropC&quot;&gt;
	 		   &lt;name&gt;John&lt;/name&gt;
		  &lt;/property&gt;
	&lt;/object&gt;
&lt;/Model&gt;
&lt;!-- File ends --&gt;

Thanks in advance

Janne

--~------------------------------------------------------------------
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/msg1000307178.html</link>
</item><item>
<title>Re: [xsl] XSLT for XSL-FO internal-destination - 11/20/2009 8:49:00 AM</title>
<description><![CDATA[<pre>well you're leaving me to guess a lot about your uinput structure, but
I'd guess that 

                   &lt;fo:block id=&quot;{@href}&quot;&gt;

        			&lt;xsl:for-each select=&quot;//TocEntry&quot;&gt;
        				&lt;xsl:for-each select=&quot;document(@Link)//body&quot;&gt;
                			  &lt;xsl:apply-templates/&gt;


just puts in a single id (with possibly empty value) at the top of teh
document
you want an id for each file inclusion so perhaps




        			&lt;xsl:for-each select=&quot;//TocEntry&quot;&gt;
                                      &lt;fo:block id=&quot;{@Link}&quot;/&gt;
        				&lt;xsl:for-each select=&quot;document(@Link)//body&quot;&gt;
                			  &lt;xsl:apply-templates/&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/msg1000307176.html</link>
</item><item>
<title>Re: [xsl] for-each tokenize() and context problem - 11/20/2009 3:29:00 AM</title>
<description><![CDATA[<pre>Sorry I haven't read your use case in detail. But from XSLT language
perspective, it's probably better to declare the variable you used, as
following:

&lt;xsl:variable name=&quot;l_GetPartNumber&quot; as=&quot;xs:string*&quot;&gt;
  ...
&lt;/xsl:variable&gt;

XSLT 2.0 allows us to specify the type of a variable like, as
xs:string* above which brings the advantages to strong typing, as we
have been discussing in other threads lately.

I think, if we declare a variable as following:

&lt;xsl:variable name=&quot;l_GetPartNumber&quot;&gt;
  ...
&lt;/xsl:variable&gt;

The contents of the variable are the output of some sequence
instruction(s), probably, let's say which (the sequence instructions)
produce data of some XDM type.

Depending on where the variable, l_GetPartNumber is used after
declaration, the variable will be coerced to the type required by the
evaluation in a given context (I don't mean though the XSLT language
term, context :)) which is probably expensive for XSLT processor to
do, and also probably not a good program design.

So in a nutshell, I would recommend to declare the types of variables
(or whatever XSLT 2 instructions allow us to specify types, like also
for e.g, &lt;xsl:param name=&quot;x&quot; as=&quot;xs:string&quot; /&gt;) whereever we can know
before compilation of the stylesheets, what the types of data should
be.

On Thu, Nov 19, 2009 at 10:57 PM, Mario Madunic
&lt;Mario_Madunic@newflyer.com&gt; wrote:
&gt; I have the following variable,
&gt;
&gt; &lt;xsl:variable name=&quot;l_GetPartNumber&quot;&gt;
&gt; &#194;&#160;&lt;xsl:for-each select=&quot;tokenize(normalize-space($l_Components), ' ')&quot;&gt;
&gt; &#194;&#160; &#194;&#160;&lt;xsl:variable name=&quot;l_Num&quot; select=&quot;.&quot; /&gt;
&gt; &#194;&#160; &#194;&#160;&lt;xsl:for-each select=&quot;ancestor::*[self::page]/row[entry[1] = $l_Num]/entry[3]&quot;&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;xsl:value-of select=&quot;concat(' ', .)&quot; /&gt;
&gt; &#194;&#160; &#194;&#160;&lt;/xsl:for-each&gt;
&gt; &#194;&#160;&lt;/xsl:for-each&gt;
&gt; &lt;/xsl:variable&gt;
&gt;
&gt; &lt;xsl:attribute name=&quot;partsList&quot; select=&quot;normalize-space(concat('- ', $ l_GetPartNumber, ' -'))&quot; /&gt;
&gt;
&gt; It is all within a &lt;template match=&quot;entry[contains(., ' (Incl. ')]&quot;&gt;...&lt;/&gt;
&gt;
&gt; $l_Components is a variable that contains a list of numbers stripped from the last &lt;entry /&gt; and all ranges (7...11) expanded (7 8 9 10 11) and all commas and ampersands removed. I end up with a tokenized list, such as this &quot;3 5 7 8 9 10 11 13&quot;. A sample of the XML is below
&gt;
&gt; &lt;pages&gt;
&gt; &#194;&#160;&lt;page&gt;
&gt; &#194;&#160; &#194;&#160;&lt;row&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;entry&gt;1&lt;/entry&gt;&lt;!-- a quirk, can appear multiple times with the same parent, same value, and have different part numbers (options to the first one mentioned) --&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;entry&gt;quantity&lt;/entry&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;entry&gt;part number&lt;/entry&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;entry&gt;part description&lt;/entry&gt;
&gt; &#194;&#160; &#194;&#160;&lt;row&gt;
&gt; &#194;&#160; &#194;&#160;&lt;row&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;entry&gt;2&lt;/entry&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;entry&gt;quantity&lt;/entry&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;entry&gt;part number&lt;/entry&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;entry&gt;part description, (Incl. 3, 5, 7...11, &amp; 13)&lt;/entry&gt;
&gt; &#194;&#160; &#194;&#160;&lt;row&gt;
&gt; &#194;&#160; &#194;&#160;...
&gt; &#194;&#160;&lt;/page&gt;
&gt; &lt;/pages&gt;
&gt;
&gt; The following step is replace the row number with the part number. The XPath &quot;ancestor::*[self::page]/row[entry[1] = $l_Num]/entry[3]&quot; works outside of the variable it is in. But once I do the above (var name = l_GetPartNumber), I receive the following error msg.
&gt;
&gt; Fatal Error! Axis step ancestor::element() cannot be used here: the context item is an atomic value
&gt;
&gt; Am I going about this the wrong way? Any insight would be appreciated.
&gt;
&gt; Marijan (Mario) Madunic
&gt; Publishing Specialist
&gt; New Flyer Industries
&gt; (204) 934 8815
&gt; mario_madunic@newflyer.com



-- 
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/msg1000307170.html</link>
</item><item>
<title>Re: [xsl] XSLT for XSL-FO internal-destination - 11/20/2009 2:29:00 AM</title>
<description><![CDATA[<pre>David,

Thanks for clarifying that issue with the invalid URI. Also, I am using xslt 1, but it looks like I could use the translate function.

I'm not quite clear on the mechanics of getting the new id for the href into an FO block at the beginning of each file. Here is a simplified anchor template. Is this correct method for generating the href id?

&lt;xsl:template match=&quot;a|A&quot;&gt;
   &lt;fo:inline&gt;
      &lt;fo:basic-link color=&quot;blue&quot;&gt;
              &lt;xsl:attribute name=&quot;internal-destination&quot;&gt;
                 &lt;xsl:value-of select=&quot;translate(@href,':/','')&quot; /&gt;
              &lt;/xsl:attribute&gt;
              &lt;xsl:apply-templates /&gt;
      &lt;/fo:basic-link&gt;
    &lt;/fo:inline&gt;
&lt;/xsl:template&gt;

Also, I search through a table of contents file to open each source file; so, I thought I could try inserting the href id in &lt;fo:block&gt; in the page flow, but this doesn't work:

    &lt;!-- Page sequence for body pages --&gt;
	&lt;fo:page-sequence master-reference=&quot;only&quot; format=&quot;1&quot;&gt;
    	     &lt;fo:static-content flow-name=&quot;footer&quot;&gt;
                &lt;fo:block text-align=&quot;center&quot;&gt;
                   &lt;fo:page-number/&gt;
                 &lt;/fo:block&gt;
            &lt;/fo:static-content&gt;
              &lt;fo:flow flow-name=&quot;xsl-region-body&quot;&gt;

                   &lt;fo:block id=&quot;{@href}&quot;&gt;

        			&lt;xsl:for-each select=&quot;//TocEntry&quot;&gt;
        				&lt;xsl:for-each select=&quot;document(@Link)//body&quot;&gt;
                			  &lt;xsl:apply-templates/&gt;
        		        &lt;/xsl:for-each&gt;
        		     &lt;/xsl:for-each&gt;                         
                   &lt;/fo:block&gt;
              &lt;/fo:flow&gt;
   &lt;/fo:page-sequence&gt;

Can you tell me where I'm going off track?

Thanks,

Rob

--- On Thu, 11/19/09, David Carlisle &lt;davidc@nag.co.uk&gt; wrote:

&gt; From: David Carlisle &lt;davidc@nag.co.uk&gt;
&gt; Subject: Re: [xsl] XSLT for XSL-FO internal-destination
&gt; To: xsl-list@lists.mulberrytech.com
&gt; Cc: xsl-list@lists.mulberrytech.com
&gt; Date: Thursday, November 19, 2009, 8:02 PM
&gt; 
&gt; 
&gt; &gt;&#160; &lt;a href=&quot;c:/Help_Files/File_Two.htm&quot;&gt;. 
&gt; 
&gt; not that it matters to xslt but that URI is in error.. If
&gt; browsers
&gt; conformed to the spec that would be a URI using an unknown
&gt; URI
&gt; protocol. &quot;c&quot;. should just be href=&quot;File_Two.htm&quot; or if you
&gt; need
&gt; absolute uri href=&quot;file:///c:/Help_Files/File_Two.htm&quot;
&gt; 
&gt; You haven't said if you are using xslt 1 or 2, string
&gt; manipulation is
&gt; easier in 2 but you perhaps dont need any string
&gt; manipulation.
&gt; 
&gt; 
&gt; &gt; None of the help system files have the filename in the
&gt; &lt;TITLE&gt; or
&gt; &gt; anywhere else in the file, so I'm not able to use the
&gt; &gt; generate-id function to create a target.
&gt; 
&gt; not sure why the title being empty affects the use of
&gt; generate-id().
&gt; You could use generate-id() on the document node or the
&gt; empty title
&gt; element, but actually I'd advise against using genereted-id
&gt; for link
&gt; anchors, it makes for very unstable documents, if yu
&gt; regenerate them
&gt; after any sort of edit, or potentially even after no edits,
&gt; all the
&gt; anchors change.
&gt; 
&gt; It depends a bit how general you want to be but your
&gt; example would be
&gt; a valid reference if you just wused
&gt; translate(@href,':/','')
&gt; which would make an id of cHelp_FilesFile_Two.htm which you
&gt; could use in
&gt; an fo:simple-link and in an id at the first fo:block that
&gt; you generate
&gt; from a document.
&gt; 
&gt; David
&gt; 
&gt; ________________________________________________________________________
&gt; The Numerical Algorithms Group Ltd is a company registered
&gt; in England
&gt; and Wales with company number 1249803. The registered
&gt; office is:
&gt; Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United
&gt; Kingdom.
&gt; 
&gt; This e-mail has been scanned for all viruses by Star. The
&gt; service is
&gt; powered by MessageLabs. 
&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/200911/msg1000307168.html</link>
</item><item>
<title>Re: [xsl] XSLT for XSL-FO internal-destination - 11/19/2009 8:03:00 PM</title>
<description><![CDATA[<pre>&gt;  &lt;a href=&quot;c:/Help_Files/File_Two.htm&quot;&gt;. 

not that it matters to xslt but that URI is in error.. If browsers
conformed to the spec that would be a URI using an unknown URI
protocol. &quot;c&quot;. should just be href=&quot;File_Two.htm&quot; or if you need
absolute uri href=&quot;file:///c:/Help_Files/File_Two.htm&quot;

You haven't said if you are using xslt 1 or 2, string manipulation is
easier in 2 but you perhaps dont need any string manipulation.


&gt; None of the help system files have the filename in the &lt;TITLE&gt; or
&gt; anywhere else in the file, so I'm not able to use the
&gt; generate-id function to create a target.

not sure why the title being empty affects the use of generate-id().
You could use generate-id() on the document node or the empty title
element, but actually I'd advise against using genereted-id for link
anchors, it makes for very unstable documents, if yu regenerate them
after any sort of edit, or potentially even after no edits, all the
anchors change.

It depends a bit how general you want to be but your example would be
a valid reference if you just wused translate(@href,':/','')
which would make an id of cHelp_FilesFile_Two.htm which you could use in
an fo:simple-link and in an id at the first fo:block that you generate
from a document.

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/msg1000307159.html</link>
</item><item>
<title>[xsl] XSLT for XSL-FO internal-destination - 11/19/2009 7:46:00 PM</title>
<description><![CDATA[<pre>I&#226;€™m combining many XHTML online help files into one large PDF with FOP and am wondering what kind of transform I need to write to handle anchors like this: &lt;a href=&quot;c:/Help_Files/File_Two.htm&quot;&gt;. 

These types of links simply point from one help file page to another. When I combine these XHTML files into a book, these links in the new document need to be redirected to an internal destination inside the PDF (in other words, to the first line of the content of the file that used to be external but is now internal to the PDF). 

None of the help system files have the filename in the &lt;TITLE&gt; or anywhere else in the file, so I&#226;€™m not able to use the generate-id function to create a target. Is there some other way I can redirect this external anchor to a location inside my combined PDF?

Here are two sample files. How would you handle the anchor in &#226;€œFile_One.htm&#226;€ that points to &#226;€œFile_Two.htm&#226;€ when both files end up in the same combined PDF?

File_One.htm

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;html&gt;
    &lt;head&gt;
       &lt;title&gt; &lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;p&gt;Link example: &lt;a href=&quot;c:/help_files/File_Two.htm&quot;&gt;Link to file two. &lt;/a&gt;
    &lt;/body&gt;
&lt;/html&gt; 

File_Two.htm

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;html&gt;
    &lt;head&gt;
       &lt;title&gt; &lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;p&gt;Content of file number two.&lt;/a&gt;
    &lt;/body&gt;
&lt;/html&gt;

Thanks,

Rob


      

--~------------------------------------------------------------------
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/msg1000307157.html</link>
</item><item>
<title>Re: [xsl] Benefits of xsd-types in XSLT - 11/19/2009 7:12:00 PM</title>
<description><![CDATA[<pre>Hi,

At 10:52 AM 11/19/2009, Florent wrote:
&gt;Wolfgang Laun wrote: &gt; Whenever you say &quot;XML&quot;, you implicitly say 
&gt;&quot;text&quot;   XSLT does not manipulate XML as string, but it manipulates 
&gt;XDM instances.  Often, something else than a serialized 
&gt;representation of XML is used to feed an XSLT or XQuery processor.

This is true and important to keep in mind, but I think Wolfgang also 
has an important point.

The issue at hand is precisely what sort of relation there is between 
the world of XDM and the world of XML over the wire, or in the black 
box at the other end.

As far as that goes, I think AC is onto something in writing:

&gt;I would simply like to also highlight some more &quot;qualitative&quot; 
&gt;aspects of XSLT type handling, including the support for implicit 
&gt;typing, the fact that explicit typing can be used as required, the 
&gt;fact that types can be expanded, defined, and checked in a formal 
&gt;process (e.g. schema), as well as the good support for type casting, 
&gt;detection, and conversion.

One of the important contributors to the success of XSLT 2.0 is that 
one can still work quite productively with fairly weak typing or with 
typing that is strong only where it needs to be.

Not that I know anything about it, but my guess is that while this 
doesn't make the issue of mapping type systems to one another 
disappear, in practice it often means it is somewhat less critical 
(and less onerous) than it might be.

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/msg1000307156.html</link>
</item><item>
<title>RE: [xsl] for-each tokenize() and context problem - 11/19/2009 6:39:00 PM</title>
<description><![CDATA[<pre>Thanks for the clarification.

I guess where my confusion came from, is that I assumed that I still had context because the for-eachs where nested inside a template match statement and that context would always be there. (Even discounting the fact I was tokenizing a string.)

Marijan (Mario) Madunic
Publishing Specialist
New Flyer Industries

-----Original Message-----
From: Martin Honnen [mailto:Martin.Honnen@gmx.de] 
Sent: Thursday, November 19, 2009 12:22 PM
To: xsl-list@lists.mulberrytech.com
Subject: Re: [xsl] for-each tokenize() and context problem

Mario Madunic wrote:

&gt; Any for-each that is a descendant of a for-each (with no parent for-each) will lose its context. The context will be the current node, in this case text. Am I correct in this assumption?

No, the result of the tokenize is a sequence of string values and that 
way in the for-each select=&quot;tokenize(...)&quot; you have a string value as 
the context item and you can't do XPath like ancestor on string items 
(or any atomic values), you can only do XPath on nodes.


-- 

	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/200911/msg1000307154.html</link>
</item><item>
<title>Re: [xsl] for-each tokenize() and context problem - 11/19/2009 6:23:00 PM</title>
<description><![CDATA[<pre>Mario Madunic wrote:

&gt; Any for-each that is a descendant of a for-each (with no parent for-each) will lose its context. The context will be the current node, in this case text. Am I correct in this assumption?

No, the result of the tokenize is a sequence of string values and that 
way in the for-each select=&quot;tokenize(...)&quot; you have a string value as 
the context item and you can't do XPath like ancestor on string items 
(or any atomic values), you can only do XPath on nodes.


-- 

	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/msg1000307153.html</link>
</item><item>
<title>RE: [xsl] for-each tokenize() and context problem - 11/19/2009 6:19:00 PM</title>
<description><![CDATA[<pre>Thanks Martin, it worked like a charm.

For clarification,

Any for-each that is a descendant of a for-each (with no parent for-each) will lose its context. The context will be the current node, in this case text. Am I correct in this assumption?

Would the same be true of if I for-each'd an element with child nodes and then for-each'd the child nodes (it contains child nodes). I'm assuming that the child for-each will only have context to descendants and not ancestors. Hopefully that made sense.

Thanks again Martin for the quick and helpful reply.

Marijan (Mario) Madunic
Publishing Specialist
New Flyer Industries

-----Original Message-----
From: Martin Honnen [mailto:Martin.Honnen@gmx.de] 
Sent: Thursday, November 19, 2009 11:33 AM
To: xsl-list@lists.mulberrytech.com
Subject: Re: [xsl] for-each tokenize() and context problem

Mario Madunic wrote:
&gt; I have the following variable,

Put an
   &lt;xsl:variable name=&quot;t&quot; select=&quot;.&quot;/&gt;
here, then

&gt; &lt;xsl:variable name=&quot;l_GetPartNumber&quot;&gt;
&gt;   &lt;xsl:for-each select=&quot;tokenize(normalize-space($l_Components), ' ')&quot;&gt;
&gt;     &lt;xsl:variable name=&quot;l_Num&quot; select=&quot;.&quot; /&gt;
&gt;     &lt;xsl:for-each select=&quot;ancestor::*[self::page]/row[entry[1] = $l_Num]/entry[3]&quot;&gt;

here use
       &lt;xsl:for-each select=&quot;$t/ancestor::*[self::page]/row[entry[1] = 
$l_Num]/entry[3]&quot;&gt;

That is necessary as with the for-each select=&quot;tokenize(...)&quot; you no 
longer have the context node you have outside of the for-each.




-- 

	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/200911/msg1000307152.html</link>
</item><item>
<title>Re: [xsl] for-each tokenize() and context problem - 11/19/2009 5:34:00 PM</title>
<description><![CDATA[<pre>Mario Madunic wrote:
&gt; I have the following variable,

Put an
   &lt;xsl:variable name=&quot;t&quot; select=&quot;.&quot;/&gt;
here, then

&gt; &lt;xsl:variable name=&quot;l_GetPartNumber&quot;&gt;
&gt;   &lt;xsl:for-each select=&quot;tokenize(normalize-space($l_Components), ' ')&quot;&gt;
&gt;     &lt;xsl:variable name=&quot;l_Num&quot; select=&quot;.&quot; /&gt;
&gt;     &lt;xsl:for-each select=&quot;ancestor::*[self::page]/row[entry[1] = $l_Num]/entry[3]&quot;&gt;

here use
       &lt;xsl:for-each select=&quot;$t/ancestor::*[self::page]/row[entry[1] = 
$l_Num]/entry[3]&quot;&gt;

That is necessary as with the for-each select=&quot;tokenize(...)&quot; you no 
longer have the context node you have outside of the for-each.




-- 

	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/msg1000307150.html</link>
</item><item>
<title>[xsl] for-each tokenize() and context problem - 11/19/2009 5:28:00 PM</title>
<description><![CDATA[<pre>I have the following variable,

&lt;xsl:variable name=&quot;l_GetPartNumber&quot;&gt;
  &lt;xsl:for-each select=&quot;tokenize(normalize-space($l_Components), ' ')&quot;&gt;
    &lt;xsl:variable name=&quot;l_Num&quot; select=&quot;.&quot; /&gt;
    &lt;xsl:for-each select=&quot;ancestor::*[self::page]/row[entry[1] = $l_Num]/entry[3]&quot;&gt;
      &lt;xsl:value-of select=&quot;concat(' ', .)&quot; /&gt;
    &lt;/xsl:for-each&gt;
  &lt;/xsl:for-each&gt;
&lt;/xsl:variable&gt;

&lt;xsl:attribute name=&quot;partsList&quot; select=&quot;normalize-space(concat('- ', $ l_GetPartNumber, ' -'))&quot; /&gt;

It is all within a &lt;template match=&quot;entry[contains(., ' (Incl. ')]&quot;&gt;...&lt;/&gt;

$l_Components is a variable that contains a list of numbers stripped from the last &lt;entry /&gt; and all ranges (7...11) expanded (7 8 9 10 11) and all commas and ampersands removed. I end up with a tokenized list, such as this &quot;3 5 7 8 9 10 11 13&quot;. A sample of the XML is below 

&lt;pages&gt;
  &lt;page&gt;
    &lt;row&gt;
      &lt;entry&gt;1&lt;/entry&gt;&lt;!-- a quirk, can appear multiple times with the same parent, same value, and have different part numbers (options to the first one mentioned) --&gt;
      &lt;entry&gt;quantity&lt;/entry&gt;
      &lt;entry&gt;part number&lt;/entry&gt;
      &lt;entry&gt;part description&lt;/entry&gt;
    &lt;row&gt;
    &lt;row&gt;
      &lt;entry&gt;2&lt;/entry&gt;
      &lt;entry&gt;quantity&lt;/entry&gt;
      &lt;entry&gt;part number&lt;/entry&gt;
      &lt;entry&gt;part description, (Incl. 3, 5, 7...11, &amp; 13)&lt;/entry&gt;
    &lt;row&gt;
    ...
 &lt;/page&gt;
&lt;/pages&gt;

The following step is replace the row number with the part number. The XPath &quot;ancestor::*[self::page]/row[entry[1] = $l_Num]/entry[3]&quot; works outside of the variable it is in. But once I do the above (var name = l_GetPartNumber), I receive the following error msg.

Fatal Error! Axis step ancestor::element() cannot be used here: the context item is an atomic value

Am I going about this the wrong way? Any insight would be appreciated.

Marijan (Mario) Madunic
Publishing Specialist
New Flyer Industries
(204) 934 8815
mario_madunic@newflyer.com


--------------------------------------------------------------------
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/200911/msg1000307149.html</link>
</item><item>
<title>Re: [xsl] Key  functionality  in XSL - 11/19/2009 4:59:00 PM</title>
<description><![CDATA[<pre>It looks like you're trying to set up a multi-valued key, correct? I think you're confusing the XPath union operator (|) with the literal pipe character you're using later for the key value. So I think you're looking for this:

&lt;xsl:key name=&quot;k1&quot; match=&quot;ROW&quot; use=&quot;concat(COLUMN[@NAME ='JOBCODE'], '|', COLUMN[@NAME = 'JC_CODE'])&quot;/&gt;

~ Scott

-----Original Message-----
From: Anil Kumar Veeramalli [mailto:anil.v@frescoinformatics.com] 
Sent: Thursday, November 19, 2009 1:41 AM
To: xsl-list@lists.mulberrytech.com
Subject: [xsl] Key functionality in XSL

 
Thanks David. I want to iterate with the Key.

I tried this way its not working.

&lt;xsl:key name=&quot;k1&quot; match=&quot;ROW&quot; use=&quot;COLUMN[@NAME ='JOBCODE'] | COLUMN[@NAME = 'JC_CODE']&quot;/&gt; 


 &lt;xsl:variable name=&quot;job_code&quot; select=&quot;'P10'&quot;/&gt;
    &lt;xsl:variable name=&quot;jc_code&quot; select=&quot;'P10'&quot;/&gt;
    &lt;xsl:variable name=&quot;keyvalue&quot; select = 
&quot;concat($job_code,'|',$jc_code)&quot;/&gt;

  &lt;xsl:for-each select=&quot;key('k1',$keyvalue)&quot;&gt;
      &lt;!-- some output--&gt;
   &lt;/xsl-for-earch&gt;

is this not correct way of doing.

Thanks,
Anil

David Carlisle wrote:
&gt;&gt; &lt;xsl:key name=&quot;k1&quot; match=&quot;ROW&quot; use=&quot;COLUMN[@NAME = 
&gt;&gt; 'JOBCODE'],COLUMN[@NAME = 'JC_CODE']&quot;/&gt; like this?
&gt;&gt;     
&gt;
&gt; use has to be a match pattern so you can't use , you can use | though.
&gt;
&gt; &lt;xsl:key name=&quot;k1&quot; match=&quot;ROW&quot; use=&quot;COLUMN[@NAME = 
&gt;  'JOBCODE'] | COLUMN[@NAME = 'JC_CODE']&quot;/&gt; 
&gt;
&gt;
&gt; If you are using xslt2 you can use the alternative
&gt; &lt;xsl:key name=&quot;k1&quot; match=&quot;ROW&quot; use=&quot;COLUMN[@NAME =
&gt; ('JOBCODE','JC_CODE')]&quot;/&gt;
&gt;
&gt; David
&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;
&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/200911/msg1000307147.html</link>
</item><item>
<title>Re: [xsl] Date compare in XSL - 11/19/2009 4:54:00 PM</title>
<description><![CDATA[<pre>2009/11/19 Anil Kumar Veeramalli &lt;anil.v@frescoinformatics.com&gt;:
&gt; Hi ,
&gt;
&gt; I have two variables. I want to find out which is greatest date. I am using
&gt; XSL1.0
&gt;
&gt; &lt;xsl:variable name=&quot;date1&quot; select=&quot;01-Jan-2008&quot;&gt;&lt;/xsl:variable&gt;
&gt; &lt;xsl:variable name=&quot;date2&quot; select=&quot;02-Jan-2009&quot;&gt;&lt;/xsl:variable&gt;
&gt;
&gt; I could not find any function or documentation to compare the dates.
&gt;
&gt; Please suggest me on this.

In XSLT 1.0, the usual way is to string process the dates into the
form YYYYMMDD, then you can just do straight number comparisons, for
example 20080101 is before 20090102.




-- 
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/msg1000307146.html</link>
</item><item>
<title>[xsl] Date compare in XSL - 11/19/2009 4:44:00 PM</title>
<description><![CDATA[<pre>Hi ,

I have two variables. I want to find out which is greatest date. I am 
using XSL1.0

&lt;xsl:variable name=&quot;date1&quot; select=&quot;01-Jan-2008&quot;&gt;&lt;/xsl:variable&gt;
&lt;xsl:variable name=&quot;date2&quot; select=&quot;02-Jan-2009&quot;&gt;&lt;/xsl:variable&gt;

I could not find any function or documentation to compare the dates.

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/msg1000307145.html</link>
</item><item>
<title>[xsl] [Announce] Poll for hands-on XML training offerings in Europe - 11/19/2009 4:13:00 PM</title>
<description><![CDATA[<pre>Please ignore the following if you have no interest in XML-related training.

In Q1'2010 I will be in Europe a couple of times for some standards 
meetings (OASIS and ISO) and conferences ( http://www.XMLPrague.cz 
and PEPPOL) and I like to take advantage of my presence there by 
offering Crane's hands-on training classes in the week before or 
after each of the events, open to public subscription.

I'll be in Copenhagen in February and in Prague and Stockholm in March.

But it is a gamble to decide on which training class to offer and 
find no-one is interested in that particular topic, because of hotel 
and event obligations that need to be paid in advance or reserved 
with the risk of forfeit.  We realize not many people in these 
economic times have money for training, so we are now trying to 
target our offerings specifically where we learn there is demand and 
availability of students.

Last year's http://www.XMLPrague.cz conference was great and we did 
our training adjacent to the conference and our students were 
conference attendees.  The venue we have chosen again in Prague next 
year has room for only 6 students (a large 14th century hotel room), 
so if XML training at this time of year and in conjunction with the 
conference is of interest to you, it would be important to sign up 
your interest soon.

To address this urgency to start making plans, I am polling the 
various XML lists for any interest in training in these cities early 
next year.  If you are interested in hands-on training on any of 
XSLT, XQuery, XSL-FO, the Universal Business Language or code lists 
in XML, and you would be interested in attending, please let us know 
and we will figure out what we can do.  To see the proposed dates, 
please visit:

   http://www.CraneSoftwrights.com/forms/interest.php
   (the page has links to syllabi)

On the form, please indicate all of the offered dates that you would 
be interested in, and we'll make a decision based on the response 
level we get for each class and date.

Thanks!  Please direct any questions to me off-list.

. . . . . . . . . Ken

p.s. it hasn't been decided but I might be in Perth Australia in 
January or February, so you won't see it on the form, but if you are 
in that area, please let me know in a mail message if you are 
interested in training on any of our subjects and we'll see about 
setting up a publicly-subscribed class.

cc: XML-Dev, XSL List, XQuery Talk, XML-Doc, UBL Dev, CLR Dev, 
Antenna House list, RenderX list, MarkLogic list

--
Vote for your XML training:   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/msg1000307144.html</link>
</item><item>
<title>Re: [xsl] Benefits of xsd-types in XSLT - 11/19/2009 3:53:00 PM</title>
<description><![CDATA[<pre>Wolfgang Laun wrote:

&gt; Whenever you say &quot;XML&quot;, you implicitly say &quot;text&quot;

  XSLT does not manipulate XML as string, but it manipulates XDM instances.  Often, something else than a serialized representation of XML is used to feed an XSLT or XQuery 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/200911/msg1000307141.html</link>
</item><item>
<title>Re: [xsl] Benefits of xsd-types in XSLT - 11/19/2009 3:21:00 PM</title>
<description><![CDATA[<pre>On Thu, Nov 19, 2009 at 9:34 AM, Jesper Tverskov
&lt;jesper.tverskov@gmail.com&gt; wrote:
&gt; Sorry for being unclear.
&gt;
&gt; With XSLT 2.0 we can transform XML input with xsd-types to XML output
&gt; with xsd-types easily because XSLT also use xsd-types. Great. If we
&gt; have to do the same in C# or Java, etc, we will have to convert
&gt; between two type systems two times. This can be done automatically,
&gt; and I listed XML data binding as example. Here we use an XML Schema
&gt; schema to generate classes with types of another type system.
&gt;
&gt; So here is my question:
&gt;
&gt; Is the cost of type system conversion, when we don't use XSLT, a real
&gt; problem at least for an important subset of use cases?
&gt;

Whenever you say &quot;XML&quot;, you implicitly say &quot;text&quot;, and for all programming
systems that aren't dealing with all data as strings, some conversion between
binary and string has to be done. You ought to know all the consequences
of passing binary data between systems, and the trade-off between the
basic choices.

Binding between XML Schema types and, say, Java types is not a 100% fit.
But it is amply sufficient for real-world applications. Having all X[A-Z]+
systems adhere to this common typing system has the benefit that
a conversion library between XML and binary can be re-used.

-W

&gt;
&gt; Cheers,
&gt; Jesper Tverskov
&gt;
&gt; http://www.xmlkurser.dk
&gt; http://www.xmlplease.com
&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/msg1000307140.html</link>
</item><item>
<title>Re: [xsl] Key  functionality  in XSL - 11/19/2009 10:03:00 AM</title>
<description><![CDATA[<pre>&gt; I tried this way its not working.

Sorry. You should have done what was in my head, not what I wrote, which
was nonsense.


me&gt; use has to be a match pattern

use takes an XPath expression. I mean match which takes a pattern.



&lt;xsl:key name=&quot;k1&quot; match=&quot;ROW&quot; use=&quot;COLUMN[@NAME ='JOBCODE'] | COLUMN[@NAME = 'JC_CODE']&quot;/&gt; 

that indexes each ROW on either of those columns.

&quot;key('k1','P10')

should work if P10 is the value of either the 'JOBCODE' or 'JC_CODE'
column.

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/msg1000307129.html</link>
</item><item>
<title>Re: [xsl] Key  functionality  in XSL - 11/19/2009 9:43:00 AM</title>
<description><![CDATA[<pre>&gt; &quot;concat($job_code,'|',$jc_code)&quot;/&gt;

That makes a string with a bit of syntax in it, not an xoath expression
taht can be evaluated.

It's no different tahn C or java or any other language you can think of
if you have a variable x with a number in it then

y = x + 1

will make y one more than that but

y = &quot; X + 12

won't.

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/msg1000307125.html</link>
</item><item>
<title>Re: [xsl] Benefits of xsd-types in XSLT - 11/19/2009 8:35:00 AM</title>
<description><![CDATA[<pre>Sorry for being unclear.

With XSLT 2.0 we can transform XML input with xsd-types to XML output
with xsd-types easily because XSLT also use xsd-types. Great. If we
have to do the same in C# or Java, etc, we will have to convert
between two type systems two times. This can be done automatically,
and I listed XML data binding as example. Here we use an XML Schema
schema to generate classes with types of another type system.

So here is my question:

Is the cost of type system conversion, when we don't use XSLT, a real
problem at least for an important subset of use cases?


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/msg1000307123.html</link>
</item><item>
<title>[xsl] Key  functionality  in XSL - 11/19/2009 7:41:00 AM</title>
<description><![CDATA[<pre>Thanks David. I want to iterate with the Key.

I tried this way its not working.

&lt;xsl:key name=&quot;k1&quot; match=&quot;ROW&quot; use=&quot;COLUMN[@NAME ='JOBCODE'] | COLUMN[@NAME = 'JC_CODE']&quot;/&gt; 


 &lt;xsl:variable name=&quot;job_code&quot; select=&quot;'P10'&quot;/&gt;
    &lt;xsl:variable name=&quot;jc_code&quot; select=&quot;'P10'&quot;/&gt;
    &lt;xsl:variable name=&quot;keyvalue&quot; select = 
&quot;concat($job_code,'|',$jc_code)&quot;/&gt;

  &lt;xsl:for-each select=&quot;key('k1',$keyvalue)&quot;&gt;
      &lt;!-- some output--&gt;
   &lt;/xsl-for-earch&gt;

is this not correct way of doing.

Thanks,
Anil

David Carlisle wrote:
&gt;&gt; &lt;xsl:key name=&quot;k1&quot; match=&quot;ROW&quot; use=&quot;COLUMN[@NAME = 
&gt;&gt; 'JOBCODE'],COLUMN[@NAME = 'JC_CODE']&quot;/&gt; like this?
&gt;&gt;     
&gt;
&gt; use has to be a match pattern so you can't use , you can use | though.
&gt;
&gt; &lt;xsl:key name=&quot;k1&quot; match=&quot;ROW&quot; use=&quot;COLUMN[@NAME = 
&gt;  'JOBCODE'] | COLUMN[@NAME = 'JC_CODE']&quot;/&gt; 
&gt;
&gt;
&gt; If you are using xslt2 you can use the alternative
&gt; &lt;xsl:key name=&quot;k1&quot; match=&quot;ROW&quot; use=&quot;COLUMN[@NAME =
&gt; ('JOBCODE','JC_CODE')]&quot;/&gt;
&gt;
&gt; David
&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;
&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/msg1000307121.html</link>
</item><item>
<title>Re: [xsl] Benefits of xsd-types in XSLT - 11/19/2009 2:24:00 AM</title>
<description><![CDATA[<pre>Hi,

Just a note, as I completely agree on the previous comments about, as 
Dimitri so well puts it, the &quot;quantitative&quot; benefits of strong typing, 
structured type definitions, and type standardization.  I would simply 
like to also highlight some more &quot;qualitative&quot; aspects of XSLT type 
handling, including the support for implicit typing, the fact that 
explicit typing can be used as required, the fact that types can be 
expanded, defined, and checked in a formal process (e.g. schema), as 
well as the good support for type casting, detection, and conversion.  
This whole combination of quantitative and qualitative typing aspects 
and benefits greatly contribute to the power and programming elegance of 
XSLT.

Cheers,
ac


&gt; On Wed, Nov 18, 2009 at 8:33 AM, Jesper Tverskov &lt;jesper@tverskov.dk&gt; wrote:
&gt;   
&gt;&gt; Hi list
&gt;&gt;
&gt;&gt; We often hear that one of the great benefits of using XSLT 2.0 is that
&gt;&gt; it uses the datatypes of XML Schema, most likely the same datatypes as
&gt;&gt; input XML and output XML, making type conversion not necessary.
&gt;&gt;
&gt;&gt; It is easy to understand that the above is important and it is easy to
&gt;&gt; make up small examples like comparing a &quot;date&quot; datatype in XML Schema,
&gt;&gt; C# and Java.
&gt;&gt;
&gt;&gt; But how great a benefit is it really? E.g.: when using XML data
&gt;&gt; binding, the XML Schema datatypes are, as far as I know, automatically
&gt;&gt; converted to the type system of C#, Java, etc. Does such automatic
&gt;&gt; conversion work or must it be fine tuned?
&gt;&gt;
&gt;&gt;     
&gt;
&gt; Sorry, it is not clear what the question really is...
&gt;
&gt;
&gt; One of the biggest advantages of having typed variables (including any
&gt; document, any parameters and results from an xsl:template or from an
&gt; xsl:function) is the static typed checking that will raise errors
&gt; during compile time, vs run time or never raised at all.
&gt;
&gt; Without the typing feature of XPath 2.0/XSLT 2.0 one would need
&gt; type-inference/theorem-prooving just to deduce the types of any
&gt; programming-language item, and in order to fully understand a program
&gt; (even one written by themselves).
&gt;
&gt; Another big benefit is a new, huge opportunity for optimization.
&gt;
&gt; The obvious benefit of this feature is reduced developer time,
&gt; increased quality, safety and performance.
&gt;
&gt; The combination of all of the above results in a quantitative leap
&gt; forward in development technology and programmer's experience. The
&gt; gross benefit goes also to the end user.
&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/msg1000307112.html</link>
</item><item>
<title>Re: [xsl] generating a url to another drive on the local host - 11/19/2009 12:58:00 AM</title>
<description><![CDATA[<pre>Thanks Michael,
Worked like a charm. I have to confess, URL's are not a strong suit with me.
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/msg1000307109.html</link>
</item><item>
<title>Re: [xsl] same prefix, different namespaces (URIs) - 11/19/2009 12:34:00 AM</title>
<description><![CDATA[<pre>&gt; that input happens to use the same prefix with a different URI mapped
&gt; to

why do you think that will matter?
unless you are dealing with edge cases related to use of prefixes in
element or attribute content as opposed to element names, it will not
matter at all. The XSLt will work teh same way whatever prefixes are
used in the source.

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/msg1000307108.html</link>
</item><item>
<title>RE: [xsl] Benefits of xsd-types in XSLT - 11/18/2009 10:41:00 PM</title>
<description><![CDATA[<pre>&gt; 
&gt; We often hear that one of the great benefits of using XSLT 
&gt; 2.0 is that it uses the datatypes of XML Schema, most likely 
&gt; the same datatypes as input XML and output XML, making type 
&gt; conversion not necessary.
&gt; 
&gt; But how great a benefit is it really? 

Well, there are a number of benefits. Firstly, there are many functions and
operators defined on these types - for example all the date and duration
logic depends on them. Of course, this doesn't mean that you have to use a
schema; so long as your values use the lexical forms of these types, you can
always hand-construct the values; but if you do have a schema, it is done
for you.

Secondly, there is type-checking. Some operations don't make sense when
applied to the wrong type of value. With type-checking, your errors are
diagnosed earlier and more precisely, making development faster, and making
the reliability of your code less dependent on the completeness of your test
coverage.

And then there is polymorphism. Comparing &quot;1.2&quot; and &quot;10.2&quot; as strings is not
the same as comparing them as decimals.

Finally, there is optimization. If the system has more compile-time
information about types, then it can make decisions at compile-time that
would otherwise be deferred to run-time, which enables it to generate
tighter code.

But really, you're asking here about the benefits of strong typing versus
weak typing. That's a big debate and you'll get different opinions. The
bottom line is that strong typing finds more of your errors at compile time,
and it also enables the compiler to make more decisions at compile time. 


&gt; E.g.: when using XML 
&gt; data binding, the XML Schema datatypes are, as far as I know, 
&gt; automatically converted to the type system of C#, Java, etc.

I've lost the thread here. I thought we were talking about types as used in
XSLT. Where does data binding come into it? 
 
&gt; I would like to hear some real life cases, showing that 
&gt; xsd-datatypes in XSLT can be a great time-saver when input 
&gt; and output is strongly typed also using XSD, compared with 
&gt; more traditional programming languages?

I'm not sure from this what two things you want to compare - sorry! (Some
traditional programming languages are strongly typed, others aren't - which
did you have in mind?)

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/msg1000307104.html</link>
</item><item>
<title>RE: [xsl] generating a url to another drive on the local host - 11/18/2009 10:31:00 PM</title>
<description><![CDATA[<pre>Never use a scheme name (file:) without a following slash. It's interpreted
as a relative URI reference rather than an absolute URI. $journal-link
should be &quot;file:///X:&quot; (or &quot;file:/X:&quot; - either should work).

(I don't think the expansion is being done by the XSLT processor, though. I
think it's being done by the browser when you click on the link.)

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay   

&gt; -----Original Message-----
&gt; From: Mark Wilson [mailto:mark@knihtisk.org] 
&gt; Sent: 18 November 2009 22:17
&gt; To: xsl-list@lists.mulberrytech.com
&gt; Subject: [xsl] generating a url to another drive on the local host
&gt; 
&gt; In XSLT, I am trying to output to an HTML file the URL 
&gt; &quot;file:///X:/2000-2009/2008/2008_05_SepOct.pdf&quot;
&gt; but the style sheet always inserts the current directory in 
&gt; front of my
&gt; construction:
&gt; 
&gt; &quot;file:///C:/htm/X:/2000-2009/2008/2008_05_SepOct.pdf&quot;
&gt; 
&gt;  &lt;a class=&quot;ref&quot; href=&quot;{concat($journal-link, 
&gt; '/2000-2009/',$year, '/', $year, '_0', $issue, '_', $name)}&quot; 
&gt; target=&quot;_blank&quot;&gt; Sep/Oct 2008 p30&lt;/a&gt;
&gt; 
&gt; where:
&gt; $journal-link = file:X:
&gt; $year = 2008
&gt; $issue = 2008
&gt; $name = SepOct
&gt; 
&gt; What should the data in the XSLT construction look like to 
&gt; get rid of the insertion of the current directory?
&gt; Thanks,
&gt; Mark 
&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/msg1000307103.html</link>
</item><item>
<title>[xsl] generating a url to another drive on the local host - 11/18/2009 10:18:00 PM</title>
<description><![CDATA[<pre>In XSLT, I am trying to output to an HTML file the URL
&quot;file:///X:/2000-2009/2008/2008_05_SepOct.pdf&quot;
but the style sheet always inserts the current directory in front of my 
construction:

&quot;file:///C:/htm/X:/2000-2009/2008/2008_05_SepOct.pdf&quot;

 &lt;a class=&quot;ref&quot; href=&quot;{concat($journal-link, '/2000-2009/',$year, '/', 
$year, '_0', $issue, '_', $name)}&quot; target=&quot;_blank&quot;&gt; Sep/Oct 2008 p30&lt;/a&gt;

where:
$journal-link = file:X:
$year = 2008
$issue = 2008
$name = SepOct

What should the data in the XSLT construction look like to get rid of the 
insertion of the current directory?
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/msg1000307102.html</link>
</item><item>
<title>Re: [xsl] Benefits of xsd-types in XSLT - 11/18/2009 8:18:00 PM</title>
<description><![CDATA[<pre>On Wed, Nov 18, 2009 at 8:33 AM, Jesper Tverskov &lt;jesper@tverskov.dk&gt; wrote:
&gt; Hi list
&gt;
&gt; We often hear that one of the great benefits of using XSLT 2.0 is that
&gt; it uses the datatypes of XML Schema, most likely the same datatypes as
&gt; input XML and output XML, making type conversion not necessary.
&gt;
&gt; It is easy to understand that the above is important and it is easy to
&gt; make up small examples like comparing a &quot;date&quot; datatype in XML Schema,
&gt; C# and Java.
&gt;
&gt; But how great a benefit is it really? E.g.: when using XML data
&gt; binding, the XML Schema datatypes are, as far as I know, automatically
&gt; converted to the type system of C#, Java, etc. Does such automatic
&gt; conversion work or must it be fine tuned?
&gt;

Sorry, it is not clear what the question really is...


One of the biggest advantages of having typed variables (including any
document, any parameters and results from an xsl:template or from an
xsl:function) is the static typed checking that will raise errors
during compile time, vs run time or never raised at all.

Without the typing feature of XPath 2.0/XSLT 2.0 one would need
type-inference/theorem-prooving just to deduce the types of any
programming-language item, and in order to fully understand a program
(even one written by themselves).

Another big benefit is a new, huge opportunity for optimization.

The obvious benefit of this feature is reduced developer time,
increased quality, safety and performance.

The combination of all of the above results in a quantitative leap
forward in development technology and programmer's experience. The
gross benefit goes also to the end user.



-- 
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





&gt; I would like to hear some real life cases, showing that xsd-datatypes
&gt; in XSLT can be a great time-saver when input and output is strongly
&gt; typed also using XSD, compared with more traditional programming
&gt; languages?
&gt;
&gt; Cheers,
&gt; Jesper Tverskov
&gt;
&gt; http://www.xmlkurser.dk
&gt; http://www.xmlplease.com
&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/msg1000307099.html</link>
</item><item>
<title>[xsl] Benefits of xsd-types in XSLT - 11/18/2009 4:33:00 PM</title>
<description><![CDATA[<pre>Hi list

We often hear that one of the great benefits of using XSLT 2.0 is that
it uses the datatypes of XML Schema, most likely the same datatypes as
input XML and output XML, making type conversion not necessary.

It is easy to understand that the above is important and it is easy to
make up small examples like comparing a &quot;date&quot; datatype in XML Schema,
C# and Java.

But how great a benefit is it really? E.g.: when using XML data
binding, the XML Schema datatypes are, as far as I know, automatically
converted to the type system of C#, Java, etc. Does such automatic
conversion work or must it be fine tuned?

I would like to hear some real life cases, showing that xsd-datatypes
in XSLT can be a great time-saver when input and output is strongly
typed also using XSD, compared with more traditional programming
languages?

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/msg1000307093.html</link>
</item><item>
<title>Re: [xsl] same prefix, different namespaces (URIs) - 11/18/2009 3:52:00 PM</title>
<description><![CDATA[<pre>&gt; 2009/11/18 Heiko Niemann &lt;kontakt@heiko-niemann.de&gt;:
&gt;&gt; Hello,
&gt;&gt;
&gt;&gt; I need/want to use the same prefix in the result document as in the
&gt;&gt; source
&gt;&gt; document, but those prefixes need to be mapped to different URIs.
&gt;&gt;
&gt;&gt; Sample for prefix 'nsn':
&gt;&gt;
&gt;&gt; source document
&gt;&gt;
&gt;&gt; &lt;source xmlns=&quot;http://foo.org&quot; xmlns:nsn=&quot;http://foo.org/1999&quot;&gt;
&gt;&gt; &#160;&lt;nsn:data&gt;hello&lt;/nsn:data&gt;
&gt;&gt; &lt;/source&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; result document
&gt;&gt;
&gt;&gt; &lt;source xmlns=&quot;http://foo.org&quot; xmlns:nsn=&quot;http://foo.org/2009&quot;&gt;
&gt;&gt; &#160;&lt;nsn:item&gt;hello&lt;/nsn:item&gt;
&gt;&gt; &lt;/source&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; Is it possible (as shown here) to map the nsn:data element to nsn:item
&gt;&gt; element?
&gt;
&gt; It doesn't really matter what prefix you use in the stylesheet for the
&gt; input namespace, so below I use &quot;nsn99&quot; for that, which frees up &quot;nsn&quot;
&gt; to be used in the output:
&gt;
&gt; &lt;xsl:stylesheet version=&quot;2.0&quot;
&gt;   xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
&gt;   xmlns=&quot;http://foo.org&quot;
&gt;   xmlns:nsn99=&quot;http://foo.org/1999&quot;
&gt;   xmlns:nsn=&quot;http://foo.org/2009&quot;
&gt;   exclude-result-prefixes=&quot;nsn99&quot;&gt;
&gt;
&gt; &lt;xsl:template match=&quot;@*|node()&quot;&gt;
&gt;     &lt;xsl:copy copy-namespaces=&quot;no&quot;&gt;
&gt;         &lt;xsl:apply-templates select=&quot;@*|node()&quot;/&gt;
&gt;     &lt;/xsl:copy&gt;
&gt; &lt;/xsl:template&gt;
&gt;
&gt; &lt;xsl:template match=&quot;nsn99:data&quot;&gt;
&gt; 	&lt;nsn:item&gt;
&gt; 		&lt;xsl:apply-templates select=&quot;@*|node()&quot;/&gt;
&gt; 	&lt;/nsn:item&gt;
&gt; &lt;/xsl:template&gt;
&gt;
&gt; &lt;/xsl:stylesheet&gt;
&gt;


The source document would be exactly the way I posted it - out of my
control. E.g. it could be the result (simplified) of a web service which I
want to transform to an input for a different web service. That input
happens to use the same prefix with a different URI mapped to. So both
document formats are out of my control. So I wonder, whether I can
accomplish what I want in one step?

Heiko


--~------------------------------------------------------------------
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/msg1000307091.html</link>
</item><item>
<title>Re: [xsl] same prefix, different namespaces (URIs) - 11/18/2009 3:24:00 PM</title>
<description><![CDATA[<pre>2009/11/18 Heiko Niemann &lt;kontakt@heiko-niemann.de&gt;:
&gt; Hello,
&gt;
&gt; I need/want to use the same prefix in the result document as in the source
&gt; document, but those prefixes need to be mapped to different URIs.
&gt;
&gt; Sample for prefix 'nsn':
&gt;
&gt; source document
&gt;
&gt; &lt;source xmlns=&quot;http://foo.org&quot; xmlns:nsn=&quot;http://foo.org/1999&quot;&gt;
&gt; &#160;&lt;nsn:data&gt;hello&lt;/nsn:data&gt;
&gt; &lt;/source&gt;
&gt;
&gt;
&gt; result document
&gt;
&gt; &lt;source xmlns=&quot;http://foo.org&quot; xmlns:nsn=&quot;http://foo.org/2009&quot;&gt;
&gt; &#160;&lt;nsn:item&gt;hello&lt;/nsn:item&gt;
&gt; &lt;/source&gt;
&gt;
&gt;
&gt; Is it possible (as shown here) to map the nsn:data element to nsn:item
&gt; element?

It doesn't really matter what prefix you use in the stylesheet for the
input namespace, so below I use &quot;nsn99&quot; for that, which frees up &quot;nsn&quot;
to be used in the output:

&lt;xsl:stylesheet version=&quot;2.0&quot;
  xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
  xmlns=&quot;http://foo.org&quot;
  xmlns:nsn99=&quot;http://foo.org/1999&quot;
  xmlns:nsn=&quot;http://foo.org/2009&quot;
  exclude-result-prefixes=&quot;nsn99&quot;&gt;

&lt;xsl:template match=&quot;@*|node()&quot;&gt;
    &lt;xsl:copy copy-namespaces=&quot;no&quot;&gt;
        &lt;xsl:apply-templates select=&quot;@*|node()&quot;/&gt;
    &lt;/xsl:copy&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match=&quot;nsn99:data&quot;&gt;
	&lt;nsn:item&gt;
		&lt;xsl:apply-templates select=&quot;@*|node()&quot;/&gt;	
	&lt;/nsn:item&gt;	
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&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/msg1000307090.html</link>
</item><item>
<title>[xsl] same prefix, different namespaces (URIs) - 11/18/2009 3:04:00 PM</title>
<description><![CDATA[<pre>Hello,

I need/want to use the same prefix in the result document as in the source
document, but those prefixes need to be mapped to different URIs.

Sample for prefix 'nsn':

source document

&lt;source xmlns=&quot;http://foo.org&quot; xmlns:nsn=&quot;http://foo.org/1999&quot;&gt;
  &lt;nsn:data&gt;hello&lt;/nsn:data&gt;
&lt;/source&gt;


result document

&lt;source xmlns=&quot;http://foo.org&quot; xmlns:nsn=&quot;http://foo.org/2009&quot;&gt;
  &lt;nsn:item&gt;hello&lt;/nsn:item&gt;
&lt;/source&gt;


Is it possible (as shown here) to map the nsn:data element to nsn:item
element?

Thanks for your help.

Heiko




--~------------------------------------------------------------------
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/msg1000307089.html</link>
</item><item>
<title>Re: [xsl] Break functionality  in XSL - 11/18/2009 2:24:00 PM</title>
<description><![CDATA[<pre>&gt; &lt;xsl:key name=&quot;k1&quot; match=&quot;ROW&quot; use=&quot;COLUMN[@NAME = 
&gt; 'JOBCODE'],COLUMN[@NAME = 'JC_CODE']&quot;/&gt; like this?

use has to be a match pattern so you can't use , you can use | though.

&lt;xsl:key name=&quot;k1&quot; match=&quot;ROW&quot; use=&quot;COLUMN[@NAME = 
 'JOBCODE'] | COLUMN[@NAME = 'JC_CODE']&quot;/&gt; 


If you are using xslt2 you can use the alternative
&lt;xsl:key name=&quot;k1&quot; match=&quot;ROW&quot; use=&quot;COLUMN[@NAME =
('JOBCODE','JC_CODE')]&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/msg1000307087.html</link>
</item><item>
<title>Re: [xsl] Break functionality  in XSL - 11/18/2009 1:46:00 PM</title>
<description><![CDATA[<pre>Hi,

is this possible to have a key with two attributes.

&lt;xsl:key name=&quot;k1&quot; match=&quot;ROW&quot; use=&quot;COLUMN[@NAME = 
'JOBCODE'],COLUMN[@NAME = 'JC_CODE']&quot;/&gt; like this?

Please suggest me on this.

-Anil



Anil Kumar Veeramalli wrote:
&gt; Thanks a lot Martin.
&gt; -Anil
&gt; Martin Honnen wrote:
&gt;&gt;  
&gt;&gt; You can define a key on the ROW elements:
&gt;&gt;    &lt;xsl:key name=&quot;k1&quot; match=&quot;ROW&quot; use=&quot;COLUMN[@NAME = 'JOBCODE']&quot;/&gt;
&gt;&gt; then key('k1', 'P10') gives you a node-set of the ROW elements with 
&gt;&gt; that key value, then you can sort that by the date in descending 
&gt;&gt; order and only take the description of the first ROW:
&gt;&gt;
&gt;&gt; &lt;xsl:stylesheet
&gt;&gt;   xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
&gt;&gt;   xmlns:data=&quot;http://example.com/2009/data&quot;
&gt;&gt;   exclude-result-prefixes=&quot;data&quot;
&gt;&gt;   version=&quot;1.0&quot;&gt;
&gt;&gt;
&gt;&gt;   &lt;xsl:param name=&quot;jobcode&quot; select=&quot;'P10'&quot;/&gt;
&gt;&gt;
&gt;&gt;   &lt;xsl:key name=&quot;k1&quot; match=&quot;ROW&quot; use=&quot;COLUMN[@NAME = 'JOBCODE']&quot;/&gt;
&gt;&gt;
&gt;&gt;   &lt;xsl:output method=&quot;text&quot;/&gt;
&gt;&gt;
&gt;&gt;   &lt;data:data xmlns=&quot;&quot;&gt;
&gt;&gt;     &lt;month key=&quot;Jan&quot; value=&quot;01&quot;/&gt;
&gt;&gt;     &lt;month key=&quot;Feb&quot; value=&quot;02&quot;/&gt;
&gt;&gt;     &lt;month key=&quot;Mar&quot; value=&quot;03&quot;/&gt;
&gt;&gt;     &lt;month key=&quot;Apr&quot; value=&quot;04&quot;/&gt;
&gt;&gt;     &lt;month key=&quot;May&quot; value=&quot;05&quot;/&gt;
&gt;&gt;     &lt;month key=&quot;Jun&quot; value=&quot;06&quot;/&gt;
&gt;&gt;     &lt;month key=&quot;Jul&quot; value=&quot;07&quot;/&gt;
&gt;&gt;     &lt;month key=&quot;Aug&quot; value=&quot;08&quot;/&gt;
&gt;&gt;     &lt;month key=&quot;Sep&quot; value=&quot;09&quot;/&gt;
&gt;&gt;     &lt;month key=&quot;Oct&quot; value=&quot;10&quot;/&gt;
&gt;&gt;     &lt;month key=&quot;Nov&quot; value=&quot;11&quot;/&gt;
&gt;&gt;     &lt;month key=&quot;Dec&quot; value=&quot;12&quot;/&gt;
&gt;&gt;   &lt;/data:data&gt;
&gt;&gt;
&gt;&gt;   &lt;xsl:template match=&quot;/&quot;&gt;
&gt;&gt;     &lt;xsl:for-each select=&quot;key('k1', $jobcode)&quot;&gt;
&gt;&gt;       &lt;xsl:sort select=&quot;concat(
&gt;&gt;         substring(COLUMN[@NAME = 'EFFDT'], 8, 4),
&gt;&gt;         '-',
&gt;&gt;         document('')/xsl:stylesheet/data:data/month[@key = 
&gt;&gt; substring(COLUMN[@NAME = 'EFFDT'], 4, 3)]/@value,
&gt;&gt;         '-',
&gt;&gt;         substring(COLUMN[@NAME = 'EFFDT'], 1, 2))&quot;
&gt;&gt;         order=&quot;descending&quot;/&gt;
&gt;&gt;       &lt;xsl:if test=&quot;position() = 1&quot;&gt;
&gt;&gt;         &lt;xsl:value-of select=&quot;COLUMN[@NAME = 'DESCR']&quot;/&gt;
&gt;&gt;       &lt;/xsl:if&gt;
&gt;&gt;     &lt;/xsl:for-each&gt;
&gt;&gt;   &lt;/xsl:template&gt;
&gt;&gt;
&gt;&gt; &lt;/xsl:stylesheet&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; The only problem is dealing with that date format, you can't sort on 
&gt;&gt; that directly, you need to extract the components and bring them into 
&gt;&gt; a yyyy-mm-dd format that can be sorted as a string. The stylesheet 
&gt;&gt; above does that.
&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/200911/msg1000307085.html</link>
</item><item>
<title>Re: [xsl] Why is copy-namespaces=&quot;no&quot; required? - 11/18/2009 1:22:00 PM</title>
<description><![CDATA[<pre>&gt; But this doesn't perform the filtering to ensure that complexType name=&quot;foo&quot;
&gt;  is copied only once when in more than one input file, does it?

no but you can put the filters back on: I missed them off so as not to
overstress my typing ability

or you can do

&lt;xsl:for-each-group select=&quot;$docs/xs:schema/xs:complexType&quot;
group-by=&quot;@name&quot;&gt;
&lt;xsl:copy-of select=&quot;.&quot;/&gt;
&lt;/xsl:for-each-group&gt;

If you only want one of each name.

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/msg1000307084.html</link>
</item><item>
<title>Re: [xsl] Why is copy-namespaces=&quot;no&quot; required? - 11/18/2009 12:54:00 PM</title>
<description><![CDATA[<pre>&gt; On Wed, Nov 18, 2009 at 1:36 PM, David Carlisle &lt;davidc@nag.co.uk&gt; wrote:

 Thanks for the namespace explanation.

&gt;
&gt; &gt; Is there a simple way of passing in a list of N pathnames in a param
&gt;
&gt; &lt;xsl:param name=&quot;doclist&quot;/&gt;
&gt; &lt;xsl:variable name=&quot;docs&quot; select=&quot;
&gt; for $d in tokenize($doclist,'\s+') return doc($d)&quot;/&gt;
&gt;
&gt; then &#160;&lt;xsl:copy-of select=&quot;$docs/xs:schema/xs:complexType &quot;
&gt; would copy all the complex type elements from all the documents.
&gt;

 But this doesn't perform the filtering to ensure that complexType name=&quot;foo&quot;
 is copied only once when in more than one input file, does it?
-W

&gt;
&gt; David

--~------------------------------------------------------------------
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/msg1000307080.html</link>
</item><item>
<title>Re: [xsl] Why is copy-namespaces=&quot;no&quot; required? - 11/18/2009 12:37:00 PM</title>
<description><![CDATA[<pre>&gt; Why is copy-namespaces=&quot;no&quot; required to avoid duplication of namespace
&gt; declarations

because you have used

 &lt;xsl:element name=&quot;{name(.)}&quot; namespace=&quot;{namespace-uri(.)}&quot;&gt;
rather than simply
&lt;xsl:copy&gt;
to generate the parent element this means that the only namespace node
on the parent is the one bound to xs: so when you copy the children
any other namespaces that are copied have to be declared on each child.
If you only want then declared once you need them to be in scope on the
parent and &lt;xsl:element name=&quot;{name(.)}&quot; namespace=&quot;{namespace-uri(.)}&quot;&gt;
is essentially the xslt 1 vesrsion of copy-namespaces=&quot;no&quot; and explictly
does not copy namespaces.


&gt; Is there a simple way of passing in a list of N pathnames in a param

If you are calling it from the java spi then you can construct any XDM
value and pass it in, from teh command line do


saxon a.xml style.xsl doclist=&quot;1.xml 2.xml 3.xml&quot;

then you can do
&lt;xsl:param name=&quot;doclist&quot;/&gt;
&lt;xsl:variable name=&quot;docs&quot; select=&quot;
for $d in tokenize($doclist,'\s+') return doc($d)&quot;/&gt;

then  &lt;xsl:copy-of select=&quot;$docs/xs:schema/xs:complexType &quot;
would copy all the complex type elements from all the documents.

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/msg1000307079.html</link>
</item><item>
<title>[xsl] Why is copy-namespaces=&quot;no&quot; required? - 11/18/2009 12:25:00 PM</title>
<description><![CDATA[<pre>I've come up with a stylesheet which merges 2 XML schemas, copying
only one definition of each type (based on its @name) into the result
document. Both input schemas have exactly the same namespace
definitions. I'm using ssaxonhe9-2-0-2j

&lt;xsl:variable name=&quot;db1&quot; select=&quot;/&quot; /&gt;
&lt;xsl:variable name=&quot;db2&quot; select=&quot;document($other)&quot; /&gt;

&lt;xsl:variable name=&quot;db1complex&quot; select=&quot;$db1/xs:schema/xs:complexType/@name&quot; /&gt;
&lt;xsl:variable name=&quot;db1simple&quot;&#160; select=&quot;$db1/xs:schema/xs:simpleType/@name&quot; /&gt;

&lt;xsl:template match=&quot;/&quot;&gt;
&#160; &lt;xsl:result-document href=&quot;comcom.xsd&quot;&gt;
&#160;&#160;&#160; &lt;xsl:apply-templates/&gt;
&#160;&lt;/xsl:result-document&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match=&quot;xs:schema&quot;&gt;
&#160; &lt;xsl:element name=&quot;{name(.)}&quot; namespace=&quot;{namespace-uri(.)}&quot;&gt;
&#160;&#160;&#160; &lt;xsl:copy-of select=&quot;@* | *&quot; copy-namespaces=&quot;no&quot;/&gt;
&#160;&#160;&#160; &lt;xsl:copy-of select=&quot;$db2/xs:schema/xs:complexType[not(@name =
$db1complex)]&quot; copy-namespaces=&quot;no&quot; /&gt;
&#160;&#160;&#160; &lt;xsl:copy-of select=&quot;$db2/xs:schema/xs:simpleType[not(@name =
$db1simple)]&quot; copy-namespaces=&quot;no&quot; /&gt;
&#160; &lt;/xsl:element&gt;
&lt;/xsl:template&gt;

Why is copy-namespaces=&quot;no&quot; required to avoid duplication of namespace
declarations in the copied *Type elements?

Is there a simple way of passing in a list of N pathnames in a param
and perform this merge for all N Schemas in one go? (Right now I'm
using shell glue to execute this repeatedly, and I'd be content with
that, unless it's really simple.)

Best
-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/msg1000307078.html</link>
</item><item>
<title>[xsl] instance a template from xsl:for-each-group - 11/17/2009 8:30:00 PM</title>
<description><![CDATA[<pre>Hello XSL-list,

I want to do a conversion from WordML to Docbook. I have the following 
xsl (as a sample):

&lt;xsl:template match=&quot;w:body&quot;&gt;
        &lt;chapter&gt;
            &lt;xsl:call-template name=&quot;chapter&quot;/&gt;
        &lt;/chapter&gt;
    &lt;/xsl:template&gt;

    &lt;xsl:template name=&quot;chapter&quot;&gt;
        &lt;xsl:param name=&quot;levelnr&quot; select=&quot;1&quot;/&gt;
        &lt;xsl:param name=&quot;nodes&quot; select=&quot;*&quot;/&gt;
        &lt;xsl:for-each-group select=&quot;$nodes&quot;
            
group-starting-with=&quot;*[descendant-or-self::*[@w:val=concat('heading',$levelnr)]]&quot;&gt;
            &lt;xsl:choose&gt;
                &lt;xsl:when
                    
test=&quot;current-group()[descendant-or-self::*[@w:val=concat('heading',$levelnr)]]&quot;&gt;
                    &lt;xsl:element name=&quot;sect{$levelnr}&quot;&gt;
                        &lt;xsl:apply-templates select=&quot;node()&quot;/&gt;
                        &lt;xsl:choose&gt;
                            &lt;xsl:when 
test=&quot;not(current-group()[position()&gt;1])&quot;&gt;
                                &lt;xsl:apply-templates 
select=&quot;current-group()&quot;/&gt;
                            &lt;/xsl:when&gt;
                            &lt;xsl:otherwise&gt;
                                &lt;xsl:call-template name=&quot;chapter&quot;&gt;
                                    &lt;xsl:with-param name=&quot;levelnr&quot; 
select=&quot;$levelnr+1&quot;/&gt;
                                    &lt;xsl:with-param name=&quot;nodes&quot; 
select=&quot;current-group()[position!=1]&quot;/&gt;
                                &lt;/xsl:call-template&gt;
                            &lt;/xsl:otherwise&gt;
                        &lt;/xsl:choose&gt;
                    &lt;/xsl:element&gt;
                &lt;/xsl:when&gt;
            &lt;/xsl:choose&gt;
        &lt;/xsl:for-each-group&gt;
    &lt;/xsl:template&gt;

    &lt;xsl:template match=&quot;w:p[descendant-or-self::*[@w:val='paragraph']]&quot;&gt;
        &lt;para&gt;
            &lt;xsl:apply-templates/&gt;
        &lt;/para&gt;
    &lt;/xsl:template&gt;

I need to instance the third template from the &lt;xsl:apply-templates 
select=&quot;current-group()&quot;/&gt; inside the second template.
I hope this problem could be solved without pasting the source xml -- 
this would be to long (WordML).


Thanks in advance
Andreas

--~------------------------------------------------------------------
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/msg1000307049.html</link>
</item><item>
<title>Re: [xsl] measuring performance of XSLT stylesheet - 11/17/2009 5:51:00 PM</title>
<description><![CDATA[<pre>a kusa wrote:

  Hi,

&gt; Additionally, are there any particular tags that I must be
&gt; avoiding to improve performance?  I know using &quot;//&quot; is not
&gt; advisable.

  This is an interesting one.  Actually, using //elem instead of
/root/elem1/elem2/elem is more efficient on (at least one) XML
database (out of any context, the semantics is not the same,
right, but that's an advice I am used to hear, which is not always
true.)

  You can try to find out why, and you can argue that this is
because of XQuery taking advantage of the indexing of the XML
database, which is not available to the XSLT 2.0 processor in top
of this XML database (but I bet this won't be true for a long
time.)  But the point is that no such rule about efficiency is
absolute, and as Mike said, only measurement in &quot;real&quot; situations
can give you some clues about optimization opportunities.

  Hope that helps.  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/msg1000307041.html</link>
</item><item>
<title>Re: [xsl] multiple elements to use for grouping - 11/17/2009 1:02:00 PM</title>
<description><![CDATA[<pre>HI, thanks to Martin, I have my solution. -- Dorothy

--~------------------------------------------------------------------
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/msg1000307028.html</link>
</item><item>
<title>Re: [xsl] measuring performance of XSLT stylesheet - 11/16/2009 8:24:00 PM</title>
<description><![CDATA[<pre>Thank you so much for all your tips.

Additionally, are there any particular tags that I must be avoiding to
improve performance?

I know using &quot;//&quot; is not advisable. Any other tags that I should be avoiding?

On Mon, Nov 16, 2009 at 1:34 PM, Michael Kay &lt;mike@saxonica.com&gt; wrote:
&gt;&gt;
&gt;&gt; &gt; Any tips on improving performance will also be helpful.
&gt;&gt;
&gt;&gt; To state the obvious, you should measure using the processor,
&gt;&gt; stylesheet, and data that you will be using in real life.
&gt;&gt; They will affect the outcome far more than will any
&gt;&gt; generalisations that we can give.
&gt;
&gt; Tony has given the most important piece of advice without actually spelling
&gt; it out: concentrate on measuring and understanding the performance you are
&gt; getting, and the improvements will follow naturally. Never try to make
&gt; improvements until you have a measurement framework in place. Expect to
&gt; spend 90% of your effort on measuring performance and 10% on improving it.
&gt;
&gt; Some tips on measurement:
&gt;
&gt; (a) make sure you distinguish/discount Java VM warmup time, stylesheet
&gt; compilation time, document parsing/building time, transformation time, and
&gt; serialization time. Any or all of these components may be of importance to
&gt; you, but some of them can probably be discounted in production applications,
&gt; so you need to discount them in your measurements.
&gt;
&gt; (b) if you're going to measure Saxon from the command line, use the -t and
&gt; -repeat options, as well as -TP for profiling.
&gt;
&gt; (c) measure with different source document sizes and plot how performance
&gt; varies with document size. This tells you a lot about the performance
&gt; characteristics of your code. If the performance is quadratic, look for
&gt; expensive predicates and try to replace them with keys.
&gt;
&gt; (d) use metrics that relate to your performance requirements, so you know
&gt; when to declare success.
&gt;
&gt; Regards,
&gt;
&gt; Michael Kay
&gt; http://www.saxonica.com/
&gt; http://twitter.com/michaelhkay
&gt;
&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;
&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/msg1000306983.html</link>
</item><item>
<title>Re: [xsl] Merging two XML files - 11/16/2009 8:20:00 PM</title>
<description><![CDATA[<pre>1) Process fileA using the identity transform
2) In the &lt;record&gt; template, key into fileB using the title, where the
key matches &quot;record&quot; and uses &quot;title&quot;
3) Copy the name and url elements, or *[not(self::title)]

cheers
andrew

2009/11/16 Mak, Lucas Wing Kau &lt;makw@mail.lib.msu.edu&gt;:
&gt; I want to merge two XML files (i.e. fileA &amp; fileB below) by matching the values in their &lt;title&gt; elements and grabbing everything from fileA, but only the &lt;url&gt; element from fileB.
&gt;
&gt; fileA
&gt; &lt;collection&gt;
&gt; &#160; &#160; &#160; &#160;&lt;record&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;title&gt;abc&lt;/title&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;name&gt;peter&lt;/name&gt;
&gt; &#160; &#160; &#160; &#160;&lt;/record&gt;
&gt; &#160; &#160; &#160; &#160;&lt;record&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;title&gt;def&lt;/title&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;name&gt;jack&lt;/name&gt;
&gt; &#160; &#160; &#160; &#160;&lt;/record&gt;
&gt; &#160; &#160; &#160; &#160;&lt;record&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;title&gt;ghi&lt;/title&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;name&gt;john&lt;/name&gt;
&gt; &#160; &#160; &#160; &#160;&lt;/record&gt;
&gt; &lt;/collection&gt;
&gt;
&gt; fileB
&gt; &lt;collection&gt;
&gt; &#160; &#160; &#160; &#160;&lt;record&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;title&gt;abc&lt;/title&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;date&gt;11/23/2008&lt;/date&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;url&gt;http://no.com&lt;/url&gt;
&gt; &#160; &#160; &#160; &#160;&lt;/record&gt;
&gt; &#160; &#160; &#160; &#160;&lt;record&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;title&gt;ghi&lt;/title&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;date&gt;12/12/2007&lt;/date&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;url&gt;http://hello.com&lt;/url&gt;
&gt; &#160; &#160; &#160; &#160;&lt;/record&gt;
&gt; &#160; &#160; &#160; &#160;&lt;record&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;title&gt;cmyk&lt;/title&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;date&gt;10/12/2006&lt;/date&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;url&gt;http://hi.com&lt;/url&gt;
&gt; &#160; &#160; &#160; &#160;&lt;/record&gt;
&gt; &lt;/collection&gt;
&gt;
&gt; Output XML
&gt; &lt;collection&gt;
&gt; &#160; &#160; &#160; &#160;&lt;record&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;title&gt;abc&lt;/title&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;name&gt;peter&lt;/name&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;url&gt;http://no.com&lt;/url&gt;
&gt; &#160; &#160; &#160; &#160;&lt;/record&gt;
&gt; &#160; &#160; &#160; &#160;&lt;record&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;title&gt;ghi&lt;/title&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;name&gt;john&lt;/name&gt;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;url&gt;http://hello.com&lt;/url&gt;
&gt; &#160; &#160; &#160; &#160;&lt;/record&gt;
&gt; &lt;/collection&gt;
&gt;
&gt; How I can do it? I am using XSLT 1.0 since I am more familiar with 1.0 (though my processor also support 2.0)
&gt;
&gt; Thanks in advance.
&gt;
&gt; Wing (makw@msu.edu)
&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/200911/msg1000306982.html</link>
</item><item>
<title>[xsl] Merging two XML files - 11/16/2009 7:42:00 PM</title>
<description><![CDATA[<pre>I want to merge two XML files (i.e. fileA &amp; fileB below) by matching the values in their &lt;title&gt; elements and grabbing everything from fileA, but only the &lt;url&gt; element from fileB.

fileA
&lt;collection&gt;
	&lt;record&gt;
		&lt;title&gt;abc&lt;/title&gt;
		&lt;name&gt;peter&lt;/name&gt;
	&lt;/record&gt;
	&lt;record&gt;
		&lt;title&gt;def&lt;/title&gt;
		&lt;name&gt;jack&lt;/name&gt;
	&lt;/record&gt;
	&lt;record&gt;
		&lt;title&gt;ghi&lt;/title&gt;
		&lt;name&gt;john&lt;/name&gt;
	&lt;/record&gt;
&lt;/collection&gt;

fileB
&lt;collection&gt;
	&lt;record&gt;
		&lt;title&gt;abc&lt;/title&gt;
		&lt;date&gt;11/23/2008&lt;/date&gt;
		&lt;url&gt;http://no.com&lt;/url&gt;
	&lt;/record&gt;
	&lt;record&gt;
		&lt;title&gt;ghi&lt;/title&gt;
		&lt;date&gt;12/12/2007&lt;/date&gt;
		&lt;url&gt;http://hello.com&lt;/url&gt;
	&lt;/record&gt;
	&lt;record&gt;
		&lt;title&gt;cmyk&lt;/title&gt;
		&lt;date&gt;10/12/2006&lt;/date&gt;
		&lt;url&gt;http://hi.com&lt;/url&gt;
	&lt;/record&gt;
&lt;/collection&gt;

Output XML
&lt;collection&gt;
	&lt;record&gt;
		&lt;title&gt;abc&lt;/title&gt;
		&lt;name&gt;peter&lt;/name&gt;
		&lt;url&gt;http://no.com&lt;/url&gt;
	&lt;/record&gt;
	&lt;record&gt;
		&lt;title&gt;ghi&lt;/title&gt;
		&lt;name&gt;john&lt;/name&gt;
		&lt;url&gt;http://hello.com&lt;/url&gt;
	&lt;/record&gt;
&lt;/collection&gt;

How I can do it? I am using XSLT 1.0 since I am more familiar with 1.0 (though my processor also support 2.0)

Thanks in advance.

Wing (makw@msu.edu)

--~------------------------------------------------------------------
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/msg1000306979.html</link>
</item><item>
<title>RE: [xsl] measuring performance of XSLT stylesheet - 11/16/2009 7:35:00 PM</title>
<description><![CDATA[<pre>&gt; 
&gt; &gt; Any tips on improving performance will also be helpful.
&gt; 
&gt; To state the obvious, you should measure using the processor, 
&gt; stylesheet, and data that you will be using in real life.  
&gt; They will affect the outcome far more than will any 
&gt; generalisations that we can give.

Tony has given the most important piece of advice without actually spelling
it out: concentrate on measuring and understanding the performance you are
getting, and the improvements will follow naturally. Never try to make
improvements until you have a measurement framework in place. Expect to
spend 90% of your effort on measuring performance and 10% on improving it.

Some tips on measurement:

(a) make sure you distinguish/discount Java VM warmup time, stylesheet
compilation time, document parsing/building time, transformation time, and
serialization time. Any or all of these components may be of importance to
you, but some of them can probably be discounted in production applications,
so you need to discount them in your measurements.

(b) if you're going to measure Saxon from the command line, use the -t and
-repeat options, as well as -TP for profiling.

(c) measure with different source document sizes and plot how performance
varies with document size. This tells you a lot about the performance
characteristics of your code. If the performance is quadratic, look for
expensive predicates and try to replace them with keys.

(d) use metrics that relate to your performance requirements, so you know
when to declare success.

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/msg1000306978.html</link>
</item><item>
<title>Re: [xsl] measuring performance of XSLT stylesheet - 11/16/2009 6:57:00 PM</title>
<description><![CDATA[<pre>On Mon, Nov 16 2009 17:10:41 +0000, akusa8@gmail.com wrote:
&gt; Is there any tool or any method to measure the performance of the
&gt; stylesheet (xslt)?

Saxon and xsltproc both have their own profiling mechanism, and IDEs
such as &lt;oXygen/&gt;, etc., support profiling to find the &quot;hotspots&quot;.  See
http://www.menteithconsulting.com/wiki/TestingXSLT#Profilers for more
information.

&gt; Any tips on improving performance will also be helpful.

To state the obvious, you should measure using the processor,
stylesheet, and data that you will be using in real life.  They will
affect the outcome far more than will any generalisations that we can
give.

Regards,


Tony Graham                         Tony.Graham@MenteithConsulting.com
Director                                  W3C XSL FO SG Invited Expert
Menteith Consulting Ltd                               XML Guild member
XML, XSL and XSLT consulting, programming and training
Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
Registered in Ireland - No. 428599   http://www.menteithconsulting.com
  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
xmlroff XSL Formatter                               http://xmlroff.org
xslide Emacs mode                  http://www.menteith.com/wiki/xslide
Unicode: A Primer                               urn:isbn:0-7645-4625-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/200911/msg1000306973.html</link>
</item><item>
<title>Re: [xsl] reversing dictionary in xml - 11/16/2009 6:16:00 PM</title>
<description><![CDATA[<pre>Would you really expect any useful answers for a very ambigouos &quot;problem&quot;?


-- 
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, Nov 16, 2009 at 5:31 AM, Robert Ee &lt;eerobert24@yahoo.com&gt; wrote:
&gt; Dear experts,
&gt;
&gt;
&gt; I am working on a bilingual dictionary (language A- language B) file, which I need to reverse to a B-A file.
&gt; (Some people may recognise Dutch and English in this example.)
&gt;
&gt; I found out how to make a rough conversion by means of xsl, by copying from replies to other questions.
&gt;
&gt; However, I cannot implement my requests. For one thing, think I have to make two keys in order to put the exemplifying sentences in the right place.
&gt;
&gt; Hope that you can help me out!
&gt;
&gt; Robert
&gt;
&gt; The xml file is as follows:
&gt;
&gt; &lt;dictionary&gt;
&gt; &#194;&#160;&lt;lem&gt;
&gt; &lt;LEMID&gt;17688&lt;/LEMID&gt;
&gt; &lt;HEADW&gt;obscuur&lt;/HEADW&gt;
&gt; &lt;GRAMT&gt;adj&lt;/GRAMT&gt;
&gt; &#194;&#160;&lt;meaning &#194;&#160;id='BNT-19'&gt;
&gt; &#194;&#160;&lt;BETNR&gt;1&lt;/BETNR&gt;
&gt; &#194;&#160; &#194;&#160;&lt;trn&gt;
&gt; &#194;&#160; &#194;&#160; &lt;mtrn&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160;&lt;MTRANS&gt;dark&lt;/MTRANS&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160;&lt;GRAMV&gt;-er&lt;/GRAMV&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160;&lt;REVRK&gt;dark&lt;/REVRK&gt;
&gt; &#194;&#160; &#194;&#160; &lt;/mtrn&gt;
&gt; &#194;&#160; &#194;&#160; &lt;sytrn&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;SYNTR&gt;obscure&lt;/SYNTR&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;GRAMV&gt;-r&lt;/GRAMV&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;REVRS&gt;obscure&lt;/REVRS&gt;
&gt; &#194;&#160; &#194;&#160; &lt;/sytrn&gt;
&gt; &#194;&#160; &#194;&#160; &lt;sytrn&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;LABEL&gt;formal&lt;/LABEL&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;SYNTR&gt;awkward&lt;/SYNTR&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;GRAMV&gt;-er&lt;/GRAMV&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;REVRS&gt;awkward&lt;/REVRS&gt;
&gt; &#194;&#160; &#194;&#160; &lt;/sytrn&gt;
&gt; &#194;&#160; &#194;&#160; &lt;sytrn&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;SYNHW&gt;eng&lt;/SYNHW&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;SYNTR&gt;spooky&lt;/SYNTR&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;GRAMV&gt;-kier&lt;/GRAMV&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;REVRK&gt;spooky&lt;/REVRK&gt;
&gt; &#194;&#160; &#194;&#160; &lt;/sytrn&gt;
&gt; &#194;&#160; &#194;&#160;&lt;/trn&gt;
&gt; &#194;&#160; &#194;&#160;&lt;exmpl&gt;
&gt; &#194;&#160; &#194;&#160; &lt;VOORB&gt;een obscuur zaakje&lt;/VOORB&gt;
&gt; &#194;&#160; &#194;&#160; &lt;vve&gt;
&gt; &#194;&#160; &#194;&#160; &lt;VVERT&gt;an awkward case&lt;/VVERT&gt;
&gt; &#194;&#160; &#194;&#160; &lt;REVRS&gt;akward&lt;/REVRS&gt;
&gt; &#194;&#160; &#194;&#160;&lt;/vve&gt;
&gt; &#194;&#160; &lt;/exmpl&gt;
&gt; &#194;&#160;&lt;/meaning&gt;
&gt; &#194;&#160;&lt;/lem&gt;
&gt;
&gt; &#194;&#160;&lt;lem&gt;
&gt; &lt;LEMID&gt;000000&lt;/LEMID&gt;
&gt; &lt;HEADW&gt;vreemd&lt;/HEADW&gt;
&gt; &lt;GRAMT&gt;adj&lt;/GRAMT&gt;
&gt; &#194;&#160;&lt;meaning &#194;&#160;id='BNT-20'&gt;
&gt; &#194;&#160; &#194;&#160;&lt;BETNR&gt;1&lt;/BETNR&gt;
&gt; &#194;&#160; &#194;&#160;&lt;trn&gt;
&gt; &#194;&#160; &#194;&#160; &lt;mtrn&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160;&lt;MTRANS&gt;strange&lt;/MTRANS&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160;&lt;GRAMV&gt;-er&lt;/GRAMV&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160;&lt;REVRK&gt;strange&lt;/REVRK&gt;
&gt; &#194;&#160; &#194;&#160; &lt;/mtrn&gt;
&gt; &#194;&#160; &#194;&#160; &lt;sytrn&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;SYNTR&gt;awkward&lt;/SYNTR&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;GRAMV&gt;-er&lt;/GRAMV&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;REVRS&gt;awkward&lt;/REVRS&gt;
&gt; &#194;&#160; &#194;&#160; &lt;/sytrn&gt;
&gt; &#194;&#160; &#194;&#160;&lt;/trn&gt;
&gt; &#194;&#160; &#194;&#160;&lt;exmpl&gt;
&gt; &#194;&#160; &#194;&#160; &lt;VOORB&gt;een vreemde kerel&lt;/VOORB&gt;
&gt; &#194;&#160; &#194;&#160; &lt;vve&gt;
&gt; &#194;&#160; &#194;&#160; &lt;VVERT&gt;an awkward fellow&lt;/VVERT&gt;
&gt; &#194;&#160; &#194;&#160; &lt;REVRS&gt;awkward&lt;/REVRS&gt;
&gt; &#194;&#160; &#194;&#160;&lt;/vve&gt;
&gt; &#194;&#160; &lt;/exmpl&gt;
&gt; &#194;&#160;&lt;/meaning&gt;
&gt; &#194;&#160;&lt;/lem&gt;
&gt; &lt;/wb&gt;
&gt; &lt;/dictionary&gt;
&gt;
&gt; Result reversed dictionary
&gt; &lt;dictionary&gt;
&gt; &lt;lem&gt;
&gt; &#194;&#160;&lt;HEADW&gt;dark&lt;/HEADW&gt;
&gt; &#194;&#160;&lt;CAT&gt;adj&lt;/CAT&gt;
&gt; &#194;&#160;&lt;GRAMH&gt;-er&lt;/GRAMH&gt;
&gt; &#194;&#160;&lt;meaning id='1328'&gt;
&gt; &#194;&#160; &lt;RES&gt;obscure&lt;/RES&gt;
&gt; &#194;&#160; &lt;trn&gt;
&gt; &#194;&#160; &#194;&#160;&lt;mtrn&gt;
&gt; &#194;&#160; &#194;&#160; &lt;orig id='BNT-20'/&gt;
&gt; &lt;MTRANS&gt;obscuur&lt;/MTRANS&gt;
&gt; &#194;&#160; &#194;&#160;&lt;/mtrn&gt;
&gt; &#194;&#160; &lt;/trn&gt;
&gt; &#194;&#160;&lt;/meaning&gt;
&gt; &lt;/lem&gt;
&gt;
&gt; &lt;lem&gt;
&gt; &lt;HEADW&gt;awkward&lt;/HEADW&gt;
&gt; &lt;CAT&gt;adj&lt;/CAT&gt;
&gt; &lt;GRAMH&gt;-er&lt;/GRAMH&gt;
&gt; &lt;meaning &#194;&#160;id='1287'&gt;
&gt; &#194;&#160;&lt;orig id='BNT-19'/&gt;
&gt; &#194;&#160;&lt;RES&gt;dark&lt;/RES&gt;
&gt; &#194;&#160; &#194;&#160;&lt;trn&gt;
&gt; &#194;&#160; &#194;&#160;&lt;mtrn&gt;
&gt; &#194;&#160; &#194;&#160;&lt;MTRANS&gt;obscuur&lt;/MTRANS&gt;
&gt; &#194;&#160; &#194;&#160;&lt;LABEL&gt;formal&lt;/LABEL&gt;
&gt; &#194;&#160; &#194;&#160;&lt;mtrn&gt;
&gt; &#194;&#160; &#194;&#160;&lt;/trn&gt;
&gt; &#194;&#160; &#194;&#160;&lt;exmpl&gt;
&gt; &#194;&#160; &#194;&#160; &lt;VOORB&gt;an awkward case&lt;/VOORB&gt;
&gt; &#194;&#160; &#194;&#160; &lt;vve&gt;&lt;VVERT&gt;een obscuur zaakje&lt;/VVERT&gt;&lt;/vve&gt;
&gt; &#194;&#160; &#194;&#160;&lt;/exmpl&gt;
&gt; &#194;&#160; &lt;/meaning&gt;
&gt; &lt;meaning &#194;&#160;id='1288'&gt;
&gt; &lt;orig id='BNT-21'/&gt;
&gt; &#194;&#160; &#194;&#160;&lt;RES&gt;strange&lt;/RES&gt;
&gt; &#194;&#160; &#194;&#160;&lt;trn&gt;
&gt; &#194;&#160; &#194;&#160;&lt;mtrn&gt;
&gt; &#194;&#160; &#194;&#160;&lt;MTRANS&gt;vreemd&lt;/MTRANS&gt;
&gt; &#194;&#160; &#194;&#160;&lt;/mtrn&gt;
&gt; &#194;&#160; &#194;&#160;&lt;/trn&gt;
&gt; &lt;exmpl&gt;
&gt; &#194;&#160; &#194;&#160;&lt;VOORB&gt;an awkward fellow&lt;/VOORB&gt;
&gt; &#194;&#160; &#194;&#160; &lt;vve&gt;
&gt; &#194;&#160; &#194;&#160;&lt;VVERT&gt;een vreemde kerel&lt;/VVERT&gt;
&gt; &#194;&#160; &#194;&#160;&lt;/vve&gt;
&gt; &lt;/exmpl&gt;
&gt; &lt;meaning &gt;
&gt; &lt;/meaning&gt;
&gt; &lt;/lem&gt;
&gt;
&gt; &lt;lem&gt;
&gt; &lt;HEADW&gt;spooky&lt;/HEADW&gt;
&gt; &lt;CAT&gt;adj&lt;/CAT&gt;
&gt; &lt;GRAMV&gt;-ier&lt;/GRAMV&gt;
&gt; &lt;meaning &gt;
&gt; &lt;trn&gt;
&gt; &#194;&#160;&lt;orig id='BNT-19'/&gt;
&gt; &#194;&#160; &#194;&#160; &lt;mtrn&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160;&lt;MTRANS&gt;eng&lt;/MTRANS&gt;
&gt; &#194;&#160; &#194;&#160; &lt;/mtrn&gt;
&gt; &#194;&#160; &#194;&#160; &lt;sytrn&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &lt;SYNTR&gt;obscuur&lt;/SYNTR&gt;
&gt; &#194;&#160; &#194;&#160; &lt;/sytrn&gt;
&gt; &lt;/trn&gt;
&gt; &lt;/meaning&gt;
&gt; &lt;/lem&gt;
&gt; &lt;/dictionary&gt;
&gt;
&gt; The rough reversion goes of course as follows:
&gt;
&gt; 1. MTRANS + GRAMV -&gt; HEADW + GRAMH
&gt;
&gt; The main translation + grammatical information become headword + grammatical info in the reversed dictionary (B-A), e.g.
&gt;
&gt; vreemd: strange, awkward
&gt;
&gt; The words that in B-A will serve as new main entrances and that collect as grouping keys for some reasons are in TWO different tags: REVRS and REVRK.
&gt;
&gt; Further complications:
&gt; 2. In the reversed dictionary B-A synonyms and main translations (in A-B) are used as explicative labels, e.g.
&gt;
&gt; dark (obscure) obscuur
&gt; .....
&gt; ....
&gt; obscure (dark) obscuur
&gt;
&gt; This should only happen, though, if the SYNTR (synonym translation) in A-B does not have a SYNHW.
&gt;
&gt; 3. Examples are also reversed, in B-A they are grouped with the meaning they already belonged to in A-B, if there is another syntrn or mtrn. See the awkward case.
&gt;
&gt; More could be said, but I hope the example speaks for itself.
&gt;
&gt;
&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/msg1000306972.html</link>
</item><item>
<title>Re: [xsl] reversing dictionary in xml - 11/16/2009 6:14:00 PM</title>
<description><![CDATA[<pre>Martin,

Thanks for your reply. I validated both files, they should be allright now.

I am working with xslt 1.0, at least I am trying.

lem = the entry, contains at the top level a lemid and the entry plus grammatical category (CAT) and, optionally, grammatical information on plural (in GRAMH).
meaning = the separate meanings of a given entry word, numbered with BETNR
trn = the translation cluster, contains one mtrn (main translation) and, when applicable, one or more sytrn (synonym translations)
mtrn = cluster which contains main translation (MTRANS) plus relevant labels and grammar
sytrn = cluster which contains translations that are synomous to mtrn plus relevant labels and grammar
revrk / revrs = key word needed for determining at which entry the item should be grouped. The difference in code is related to the type of translation: exemplifying sentences, which can never be a head word, have REVRS

exmpl = contains exemplifying sentences VOORB and labels and the vve cluster
vve = contains VVERT
RES = contains a synonym of the entry word indicating the sense it is being translated, e.g. 

dark (obscure) obscuur 
dark (black) donker
etc.

I have been juggling with the keys a lot and managed to get a list of entries and translations, but got lost in the other details.

Thanks again!

Robert.

This is the input:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;dictionary&gt;
 &lt;lem&gt;
&lt;LEMID&gt;17688&lt;/LEMID&gt;
&lt;HEADW&gt;obscuur&lt;/HEADW&gt;
&lt;CAT&gt;adj&lt;/CAT&gt;
  &lt;meaning id='BNT-19'&gt;
  &lt;BETNR&gt;1&lt;/BETNR&gt;
    &lt;trn&gt;
     &lt;mtrn&gt;
        &lt;MTRANS&gt;dark&lt;/MTRANS&gt;
        &lt;GRAMV&gt;-er&lt;/GRAMV&gt;
        &lt;REVRK&gt;dark&lt;/REVRK&gt;
     &lt;/mtrn&gt;
     &lt;sytrn&gt;
      &lt;SYNTR&gt;obscure&lt;/SYNTR&gt;
      &lt;GRAMV&gt;-r&lt;/GRAMV&gt;
      &lt;REVRS&gt;obscure&lt;/REVRS&gt;
     &lt;/sytrn&gt;
     &lt;sytrn&gt;
      &lt;LABEL&gt;formal&lt;/LABEL&gt;
      &lt;SYNTR&gt;awkward&lt;/SYNTR&gt;
      &lt;GRAMV&gt;-er&lt;/GRAMV&gt;
      &lt;REVRS&gt;awkward&lt;/REVRS&gt;
     &lt;/sytrn&gt;
     &lt;sytrn&gt;
      &lt;SYNHW&gt;eng&lt;/SYNHW&gt;
      &lt;SYNTR&gt;spooky&lt;/SYNTR&gt;
      &lt;GRAMV&gt;-kier&lt;/GRAMV&gt;
      &lt;REVRK&gt;spooky&lt;/REVRK&gt;
     &lt;/sytrn&gt;
    &lt;/trn&gt;
    &lt;exmpl&gt;
     &lt;VOORB&gt;een obscuur zaakje&lt;/VOORB&gt;
     &lt;vve&gt;
     &lt;VVERT&gt;an awkward case&lt;/VVERT&gt;
     &lt;REVRS&gt;awkward&lt;/REVRS&gt;
    &lt;/vve&gt; 
   &lt;/exmpl&gt;
  &lt;/meaning&gt;
 &lt;/lem&gt;
&lt;lem&gt;
&lt;LEMID&gt;000000&lt;/LEMID&gt;
&lt;HEADW&gt;vreemd&lt;/HEADW&gt;
&lt;CAT&gt;adj&lt;/CAT&gt;
  &lt;meaning  id='BNT-20'&gt;
    &lt;BETNR&gt;1&lt;/BETNR&gt;
    &lt;trn&gt;
     &lt;mtrn&gt;
        &lt;MTRANS&gt;strange&lt;/MTRANS&gt;
        &lt;GRAMV&gt;-er&lt;/GRAMV&gt;
        &lt;REVRK&gt;strange&lt;/REVRK&gt;
     &lt;/mtrn&gt;
     &lt;sytrn&gt;
      &lt;SYNTR&gt;awkward&lt;/SYNTR&gt;
      &lt;GRAMV&gt;-er&lt;/GRAMV&gt;
      &lt;REVRS&gt;awkward&lt;/REVRS&gt;
     &lt;/sytrn&gt;
    &lt;/trn&gt;
    &lt;exmpl&gt;
     &lt;VOORB&gt;een vreemde kerel&lt;/VOORB&gt;
     &lt;vve&gt;
     &lt;VVERT&gt;an awkward fellow&lt;/VVERT&gt;
     &lt;REVRS&gt;awkward&lt;/REVRS&gt;
    &lt;/vve&gt; 
   &lt;/exmpl&gt;
  &lt;/meaning&gt;
 &lt;/lem&gt;
&lt;/dictionary&gt;



The desired output should look like this:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;dictionary&gt;
&lt;lem&gt;
 &lt;HEADW&gt;dark&lt;/HEADW&gt;
 &lt;CAT&gt;adj&lt;/CAT&gt;
 &lt;GRAMH&gt;-er&lt;/GRAMH&gt;
  &lt;meaning id='1328'&gt;
   &lt;RES&gt;obscure&lt;/RES&gt;
   &lt;trn&gt;
    &lt;mtrn&gt;
     &lt;orig id='BNT-20'/&gt;
&lt;MTRANS&gt;obscuur&lt;/MTRANS&gt;
    &lt;/mtrn&gt;
   &lt;/trn&gt;
  &lt;/meaning&gt;
&lt;/lem&gt;

&lt;lem&gt;
&lt;HEADW&gt;awkward&lt;/HEADW&gt;
&lt;CAT&gt;adj&lt;/CAT&gt;
&lt;GRAMH&gt;-er&lt;/GRAMH&gt;
&lt;meaning  id='1287'&gt;
 &lt;orig id='BNT-19'/&gt;
&lt;BETNR&gt;1&lt;/BETNR&gt;
 &lt;RES&gt;dark&lt;/RES&gt;
    &lt;trn&gt;
    &lt;mtrn&gt;
    &lt;MTRANS&gt;obscuur&lt;/MTRANS&gt;
    &lt;LABEL&gt;formal&lt;/LABEL&gt;
    &lt;/mtrn&gt;
    &lt;/trn&gt;
    &lt;exmpl&gt;
     &lt;VOORB&gt;an awkward case&lt;/VOORB&gt;
     &lt;vve&gt;&lt;VVERT&gt;een obscuur zaakje&lt;/VVERT&gt;&lt;/vve&gt;
    &lt;/exmpl&gt;
   &lt;/meaning&gt;
&lt;meaning  id='1288'&gt;
&lt;BETNR&gt;2&lt;/BETNR&gt;
&lt;orig id='BNT-21'/&gt;
    &lt;RES&gt;strange&lt;/RES&gt;
    &lt;trn&gt;
    &lt;mtrn&gt;
    &lt;MTRANS&gt;vreemd&lt;/MTRANS&gt;
    &lt;/mtrn&gt;
    &lt;/trn&gt;
&lt;exmpl&gt;
    &lt;VOORB&gt;an awkward fellow&lt;/VOORB&gt;
     &lt;vve&gt;
    &lt;VVERT&gt;een vreemde kerel&lt;/VVERT&gt;
    &lt;/vve&gt;
&lt;/exmpl&gt;
&lt;/meaning&gt;
&lt;/lem&gt;

&lt;lem&gt;
&lt;HEADW&gt;spooky&lt;/HEADW&gt;
&lt;CAT&gt;adj&lt;/CAT&gt;
&lt;GRAMV&gt;-ier&lt;/GRAMV&gt;
&lt;meaning id='BNT-23455'&gt;
&lt;BETNR&gt;1&lt;/BETNR&gt;
&lt;trn&gt;
 &lt;orig id='BNT-19'/&gt;
     &lt;mtrn&gt;
      &lt;MTRANS&gt;eng&lt;/MTRANS&gt;
     &lt;/mtrn&gt;
     &lt;sytrn&gt;
       &lt;SYNTR&gt;obscuur&lt;/SYNTR&gt;
     &lt;/sytrn&gt;
&lt;/trn&gt;
&lt;/meaning&gt;
&lt;/lem&gt;
&lt;/dictionary&gt;





----- Original Message ----
From: Martin Honnen &lt;Martin.Honnen@gmx.de&gt;
To: xsl-list@lists.mulberrytech.com
Sent: Mon, November 16, 2009 6:05:20 PM
Subject: Re: [xsl] reversing dictionary in xml

Robert Ee wrote:


&gt; More could be said, but I hope the example speaks for itself.

Neither the input you posted nor the output you posted are well-formed.
The input has a closing &lt;/wb&gt; without a corresponding start tag. That is easily fixed.
But the output has more problems, I am not sure how it is supposed to look.
Consider to post well-formed samples, otherwise it is hard to use them to infer an XSLT solution.

Also do you want to use XSLT 2.0 or 1.0 to solve 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;
--~--


      

--~------------------------------------------------------------------
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/msg1000306971.html</link>
</item><item>
<title>Re: [xsl] measuring performance of XSLT stylesheet - 11/16/2009 5:13:00 PM</title>
<description><![CDATA[<pre>a kusa wrote:

&gt; Is there any tool or any method to measure the performance of the
&gt; stylesheet (xslt)?

If you use Saxon 9 see 
http://www.saxonica.com/documentation/using-xsl/performanceanalysis.html.

-- 

	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/msg1000306968.html</link>
</item><item>
<title>[xsl] measuring performance of XSLT stylesheet - 11/16/2009 5:11:00 PM</title>
<description><![CDATA[<pre>Hi

Is there any tool or any method to measure the performance of the
stylesheet (xslt)?

Any tips on improving performance will also be helpful.

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/msg1000306967.html</link>
</item><item>
<title>Re: [xsl] reversing dictionary in xml - 11/16/2009 5:06:00 PM</title>
<description><![CDATA[<pre>Robert Ee wrote:


&gt; More could be said, but I hope the example speaks for itself.

Neither the input you posted nor the output you posted are well-formed.
The input has a closing &lt;/wb&gt; without a corresponding start tag. That is 
easily fixed.
But the output has more problems, I am not sure how it is supposed to look.
Consider to post well-formed samples, otherwise it is hard to use them 
to infer an XSLT solution.

Also do you want to use XSLT 2.0 or 1.0 to solve 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/msg1000306966.html</link>
</item><item>
<title>Re: [xsl] Does XSLT contain an easy means of determining if a string - 11/16/2009 1:52:00 PM</title>
<description><![CDATA[<pre>Can't you just use the translate(0 function (when all characters with
diacritics are known)?

On Sun, Nov 15, 2009 at 9:34 PM, Mark Wilson &lt;mark@knihtisk.org&gt; wrote:
&gt; Hi,
&gt; I need to render Czech language strings containing diacritics into strings
&gt; with the diacritics removed. The Czech alphabet has 16 lower case diacritics
&gt; and a somewhat smaller set of upper case diacritics. The strings are
&gt; expressed in &#194;&#160;UTF-8. I do not need to retain case, but I must locate and
&gt; replace all diacritics.
&gt;
&gt; My only plan so far is construct a gigantic &lt;xsl:choose&gt; to find strings
&gt; containing at least one diacritic. Then I would need a gigantic &lt;xsl:if&gt; to
&gt; change each diacritic into its unaccented counterpart.
&gt;
&gt; I wonder if there is a simpler method for turning, for example, a word like
&gt; &quot;Safar&#195;&#173;k&quot; [S, r, &#195;&#173;] into Safarik? Any ideas or suggestions,
&gt; Thanks,
&gt; Mark
&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;



-- 
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
-------------------------------------
I enjoy the massacre of ads. This sentence will slaughter ads without
a messy bloodbath.

--~------------------------------------------------------------------
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/msg1000306952.html</link>
</item><item>
<title>RE: [xsl] Display numeric string of the form 01W or 02Y - 11/16/2009 1:46:00 PM</title>
<description><![CDATA[<pre>&gt; This isn't working. I am using XSLT1.0

Right, there is no replace() in XPath 1.0 (and thus in XSLT 1.0). 

Probably the right way to do this in XSLT 1.0 is to use &lt;xsl:number&gt;.
But, depending on your data, you might get away with just sticking a
'0' in front of anything that is only 2 characters long:

  &lt;xsl:variable name=&quot;formatted_in&quot;&gt;
    &lt;xsl:choose&gt;
      &lt;xsl:when test=&quot;string-length($in)=2&quot;&gt;
        &lt;xsl:text&gt;0&lt;/xsl:text&gt;
        &lt;xsl:value-of select=&quot;$in&quot;/&gt;
      &lt;/xsl:when&gt;
      &lt;xsl:otherwise&gt;
        &lt;xsl:value-of select=&quot;$in&quot;/&gt;
      &lt;/xsl:otherwise&gt;
    &lt;/xsl:choose&gt;    
  &lt;/xsl:variable&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/msg1000306951.html</link>
</item><item>
<title>[xsl] reversing dictionary in xml - 11/16/2009 1:32:00 PM</title>
<description><![CDATA[<pre>Dear experts,


I am working on a bilingual dictionary (language A- language B) file, which I need to reverse to a B-A file.
(Some people may recognise Dutch and English in this example.)

I found out how to make a rough conversion by means of xsl, by copying from replies to other questions. 

However, I cannot implement my requests. For one thing, think I have to make two keys in order to put the exemplifying sentences in the right place.

Hope that you can help me out!

Robert

The xml file is as follows:

&lt;dictionary&gt;
 &lt;lem&gt;
&lt;LEMID&gt;17688&lt;/LEMID&gt;
&lt;HEADW&gt;obscuur&lt;/HEADW&gt;
&lt;GRAMT&gt;adj&lt;/GRAMT&gt;
  &lt;meaning  id='BNT-19'&gt;
  &lt;BETNR&gt;1&lt;/BETNR&gt;
    &lt;trn&gt;
     &lt;mtrn&gt;
        &lt;MTRANS&gt;dark&lt;/MTRANS&gt;
        &lt;GRAMV&gt;-er&lt;/GRAMV&gt;
        &lt;REVRK&gt;dark&lt;/REVRK&gt;
     &lt;/mtrn&gt;
     &lt;sytrn&gt;
      &lt;SYNTR&gt;obscure&lt;/SYNTR&gt;
      &lt;GRAMV&gt;-r&lt;/GRAMV&gt;
      &lt;REVRS&gt;obscure&lt;/REVRS&gt;
     &lt;/sytrn&gt;
     &lt;sytrn&gt;
      &lt;LABEL&gt;formal&lt;/LABEL&gt;
      &lt;SYNTR&gt;awkward&lt;/SYNTR&gt;
      &lt;GRAMV&gt;-er&lt;/GRAMV&gt;
      &lt;REVRS&gt;awkward&lt;/REVRS&gt;
     &lt;/sytrn&gt;
     &lt;sytrn&gt;
      &lt;SYNHW&gt;eng&lt;/SYNHW&gt;
      &lt;SYNTR&gt;spooky&lt;/SYNTR&gt;
      &lt;GRAMV&gt;-kier&lt;/GRAMV&gt;
      &lt;REVRK&gt;spooky&lt;/REVRK&gt;
     &lt;/sytrn&gt;
    &lt;/trn&gt;
    &lt;exmpl&gt;
     &lt;VOORB&gt;een obscuur zaakje&lt;/VOORB&gt;
     &lt;vve&gt;
     &lt;VVERT&gt;an awkward case&lt;/VVERT&gt;
     &lt;REVRS&gt;akward&lt;/REVRS&gt;
    &lt;/vve&gt; 
   &lt;/exmpl&gt;
  &lt;/meaning&gt;
 &lt;/lem&gt;

 &lt;lem&gt;
&lt;LEMID&gt;000000&lt;/LEMID&gt;
&lt;HEADW&gt;vreemd&lt;/HEADW&gt;
&lt;GRAMT&gt;adj&lt;/GRAMT&gt;
  &lt;meaning  id='BNT-20'&gt;
    &lt;BETNR&gt;1&lt;/BETNR&gt;
    &lt;trn&gt;
     &lt;mtrn&gt;
        &lt;MTRANS&gt;strange&lt;/MTRANS&gt;
        &lt;GRAMV&gt;-er&lt;/GRAMV&gt;
        &lt;REVRK&gt;strange&lt;/REVRK&gt;
     &lt;/mtrn&gt;
     &lt;sytrn&gt;
      &lt;SYNTR&gt;awkward&lt;/SYNTR&gt;
      &lt;GRAMV&gt;-er&lt;/GRAMV&gt;
      &lt;REVRS&gt;awkward&lt;/REVRS&gt;
     &lt;/sytrn&gt;
    &lt;/trn&gt;
    &lt;exmpl&gt;
     &lt;VOORB&gt;een vreemde kerel&lt;/VOORB&gt;
     &lt;vve&gt;
     &lt;VVERT&gt;an awkward fellow&lt;/VVERT&gt;
     &lt;REVRS&gt;awkward&lt;/REVRS&gt;
    &lt;/vve&gt; 
   &lt;/exmpl&gt;
  &lt;/meaning&gt;
 &lt;/lem&gt;
&lt;/wb&gt;
&lt;/dictionary&gt;

Result reversed dictionary
&lt;dictionary&gt;
&lt;lem&gt;
 &lt;HEADW&gt;dark&lt;/HEADW&gt;
 &lt;CAT&gt;adj&lt;/CAT&gt;
 &lt;GRAMH&gt;-er&lt;/GRAMH&gt;
  &lt;meaning id='1328'&gt;
   &lt;RES&gt;obscure&lt;/RES&gt;
   &lt;trn&gt;
    &lt;mtrn&gt;
     &lt;orig id='BNT-20'/&gt;
&lt;MTRANS&gt;obscuur&lt;/MTRANS&gt;
    &lt;/mtrn&gt;
   &lt;/trn&gt;
  &lt;/meaning&gt;
&lt;/lem&gt;

&lt;lem&gt;
&lt;HEADW&gt;awkward&lt;/HEADW&gt;
&lt;CAT&gt;adj&lt;/CAT&gt;
&lt;GRAMH&gt;-er&lt;/GRAMH&gt;
&lt;meaning  id='1287'&gt;
 &lt;orig id='BNT-19'/&gt;
  &lt;RES&gt;dark&lt;/RES&gt;
    &lt;trn&gt;
    &lt;mtrn&gt;
    &lt;MTRANS&gt;obscuur&lt;/MTRANS&gt;
    &lt;LABEL&gt;formal&lt;/LABEL&gt;
    &lt;mtrn&gt;
    &lt;/trn&gt;
    &lt;exmpl&gt;
     &lt;VOORB&gt;an awkward case&lt;/VOORB&gt;
     &lt;vve&gt;&lt;VVERT&gt;een obscuur zaakje&lt;/VVERT&gt;&lt;/vve&gt;
    &lt;/exmpl&gt;
   &lt;/meaning&gt;
&lt;meaning  id='1288'&gt;
&lt;orig id='BNT-21'/&gt;
    &lt;RES&gt;strange&lt;/RES&gt;
    &lt;trn&gt;
    &lt;mtrn&gt;
    &lt;MTRANS&gt;vreemd&lt;/MTRANS&gt;
    &lt;/mtrn&gt;
    &lt;/trn&gt;
&lt;exmpl&gt;
    &lt;VOORB&gt;an awkward fellow&lt;/VOORB&gt;
     &lt;vve&gt;
    &lt;VVERT&gt;een vreemde kerel&lt;/VVERT&gt;
    &lt;/vve&gt;
&lt;/exmpl&gt;
&lt;meaning &gt;
&lt;/meaning&gt;
&lt;/lem&gt;

&lt;lem&gt;
&lt;HEADW&gt;spooky&lt;/HEADW&gt;
&lt;CAT&gt;adj&lt;/CAT&gt;
&lt;GRAMV&gt;-ier&lt;/GRAMV&gt;
&lt;meaning &gt;
&lt;trn&gt;
 &lt;orig id='BNT-19'/&gt;
     &lt;mtrn&gt;
      &lt;MTRANS&gt;eng&lt;/MTRANS&gt;
     &lt;/mtrn&gt;
     &lt;sytrn&gt;
       &lt;SYNTR&gt;obscuur&lt;/SYNTR&gt;
     &lt;/sytrn&gt;
&lt;/trn&gt;
&lt;/meaning&gt;
&lt;/lem&gt;
&lt;/dictionary&gt;

The rough reversion goes of course as follows:

1. MTRANS + GRAMV -&gt; HEADW + GRAMH

The main translation + grammatical information become headword + grammatical info in the reversed dictionary (B-A), e.g.

vreemd: strange, awkward

The words that in B-A will serve as new main entrances and that collect as grouping keys for some reasons are in TWO different tags: REVRS and REVRK.

Further complications:
2. In the reversed dictionary B-A synonyms and main translations (in A-B) are used as explicative labels, e.g.

dark (obscure) obscuur
.....
....
obscure (dark) obscuur

This should only happen, though, if the SYNTR (synonym translation) in A-B does not have a SYNHW.

3. Examples are also reversed, in B-A they are grouped with the meaning they already belonged to in A-B, if there is another syntrn or mtrn. See the awkward case.

More could be said, but I hope the example speaks for itself.


      

--~------------------------------------------------------------------
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/msg1000306950.html</link>
</item><item>
<title>Re: [xsl] Happy Birthday! - 11/16/2009 11:34:00 AM</title>
<description><![CDATA[<pre>i remember that i start to work with draft specification - sort
element was as attribute for example

Charles de Gaulle  - &quot;The better I get to know men, the more I find
myself loving dogs.&quot; -
http://www.brainyquote.com/quotes/authors/c/charles_de_gaulle.html


2009/11/16 Michael Kay &lt;mike@saxonica.com&gt;:
&gt;
&gt; Here's a better link:
&gt;
&gt; http://markmail.org/message/4m2lomiaqiachi5o
&gt;
&gt;&gt; -----Original Message-----
&gt;&gt; From: Michael Kay [mailto:mike@saxonica.com]
&gt;&gt; Sent: 16 November 2009 11:16
&gt;&gt; To: xsl-list@lists.mulberrytech.com
&gt;&gt; Subject: [xsl] Happy Birthday!
&gt;&gt;
&gt;&gt;
&gt;&gt; XPath 1.0 and XSLT 1.0 became W3C Recommendations ten years
&gt;&gt; ago today.
&gt;&gt;
&gt;&gt; James Clark announced them to this list in a typically terse message:
&gt;&gt;
&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: &#194;&#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; --~------------------------------------------------------------------
&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/msg1000306945.html</link>
</item><item>
<title>RE: [xsl] Happy Birthday! - 11/16/2009 11:24:00 AM</title>
<description><![CDATA[<pre>Here's a better link:

http://markmail.org/message/4m2lomiaqiachi5o 

&gt; -----Original Message-----
&gt; From: Michael Kay [mailto:mike@saxonica.com] 
&gt; Sent: 16 November 2009 11:16
&gt; To: xsl-list@lists.mulberrytech.com
&gt; Subject: [xsl] Happy Birthday!
&gt; 
&gt; 
&gt; XPath 1.0 and XSLT 1.0 became W3C Recommendations ten years 
&gt; ago today. 
&gt; 
&gt; James Clark announced them to this list in a typically terse message:
&gt; 
&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:  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/msg1000306944.html</link>
</item><item>
<title>[xsl] Happy Birthday! - 11/16/2009 11:16:00 AM</title>
<description><![CDATA[<pre>XPath 1.0 and XSLT 1.0 became W3C Recommendations ten years ago today. 

James Clark announced them to this list in a typically terse message:

http://xsl-list.markmail.org/search/?q=Recommendation%20date%3A199911%20#que
ry:Recommendation%20date%3A199911%20+page:1+mid:4m2lomiaqiachi5o+state:resul
ts

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/msg1000306943.html</link>
</item><item>
<title>RE: [xsl] Display numeric string of the form 01W or 02Y - 11/16/2009 9:27:00 AM</title>
<description><![CDATA[<pre>&gt; The string that I am trying to display is an entry in the 
&gt; database 'Tenor'. Its format is like 1W or 2W or 1Y.
&gt; But, when I have to output it, it should be in the form 01W 
&gt; or 02W or 03W or 01Y or 10Y with a zero appended in the 
&gt; beginning. The number format cannot be used here.

Try:

replace($in, '^([0-9][A-Z])$', '0$1')

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/msg1000306937.html</link>
</item><item>
<title>RE: [xsl] Does XSLT contain an easy means of determining if a string - 11/16/2009 9:24:00 AM</title>
<description><![CDATA[<pre>Yes, there is a better way. You can use normalize-unicode() to turn the
string into decomposed normal form, in which all the diacritics become
separate characters, and then you can use replace() to get rid of the
diacritics:

replace(normalize-unicode($in, 'NFD'), '\p{IsCombiningDiacriticalMarks}',
'')

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay  

&gt; -----Original Message-----
&gt; From: Mark Wilson [mailto:mark@knihtisk.org] 
&gt; Sent: 16 November 2009 05:35
&gt; To: xsl-list@lists.mulberrytech.com
&gt; Subject: [xsl] Does XSLT contain an easy means of determining 
&gt; if a string contains a diacritic?
&gt; 
&gt; Hi,
&gt; I need to render Czech language strings containing diacritics 
&gt; into strings with the diacritics removed. The Czech alphabet 
&gt; has 16 lower case diacritics and a somewhat smaller set of 
&gt; upper case diacritics. The strings are expressed in  UTF-8. I 
&gt; do not need to retain case, but I must locate and replace all 
&gt; diacritics.
&gt; 
&gt; My only plan so far is construct a gigantic &lt;xsl:choose&gt; to 
&gt; find strings containing at least one diacritic. Then I would 
&gt; need a gigantic &lt;xsl:if&gt; to change each diacritic into its 
&gt; unaccented counterpart.
&gt; 
&gt; I wonder if there is a simpler method for turning, for 
&gt; example, a word like &quot;Safar&#237;k&quot; [S, r, &#237;] into Safarik? Any 
&gt; ideas or suggestions, Thanks, Mark 
&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/msg1000306936.html</link>
</item><item>
<title>Re: [xsl] Does XSLT contain an easy means of determining if a  string - 11/16/2009 6:34:00 AM</title>
<description><![CDATA[<pre>Hi Ken
Your idea did not quite work, but the &quot;normalize-unicode () at least gave me 
something to work on. I Googled and found a simple method Michael posted 
some time ago. In case you ever need a reference, my final template is 
below.
As always, you came through (as did Michael, indirectly).
Mark

    &lt;xsl:template match=&quot;Heading&quot;&gt;
        &lt;xsl:variable name=&quot;instring&quot; select=&quot;.&quot;/&gt;
&lt;!-- Michael's post  Note NKFD --&gt;
        &lt;xsl:variable name=&quot;altered-string&quot; 
select=&quot;replace(normalize-unicode($instring, 'NFKD'), 
'[&amp;#x0300;-&amp;#x036F;]', '')&quot;/&gt;
        &lt;xsl:choose&gt;
            &lt;xsl:when test=&quot;not($instring eq $altered-string)&quot;&gt;
                xsl:value-of select=&quot;$altered-string&quot;/&gt;
            &lt;xsl:otherwise&gt;
                &lt;xsl:value-of select=&quot;.&quot;/&gt;
            &lt;/xsl:otherwise&gt;
        &lt;/xsl:choose&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/msg1000306928.html</link>
</item><item>
<title>Re: [xsl] Does XSLT contain an easy means of determining if a  string - 11/16/2009 5:46:00 AM</title>
<description><![CDATA[<pre>Thanks Ken. I'll give it a try - I had no idea the function existed.
Mark

--------------------------------------------------
From: &quot;G. Ken Holman&quot; &lt;gkholman@CraneSoftwrights.com&gt;
Sent: Sunday, November 15, 2009 9:42 PM
To: &lt;xsl-list@lists.mulberrytech.com&gt;
Subject: Re: [xsl] Does XSLT contain an easy means of determining if a 
string contains a diacritic?

&gt; At 2009-11-15 21:34 -0800, Mark Wilson wrote:
&gt;&gt;I need to render Czech language strings containing diacritics into strings 
&gt;&gt;with the diacritics removed. The Czech alphabet has 16 lower case 
&gt;&gt;diacritics and a somewhat smaller set of upper case diacritics. The 
&gt;&gt;strings are expressed in  UTF-8.
&gt;
&gt; The encoding is irrelevant to XSLT ... it is relevant to the XML processor 
&gt; inside your XSLT processor in order to know what the Unicode characters 
&gt; are, but XSLT just sees them as Unicode characters without an encoding.
&gt;
&gt;&gt;I do not need to retain case, but I must locate and replace all 
&gt;&gt;diacritics.
&gt;&gt;
&gt;&gt;My only plan so far is construct a gigantic &lt;xsl:choose&gt; to find strings 
&gt;&gt;containing at least one diacritic. Then I would need a gigantic &lt;xsl:if&gt; 
&gt;&gt;to change each diacritic into its unaccented counterpart.
&gt;&gt;
&gt;&gt;I wonder if there is a simpler method for turning, for example, a word 
&gt;&gt;like &quot;Safar&#237;k&quot; [S, r, &#237;] into Safarik? Any ideas or suggestions,
&gt;
&gt; If you are using XSLT 2.0, have you tried:
&gt;
&gt;   normalize-unicode( $yourString, &quot;NFC&quot; )
&gt;
&gt; ... which will return fully formed characters from characters using 
&gt; diacritics?
&gt;
&gt; For example, this converts U+0065 U+0301 into U+00E9.
&gt;
&gt; I hope this helps.
&gt;
&gt; . . . . . . .  . Ken
&gt;
&gt;
&gt; --
&gt; Vote for your XML training:   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/200911/msg1000306924.html</link>
</item><item>
<title>Re: [xsl] Does XSLT contain an easy means of determining if a string - 11/16/2009 5:44:00 AM</title>
<description><![CDATA[<pre>At 2009-11-15 21:34 -0800, Mark Wilson wrote:
&gt;I need to render Czech language strings 
&gt;containing diacritics into strings with the 
&gt;diacritics removed. The Czech alphabet has 16 
&gt;lower case diacritics and a somewhat smaller set 
&gt;of upper case diacritics. The strings are expressed in  UTF-8.

The encoding is irrelevant to XSLT ... it is 
relevant to the XML processor inside your XSLT 
processor in order to know what the Unicode 
characters are, but XSLT just sees them as 
Unicode characters without an encoding.

&gt;I do not need to retain case, but I must locate and replace all diacritics.
&gt;
&gt;My only plan so far is construct a gigantic 
&gt;&lt;xsl:choose&gt; to find strings containing at least 
&gt;one diacritic. Then I would need a gigantic 
&gt;&lt;xsl:if&gt; to change each diacritic into its unaccented counterpart.
&gt;
&gt;I wonder if there is a simpler method for 
&gt;turning, for example, a word like &quot;Safar&#237;k&quot; [S, 
&gt;r, &#237;] into Safarik? Any ideas or suggestions,

If you are using XSLT 2.0, have you tried:

   normalize-unicode( $yourString, &quot;NFC&quot; )

... which will return fully formed characters from characters using diacritics?

For example, this converts U+0065 U+0301 into U+00E9.

I hope this helps.

. . . . . . .  . Ken


--
Vote for your XML training:   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/msg1000306923.html</link>
</item><item>
<title>Re: [xsl] Does XSLT contain an easy means of determining if a string - 11/16/2009 5:41:00 AM</title>
<description><![CDATA[<pre>Sorry. The email service filtered out the diacritics in the message I just 
sent. The three letters in brackets all have diacritics: S-hacek, r-hacek, 
and an accented 'i' .

--------------------------------------------------
From: &quot;Mark Wilson&quot; &lt;mark@knihtisk.org&gt;
Sent: Sunday, November 15, 2009 9:34 PM
To: &lt;xsl-list@lists.mulberrytech.com&gt;
Subject: [xsl] Does XSLT contain an easy means of determining if a string 
contains a diacritic?

&gt; Hi,
&gt; I need to render Czech language strings containing diacritics into strings 
&gt; with the diacritics removed. The Czech alphabet has 16 lower case 
&gt; diacritics and a somewhat smaller set of upper case diacritics. The 
&gt; strings are expressed in  UTF-8. I do not need to retain case, but I must 
&gt; locate and replace all diacritics.
&gt;
&gt; My only plan so far is construct a gigantic &lt;xsl:choose&gt; to find strings 
&gt; containing at least one diacritic. Then I would need a gigantic &lt;xsl:if&gt; 
&gt; to change each diacritic into its unaccented counterpart.
&gt;
&gt; I wonder if there is a simpler method for turning, for example, a word 
&gt; like &quot;Safar&#237;k&quot; [S, r, &#237;] into Safarik? Any ideas or suggestions,
&gt; Thanks,
&gt; Mark
&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/200911/msg1000306922.html</link>
</item><item>
<title>[xsl] Does XSLT contain an easy means of determining if a string - 11/16/2009 5:35:00 AM</title>
<description><![CDATA[<pre>Hi,
I need to render Czech language strings containing diacritics into strings 
with the diacritics removed. The Czech alphabet has 16 lower case diacritics 
and a somewhat smaller set of upper case diacritics. The strings are 
expressed in  UTF-8. I do not need to retain case, but I must locate and 
replace all diacritics.

My only plan so far is construct a gigantic &lt;xsl:choose&gt; to find strings 
containing at least one diacritic. Then I would need a gigantic &lt;xsl:if&gt; to 
change each diacritic into its unaccented counterpart.

I wonder if there is a simpler method for turning, for example, a word like 
&quot;Safar&#237;k&quot; [S, r, &#237;] into Safarik? Any ideas or suggestions,
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/msg1000306921.html</link>
</item><item>
<title>RE: [xsl] Extra spaces - 11/16/2009 12:20:00 AM</title>
<description><![CDATA[<pre>I can't see how the output relates to your stylesheet code. Your stylesheet
is producing XML, but you are showing text with no tags.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay  

&gt; -----Original Message-----
&gt; From: Surana, Swati [mailto:swati.surana@citi.com] 
&gt; Sent: 15 November 2009 20:51
&gt; To: 'xsl-list@lists.mulberrytech.com'
&gt; Subject: [xsl] Extra spaces
&gt; 
&gt; 
&gt; Hello,
&gt; I am using XSLT1.0
&gt; 
&gt; I have to get the output in the below format.
&gt; FWD.AED.01M.0                             0.000600          
&gt; 0.000600          0.000600       1311/12/2009 
&gt; 13:13:0001AUTOMATED PROCES
&gt; 
&gt; But with my XSL def I get the following:
&gt; FWD . AED . 1W . 0 000.000050 000.000200 000.000125  
&gt; 1311/14/2009 13:13:0001AUTOMATED PROCES
&gt; 
&gt; 
&gt; I am getting extra spaces between the first part i.e. FWD . 
&gt; AED . 1W . 0
&gt; 
&gt; My xsl looks like:
&gt; 
&gt; ......
&gt; &lt;xsl:template match=&quot;row&quot;&gt;
&gt;                 &lt;!-- Skip any rows with a zero length Price 
&gt; Date i.e. no price record available --&gt;
&gt;                 &lt;xsl:if test=&quot;string-length(PriceDate)!=0&quot;&gt;
&gt;                         &lt;!-- TermCrcy  --&gt;
&gt;                         &lt;xsl:variable name=&quot;TermCrcy&quot;&gt;
&gt;                                 &lt;xsl:choose&gt;
&gt;                                         &lt;xsl:when 
&gt; test=&quot;TermCrcy=$VEB&quot;&gt;VEF&lt;/xsl:when&gt;
&gt;                                         &lt;xsl:when 
&gt; test=&quot;TermCrcy=$UYP&quot;&gt;UYU&lt;/xsl:when&gt;
&gt;                                         &lt;xsl:otherwise&gt;
&gt;                                                 &lt;xsl:value-of 
&gt; select=&quot;TermCrcy&quot;/&gt;
&gt;                                         &lt;/xsl:otherwise&gt;
&gt;                                 &lt;/xsl:choose&gt;
&gt;                         &lt;/xsl:variable&gt;
&gt; 
&gt;                         &lt;!-- Ignore spots from Trestel Output 
&gt; curves - they are all in USD output spot curve.--&gt;
&gt;                         &lt;xsl:if 
&gt; test=&quot;contains(CrvTag,$DAILY_SPOTS) or (Tenor and 
&gt; Tenor!=$SPOT) or not(Tenor)&quot;&gt;
&gt;                                 &lt;row&gt;
&gt;                                 &lt;xsl:if test=&quot;Tenor!=$SPOT&quot;&gt;
&gt;                                         &lt;xsl:if test=&quot;PiTypC=$FXFR&quot;&gt;
&gt;                                         
&gt; &lt;forward&gt;&lt;xsl:value-of select=&quot;$FWD&quot; 
&gt; /&gt;&lt;/forward&gt;&lt;sep&gt;&lt;xsl:value-of select=&quot;$Separator&quot; /&gt;&lt;/sep&gt;
&gt;                                         &lt;TermCrcy&gt;
&gt;                                                 &lt;xsl:value-of 
&gt; select=&quot;$TermCrcy&quot;/&gt;
&gt;                                         
&gt; &lt;/TermCrcy&gt;&lt;sep&gt;&lt;xsl:value-of select=&quot;$Separator&quot; /&gt;&lt;/sep&gt;
&gt;                                         &lt;Tenor&gt;
&gt;                                                 &lt;xsl:value-of 
&gt; select=&quot;Tenor&quot;/&gt;
&gt;                                         
&gt; &lt;/Tenor&gt;&lt;sep&gt;&lt;xsl:value-of select=&quot;$Separator&quot; 
&gt; /&gt;&lt;/sep&gt;&lt;extra&gt;&lt;xsl:value-of select=&quot;$Zero&quot;/&gt;&lt;/extra&gt;
&gt;                                         &lt;Bid&gt;
&gt;                                                 &lt;xsl:value-of 
&gt; select=&quot;format-number(FullPrc1,$num-fmt)&quot;/&gt;
&gt;                                         &lt;/Bid&gt;
&gt;                                         &lt;Ask&gt;
&gt;                                                 &lt;xsl:value-of 
&gt; select=&quot;format-number(FullPrc2,$num-fmt)&quot;/&gt;
&gt;                                         &lt;/Ask&gt;
&gt;                                         &lt;Mid&gt;
&gt;                                                 &lt;xsl:value-of 
&gt; select=&quot;format-number(FullPrice,$num-fmt)&quot;/&gt;
&gt;                                         &lt;/Mid&gt;
&gt;                                         &lt;/xsl:if&gt;
&gt;                                 &lt;/xsl:if&gt;
&gt; 
&gt;                                 &lt;xsl:if test=&quot;Tenor=$SPOT&quot;&gt;
&gt;                                         &lt;xsl:copy-of select=&quot;PiTypC&quot;/&gt;
&gt;                                         &lt;xsl:text&gt;.&lt;/xsl:text&gt;
&gt;                                         &lt;TermCrcy&gt;
&gt;                                                 &lt;xsl:value-of 
&gt; select=&quot;$TermCrcy&quot;/&gt;
&gt;                                         &lt;/TermCrcy&gt;
&gt;                                         &lt;Tenor&gt;
&gt;                                                 &lt;xsl:value-of 
&gt; select=&quot;Tenor&quot;/&gt;
&gt;                                         &lt;/Tenor&gt;
&gt; 
&gt;                                         &lt;/xsl:if&gt;
&gt;                                 &lt;/row&gt;
&gt;                         &lt;/xsl:if&gt;
&gt;                 &lt;/xsl:if&gt;
&gt;         &lt;/xsl:template&gt;
&gt; .......
&gt; 
&gt; The XML is:
&gt; 
&gt; &quot;&lt;row&gt;&quot;
&gt;                         + &quot;&lt;PiTypC length='4'&gt;&quot;            + 
&gt; @PiTypC                              + &quot;&lt;/PiTypC&gt;&quot;
&gt;                         + @MetaString
&gt;                         + &quot;&lt;TenorDate length='10'&gt;&quot;        + 
&gt; convert(varchar(10),@TenorDate,112)  + &quot;&lt;/TenorDate&gt;&quot;
&gt;                         + &quot;&lt;DaysBond length='10'&gt;&quot;         + 
&gt; convert(varchar(10),@DaysBond)       + &quot;&lt;/DaysBond&gt;&quot;
&gt;                         + &quot;&lt;DaysActual length='10'&gt;&quot;       + 
&gt; convert(varchar(10),@DaysActual)     + &quot;&lt;/DaysActual&gt;&quot;
&gt;                         + &quot;&lt;IMMContractBefore length='2'&gt;&quot; + 
&gt; @IMMContractBefore                   + &quot;&lt;/IMMContractBefore&gt;&quot;
&gt;                         + &quot;&lt;IMMContractAfter length='2'&gt;&quot;  + 
&gt; @IMMContractAfter                    + &quot;&lt;/IMMContractAfter&gt;&quot;
&gt;                         + &quot;&lt;IMMDateBefore length='10'&gt;&quot;    + 
&gt; convert(varchar(10),@IMMDateBefore,112) + &quot;&lt;/IMMDateBefore&gt;&quot;
&gt;                         + &quot;&lt;IMMDateAfter length='10'&gt;&quot;    + 
&gt; convert(varchar(10),@IMMDateAfter,112)  + &quot;&lt;/IMMDateAfter&gt;&quot;
&gt;                         + &quot;&lt;SpotDate length='10'&gt;&quot;         + 
&gt; convert(varchar(10),@SpotDate,112)   + &quot;&lt;/SpotDate&gt;&quot;
&gt;                         + &quot;&lt;Basis length='15'&gt;&quot;            + 
&gt; rtrim(convert(char,@Basis))          + &quot;&lt;/Basis&gt;&quot;
&gt;                         + &quot;&lt;CrvTag length='20'&gt;&quot;           + 
&gt; rtrim(@CrvTag)                       + &quot;&lt;/CrvTag&gt;&quot;
&gt;                         + &quot;&lt;CrvRefCode length='20'&gt;&quot;       + 
&gt; rtrim(@CurveRefCode)                 + &quot;&lt;/CrvRefCode&gt;&quot;
&gt;                         + &quot;&lt;Label length='20'&gt;&quot;            + 
&gt; @Label                               + &quot;&lt;/Label&gt;&quot;
&gt;                         + &quot;&lt;RefCode length='20'&gt;&quot;          + 
&gt; @RefCode                             + &quot;&lt;/RefCode&gt;&quot;
&gt;                         + &quot;&lt;FiI length='15'&gt;&quot;              + 
&gt; rtrim(convert(char,@FiI))            + &quot;&lt;/FiI&gt;&quot;
&gt;                         + &quot;&lt;Cusip length='9'&gt;&quot;             + 
&gt; @Cusip                               + &quot;&lt;/Cusip&gt;&quot;
&gt;                         + &quot;&lt;ISIN length='20'&gt;&quot;             + 
&gt; @ISIN                                + &quot;&lt;/ISIN&gt;&quot;
&gt;                         + &quot;&lt;Provider length='20'&gt;&quot;         + 
&gt; @Provider                            + &quot;&lt;/Provider&gt;&quot;
&gt;                         + &quot;&lt;Feed length='80'&gt;&quot;             + 
&gt; @Feed                                + &quot;&lt;/Feed&gt;&quot;
&gt;                         + &quot;&lt;Time length='5'&gt;&quot;              + 
&gt; @Time                                + &quot;&lt;/Time&gt;&quot;
&gt;                         + &quot;&lt;SystemDate length='10'&gt;&quot;       + 
&gt; convert(varchar(10),@SystemDate,112) + &quot;&lt;/SystemDate&gt;&quot;
&gt;                         + &quot;&lt;LastActivityDateTime&gt;&quot;         + 
&gt; rtrim(@LastActvyDString)             + &quot;&lt;/LastActivityDateTime&gt;&quot;
&gt;                         + &quot;&lt;PriceDate length='10'&gt;&quot;        + 
&gt; convert(varchar(10),@PrcD,112)       + &quot;&lt;/PriceDate&gt;&quot;
&gt;                         + &quot;&lt;FullPrc1 length='20'&gt;&quot;         + 
&gt; ltrim(str(@Prc1,20,10))              + &quot;&lt;/FullPrc1&gt;&quot;
&gt;                         + &quot;&lt;FullPrc2 length='20'&gt;&quot;         + 
&gt; ltrim(str(@Prc2,20,10))              + &quot;&lt;/FullPrc2&gt;&quot;
&gt;                         + &quot;&lt;FullPrice length='20'&gt;&quot;        + 
&gt; ltrim(str(@Price,20,10))             + &quot;&lt;/FullPrice&gt;&quot;
&gt;                         + &quot;&lt;Prc1 length='10'&gt;&quot;             + 
&gt; ltrim(str(@Prc1,16,6))               + &quot;&lt;/Prc1&gt;&quot;
&gt;                         + &quot;&lt;Prc2 length='10'&gt;&quot;             + 
&gt; ltrim(str(@Prc2,16,6))               + &quot;&lt;/Prc2&gt;&quot;
&gt;                         + &quot;&lt;Price length='10'&gt;&quot;            + 
&gt; ltrim(str(@Price,16,6))              + &quot;&lt;/Price&gt;&quot;
&gt;                         + &quot;&lt;OverrideFlag&gt;&quot;                 + 
&gt; @OverrideFlag                        + &quot;&lt;/OverrideFlag&gt;&quot;
&gt;                         + &quot;&lt;PrevPriceDate&gt;&quot;                + 
&gt; convert(varchar(10),@PrevPrcD,112)   + &quot;&lt;/PrevPriceDate&gt;&quot;
&gt;                         + &quot;&lt;FullPrevPrc1 length='20'&gt;&quot;     + 
&gt; ltrim(str(@PrevPrc1,20,10))          + &quot;&lt;/FullPrevPrc1&gt;&quot;
&gt;                         + &quot;&lt;FullPrevPrc2 length='20'&gt;&quot;     + 
&gt; ltrim(str(@PrevPrc2,20,10))          + &quot;&lt;/FullPrevPrc2&gt;&quot;
&gt;                         + &quot;&lt;FullPrevPrice length='20'&gt;&quot;    + 
&gt; ltrim(str(@PrevPrice,20,10))         + &quot;&lt;/FullPrevPrice&gt;&quot;
&gt;                         + &quot;&lt;PrevPrc1 length='10'&gt;&quot;         + 
&gt; ltrim(str(@PrevPrc1,16,6))           + &quot;&lt;/PrevPrc1&gt;&quot;
&gt;                         + &quot;&lt;PrevPrc2 length='10'&gt;&quot;         + 
&gt; ltrim(str(@PrevPrc2,16,6))           + &quot;&lt;/PrevPrc2&gt;&quot;
&gt;                         + &quot;&lt;PrevPrice length='10'&gt;&quot;        + 
&gt; ltrim(str(@PrevPrice,16,6))          + &quot;&lt;/PrevPrice&gt;&quot;
&gt;                         + &quot;&lt;PrevOverrideFlag&gt;&quot;             + 
&gt; @PrevOverrideFlag                    + &quot;&lt;/PrevOverrideFlag&gt;&quot;
&gt;                         + &quot;&lt;/row&gt;&quot;
&gt; 
&gt; 
&gt; Kindly advise.
&gt; 
&gt; Thanks &amp; Regards,
&gt; Swati
&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/msg1000306906.html</link>
</item><item>
<title>RE: [xsl] Display numeric string of the form 01W or 02Y - 11/16/2009 12:18:00 AM</title>
<description><![CDATA[<pre>&gt; 
&gt; How do I display a string like 01W or one which contains 
&gt; chars(both numbers and albhabets). Is there any element to 
&gt; achieve the same?
&gt; I cannot break it as it's a Tenor value(i.e. month r week)

You're not explaining your problem clearly. Why is this different from
displaying any other string, such as &quot;Michael&quot;? Perhaps you want some
special output format?

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/msg1000306905.html</link>
</item><item>
<title>RE: [xsl] axis test for namespace nodes - 11/16/2009 12:17:00 AM</title>
<description><![CDATA[<pre>&gt; 
&gt; I'm looking for an axis test for namespace nodes, similar to
&gt; self::document-node() or self::processing-instruction().
&gt; 

As an axis step, use self::namespace::node()

But note that there's no corresponding match pattern.

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/msg1000306904.html</link>
</item><item>
<title>[xsl] axis test for namespace nodes - 11/15/2009 10:50:00 PM</title>
<description><![CDATA[<pre>Hello,

I'm looking for an axis test for namespace nodes, similar to
self::document-node() or self::processing-instruction().

I found a workaround (by excluding all other kinds of node()), but I was
wondering if there exists an adequate axis test.

Best regards,

Stefan

--~------------------------------------------------------------------
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/msg1000306896.html</link>
</item><item>
<title>Re: [xsl] name of the current mode - 11/15/2009 2:33:00 AM</title>
<description><![CDATA[<pre>&gt; Unfotunately, this only works if I know all possible modes in advance.

You can write a generic transformation, that, given a specific
main/primary stylesheet module, traverses the graph of
included/imported stylesheet modules and collects all modes.

Then use this result to (again programmatically) generate all the
templates, needed to determine the current mode.

All the described processing will not require any manual activity.



-- 
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 Sat, Nov 14, 2009 at 11:25 AM, Stefan Krause &lt;stf@snafu.de&gt; wrote:
&gt; Hello,
&gt;
&gt; is there any way to detect the name of the current mode during the
&gt; processing of the input document? I tried a approach over several
&gt; matching templates for each mode:
&gt;
&gt; &lt;xsl:function name=&quot;test:detect-mode&quot;&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160;&lt;xsl:variable name=&quot;temp_element&quot; as=&quot;element()&quot;&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160;&lt;test:detect/&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160;&lt;/xsl:variable&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160;&lt;xsl:apply-templates select=&quot;$temp_element&quot; mode=&quot;#current&quot;/&gt;
&gt; &lt;/xsl:function&gt;
&gt;
&gt; &lt;xsl:template match=&quot;test:detect&quot; mode=&quot;#default&quot;&gt;#default&lt;/xsl:template&gt;
&gt; &lt;xsl:template match=&quot;test:detect&quot; mode=&quot;Mode_A&quot;&gt;Mode_A&lt;/xsl:template&gt;
&gt; &lt;xsl:template match=&quot;test:detect&quot; mode=&quot;Mode_B&quot;&gt;Mode_B&lt;/xsl:template&gt;
&gt; &lt;xsl:template match=&quot;test:detect&quot; mode=&quot;#all&quot;
&gt; priority=&quot;-1&quot;&gt;#not_detected&lt;/xsl:template&gt;
&gt;
&gt; Unfotunately, this only works if I know all possible modes in advance.
&gt;
&gt; Best regards,
&gt;
&gt; Stefan
&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/msg1000306841.html</link>
</item><item>
<title>Re: [xsl] name of the current mode - 11/14/2009 11:54:00 PM</title>
<description><![CDATA[<pre>me&gt; an fxsl-inspired (I think) answer:
sigh, or perhaps it was inspired by the original post on this thread
which contained the same method.    I'll go back to sleep now....

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/msg1000306828.html</link>
</item><item>
<title>Re: [xsl] name of the current mode - 11/14/2009 11:46:00 PM</title>
<description><![CDATA[<pre>an fxsl-inspired (I think) answer:

&lt;xsl:stylesheet version=&quot;2.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt;
  

&lt;xsl:variable name=&quot;x&quot;&gt;
&lt;x&gt;
  &lt;a&gt;
    &lt;b/&gt;
    &lt;c/&gt;
  &lt;/a&gt;
  &lt;d/&gt;
&lt;/x&gt;
&lt;/xsl:variable&gt;

&lt;xsl:template match=&quot;q:___&quot; xmlns:q=&quot;data:,q&quot; mode=&quot;one&quot;&gt;one&lt;/xsl:template&gt;
&lt;xsl:template match=&quot;q:___&quot; xmlns:q=&quot;data:,q&quot; mode=&quot;two&quot;&gt;two&lt;/xsl:template&gt;
&lt;xsl:template match=&quot;q:___&quot; xmlns:q=&quot;data:,q&quot; mode=&quot;three&quot;&gt;three&lt;/xsl:template&gt;
 
&lt;xsl:variable name=&quot;modetest&quot; as=&quot;element()&quot;&gt;
  &lt;q:___ xmlns:q=&quot;data:,q&quot;/&gt;
&lt;/xsl:variable&gt;

&lt;xsl:template name=&quot;m&quot;&gt;
&lt;xsl:message select=&quot;'-------------'&quot;/&gt;
  &lt;xsl:apply-templates mode=&quot;one&quot; select=&quot;$x/*&quot;/&gt;
&lt;xsl:message select=&quot;'-------------'&quot;/&gt;
  &lt;xsl:apply-templates mode=&quot;two&quot; select=&quot;$x/*&quot;/&gt;
&lt;xsl:message select=&quot;'-------------'&quot;/&gt;
  &lt;xsl:apply-templates mode=&quot;three&quot; select=&quot;$x/*&quot;/&gt;
&lt;xsl:message select=&quot;'-------------'&quot;/&gt;
&lt;/xsl:template&gt;


&lt;xsl:template match=&quot;*&quot; mode=&quot;#all&quot;&gt;
  &lt;xsl:variable name=&quot;mode&quot;&gt;
    &lt;xsl:apply-templates select=&quot;$modetest&quot; mode=&quot;#current&quot;/&gt;
  &lt;/xsl:variable&gt;
  &lt;xsl:message select=&quot;name(), 'in mode ', $mode&quot;/&gt;
  &lt;xsl:apply-templates mode=&quot;#current&quot;/&gt;
&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;



$ saxon9 -it m mode.xsl    
-------------
x in mode one
a in mode one
b in mode one
c in mode one
d in mode one
-------------
x in mode two
a in mode two
b in mode two
c in mode two
d in mode two
-------------
x in mode three
a in mode three
b in mode three
c in mode three
d in mode three
-------------

________________________________________________________________________
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/msg1000306827.html</link>
</item><item>
<title>Re: [xsl] fo:basic-link - 11/14/2009 8:13:00 PM</title>
<description><![CDATA[<pre>On 13.11.2009 12:37, Mark Wilson wrote:
&gt; Unfortunately, I found at
&gt; http://xmlgraphics.apache.org/fop/0.94/extensions.html#named-destinations
&gt; that FOP has not implemented this extension.

You might want to check the latest release:
  http://xmlgraphics.apache.org/fop/0.95/extensions.html#named-destinations

J.Pietschmann

--~------------------------------------------------------------------
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/msg1000306813.html</link>
</item><item>
<title>RE: [xsl] name of the current mode - 11/14/2009 7:48:00 PM</title>
<description><![CDATA[<pre>At 2009-11-14 19:36 +0000, Michael Kay wrote:
&gt; &gt; But I think it is all you have available to you to try.  I
&gt; &gt; know of no way to expose the current mode.
&gt;
&gt;I can't think of any way of using the information, why would you want it?

Until modes become first class constructs, having this would have 
been helpful in catch-all template rules that report a development 
error of misspelling a mode (or in my case forgetting to add the 
namespace qualification), or not having handled a particular node in 
a particular mode.

I've long wanted to be able to expose the mode for such diagnostic purposes.

. . . . . . . . . Ken

--
Vote for your XML training:   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/msg1000306806.html</link>
</item><item>
<title>Re: [xsl] name of the current mode - 11/14/2009 7:47:00 PM</title>
<description><![CDATA[<pre>Michael Kay schrieb:
&gt; 
&gt; I can't think of any way of using the information, why would you want it?

For debugging purposes, I often use a general matching template like this:

&lt;xsl:template match=&quot;*&quot; mode=&quot;#all&quot;&gt;
	&lt;xsl:message&gt;No template matching &lt;xsl:value-of
select=&quot;name(.)&quot;/&gt;&lt;/xsl:message&gt;
&lt;/xsl:template&gt;

It would be helpful to output the current mode.

Stefan

--~------------------------------------------------------------------
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/msg1000306805.html</link>
</item><item>
<title>RE: [xsl] name of the current mode - 11/14/2009 7:36:00 PM</title>
<description><![CDATA[<pre>&gt; But I think it is all you have available to you to try.  I 
&gt; know of no way to expose the current mode.

I can't think of any way of using the information, why would you want 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/200911/msg1000306804.html</link>
</item><item>
<title>Re: [xsl] name of the current mode - 11/14/2009 7:28:00 PM</title>
<description><![CDATA[<pre>At 2009-11-14 20:25 +0100, Stefan Krause wrote:
&gt;is there any way to detect the name of the current mode during the
&gt;processing of the input document? I tried a approach over several
&gt;matching templates for each mode:
&gt;
&gt;&lt;xsl:function name=&quot;test:detect-mode&quot;&gt;
&gt;         &lt;xsl:variable name=&quot;temp_element&quot; as=&quot;element()&quot;&gt;
&gt;                 &lt;test:detect/&gt;
&gt;         &lt;/xsl:variable&gt;
&gt;         &lt;xsl:apply-templates select=&quot;$temp_element&quot; mode=&quot;#current&quot;/&gt;
&gt;&lt;/xsl:function&gt;
&gt;
&gt;&lt;xsl:template match=&quot;test:detect&quot; mode=&quot;#default&quot;&gt;#default&lt;/xsl:template&gt;
&gt;&lt;xsl:template match=&quot;test:detect&quot; mode=&quot;Mode_A&quot;&gt;Mode_A&lt;/xsl:template&gt;
&gt;&lt;xsl:template match=&quot;test:detect&quot; mode=&quot;Mode_B&quot;&gt;Mode_B&lt;/xsl:template&gt;
&gt;&lt;xsl:template match=&quot;test:detect&quot; mode=&quot;#all&quot;
&gt;priority=&quot;-1&quot;&gt;#not_detected&lt;/xsl:template&gt;
&gt;
&gt;Unfotunately, this only works if I know all possible modes in advance.

But I think it is all you have available to you to try.  I know of no 
way to expose the current mode.

. . . . . . . . . . . Ken


--
Vote for your XML training:   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/msg1000306803.html</link>
</item><item>
<title>[xsl] name of the current mode - 11/14/2009 7:26:00 PM</title>
<description><![CDATA[<pre>Hello,

is there any way to detect the name of the current mode during the
processing of the input document? I tried a approach over several
matching templates for each mode:

&lt;xsl:function name=&quot;test:detect-mode&quot;&gt;
	&lt;xsl:variable name=&quot;temp_element&quot; as=&quot;element()&quot;&gt;
		&lt;test:detect/&gt;
	&lt;/xsl:variable&gt;
	&lt;xsl:apply-templates select=&quot;$temp_element&quot; mode=&quot;#current&quot;/&gt;
&lt;/xsl:function&gt;

&lt;xsl:template match=&quot;test:detect&quot; mode=&quot;#default&quot;&gt;#default&lt;/xsl:template&gt;
&lt;xsl:template match=&quot;test:detect&quot; mode=&quot;Mode_A&quot;&gt;Mode_A&lt;/xsl:template&gt;
&lt;xsl:template match=&quot;test:detect&quot; mode=&quot;Mode_B&quot;&gt;Mode_B&lt;/xsl:template&gt;
&lt;xsl:template match=&quot;test:detect&quot; mode=&quot;#all&quot;
priority=&quot;-1&quot;&gt;#not_detected&lt;/xsl:template&gt;

Unfotunately, this only works if I know all possible modes in advance.

Best regards,

Stefan


--~------------------------------------------------------------------
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/msg1000306802.html</link>
</item><item>
<title>RE: [xsl] Do xsl processors contain optimizer for conditions? - 11/14/2009 6:36:00 PM</title>
<description><![CDATA[<pre>XPath 1.0 mandates that the rhs of &quot;and&quot; isn't evaluated if the lhs is true
(and similarly for &quot;or&quot;).

XPath 2.0 gives more discretion to the implementation, for example if you
write a predicate

customer[location='uk' and vatNumber='01234567']

and there is an index on vatNumber, then the processor is allowed to use it.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 



&gt; -----Original Message-----
&gt; From: cert21 [mailto:cert21@ptd.net] 
&gt; Sent: 14 November 2009 17:14
&gt; To: xsl-list@lists.mulberrytech.com
&gt; Subject: [xsl] Do xsl processors contain optimizer for conditions?
&gt; 
&gt; I know in many languages like Java and php when testing for 
&gt; multiple conditions the engine is smart to return false when 
&gt; the first condition fails, so it does not even check next conditions.
&gt; This saves some of the processing time.
&gt; 
&gt; I wonder if xsl engines follow the same logic, for example in 
&gt; test like
&gt; this:
&gt; 
&gt; &lt;xsl:when
&gt;                 test=&quot;( (string-length($mystring) &gt; 30)  and 
&gt; not(contains(substring($mystring, 1, 30), ' ') ) )&quot;&gt;
&gt; 
&gt; If the string-length is &lt; 30 then the second condition will 
&gt; not even be evaluated?
&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/msg1000306798.html</link>
</item><item>
<title>Re: [xsl] Do xsl processors contain optimizer for conditions? - 11/14/2009 5:30:00 PM</title>
<description><![CDATA[<pre>Martin Honnen wrote:
&gt;
&gt; Technically it is a question about XPath expressions, if you look at 
&gt; the specification http://www.w3.org/TR/xpath#booleans then it clearly 
&gt; says for 'and' expressions:
&gt;   &quot;The right operand is not evaluated if the left operand evaluates to 
&gt; false.&quot;
&gt;
&gt; And for 'or' expressions:
&gt;   &quot;The right operand is not evaluated if the left operand evaluates to 
&gt; true.&quot;
&gt;
&gt; So it is not question about optimization, the language specification 
&gt; prescribes what to do.
&gt;
Thank you.
It's good to know. This means that order of multiple conditions in 
evaluation is important for optimization purposes, the one that is most 
likely
to fail should be the first condition.



--~------------------------------------------------------------------
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/msg1000306793.html</link>
</item><item>
<title>Re: [xsl] Do xsl processors contain optimizer for conditions? - 11/14/2009 5:21:00 PM</title>
<description><![CDATA[<pre>cert21 wrote:
&gt; I know in many languages like Java and php when testing for multiple 
&gt; conditions
&gt; the engine is smart to return false when the first condition fails, so 
&gt; it does not even check
&gt; next conditions.
&gt; This saves some of the processing time.
&gt; 
&gt; I wonder if xsl engines follow the same logic, for example in test like 
&gt; this:
&gt; 
&gt; &lt;xsl:when
&gt;                test=&quot;( (string-length($mystring) &gt; 30)  and 
&gt; not(contains(substring($mystring, 1, 30), ' ') ) )&quot;&gt;
&gt; 
&gt; If the string-length is &lt; 30 then the second condition will not even be 
&gt; evaluated?

Technically it is a question about XPath expressions, if you look at the 
specification http://www.w3.org/TR/xpath#booleans then it clearly says 
for 'and' expressions:
   &quot;The right operand is not evaluated if the left operand evaluates to 
false.&quot;

And for 'or' expressions:
   &quot;The right operand is not evaluated if the left operand evaluates to 
true.&quot;

So it is not question about optimization, the language specification 
prescribes what to do.

-- 

	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/msg1000306792.html</link>
</item><item>
<title>[xsl] Do xsl processors contain optimizer for conditions? - 11/14/2009 5:14:00 PM</title>
<description><![CDATA[<pre>I know in many languages like Java and php when testing for multiple 
conditions
the engine is smart to return false when the first condition fails, so 
it does not even check
next conditions.
This saves some of the processing time.

I wonder if xsl engines follow the same logic, for example in test like 
this:

&lt;xsl:when
                test=&quot;( (string-length($mystring) &gt; 30)  and 
not(contains(substring($mystring, 1, 30), ' ') ) )&quot;&gt;

If the string-length is &lt; 30 then the second condition will not even be 
evaluated?



--~------------------------------------------------------------------
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/msg1000306791.html</link>
</item><item>
<title>RE: [xsl] Grouping into duplicates and non duplicate lists - 11/14/2009 2:44:00 AM</title>
<description><![CDATA[<pre>Hi David,

Thanks for that. I have put it together and it works!! It does not look too elegant and I need to use 2 keys to do what I want. Here is the template if anyone has any suggestions for improving - happy to take on board... Thanks again:

&lt;xsl:template match=&quot;CourseNote&quot;&gt;
		&lt;xsl:variable name=&quot;sgcount&quot; select=&quot;count(CourseNoteItem[count(. | key('CN-SG', concat(Year, StudyGroupCode))[1]) = 1])&quot; /&gt;
		&lt;xsl:if test=&quot;CourseNoteItem[count(. | key('CN-T', concat(Year, CourseNoteText))[1]) = 1][count(key('CN-T', concat(Year, CourseNoteText)))=$sgcount]&quot;&gt;
			&lt;strong&gt;Applies to all Study Groups&lt;/strong&gt;
			&lt;br /&gt;
			&lt;ul&gt;
				&lt;xsl:for-each select=&quot;CourseNoteItem[count(. | key('CN-T', concat(Year, CourseNoteText))[1]) = 1][count(key('CN-T', concat(Year, CourseNoteText)))=$sgcount]&quot;&gt;
					&lt;xsl:sort select=&quot;DisplaySequence&quot; /&gt;
					&lt;li&gt;
						&lt;xsl:copy-of select=&quot;CourseNoteText/node()&quot; /&gt;
					&lt;/li&gt;
				&lt;/xsl:for-each&gt;
			&lt;/ul&gt;
		&lt;/xsl:if&gt;
		&lt;xsl:for-each select=&quot;CourseNoteItem[count(. | key('CN-SG', concat(Year, StudyGroupCode))[1]) = 1]&quot;&gt;
			&lt;xsl:sort select=&quot;StudyGroupOrder&quot; /&gt;
			&lt;xsl:if test=&quot;key('CN-SG', concat(Year, StudyGroupCode))[count(key('CN-T', concat(Year, CourseNoteText)))!=$sgcount]&quot;&gt;
				&lt;strong&gt;
					&lt;xsl:value-of select=&quot;StudyGroupName&quot; /&gt; - Only&lt;/strong&gt;
				&lt;br /&gt;
				&lt;ul&gt;
					&lt;xsl:for-each select=&quot;key('CN-SG', concat(Year, StudyGroupCode))[count(key('CN-T', concat(Year, CourseNoteText)))!=$sgcount]&quot;&gt;
						&lt;li&gt;
							&lt;xsl:copy-of select=&quot;CourseNoteText/node()&quot; /&gt;
						&lt;/li&gt;
					&lt;/xsl:for-each&gt;
				&lt;/ul&gt;
			&lt;/xsl:if&gt;
		&lt;/xsl:for-each&gt;
	&lt;/xsl:template&gt;

 
Tim Cavanagh
Senior Technical Architect
PH: 0434 079402   FAX:  8207 8554

-----Original Message-----
From: David Carlisle [mailto:davidc@nag.co.uk] 
Sent: Saturday, 14 November 2009 10:09 AM
To: xsl-list@lists.mulberrytech.com
Subject: Re: [xsl] Grouping into duplicates and non duplicate lists


not looked in detail at your example, just perhaps just answering this
bit iis enough

&gt;  I am familiar with keys and get get lists of unigue items and group
&gt;  them but I cannot exclude the items that do not appear in all
&gt;  StudyGroups...  

one way

&lt;xsl:key name=&quot;sg&quot; match=&quot;studyroup&quot; use=&quot;item&quot;/&gt;

then &lt;xsl:variable name=&quot;n&quot; select=&quot;count(studygroup)&quot;/&gt;

so to know if . the current item is in all groups you can test 
count(key('sg',.))=$n
as if it is in all groups then the key will return them all

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;
--~--


--~------------------------------------------------------------------
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/msg1000306754.html</link>
</item><item>
<title>Re: [xsl] Grouping into duplicates and non duplicate lists - 11/13/2009 11:39:00 PM</title>
<description><![CDATA[<pre>not looked in detail at your example, just perhaps just answering this
bit iis enough

&gt;  I am familiar with keys and get get lists of unigue items and group
&gt;  them but I cannot exclude the items that do not appear in all
&gt;  StudyGroups...  

one way

&lt;xsl:key name=&quot;sg&quot; match=&quot;studyroup&quot; use=&quot;item&quot;/&gt;

then &lt;xsl:variable name=&quot;n&quot; select=&quot;count(studygroup)&quot;/&gt;

so to know if . the current item is in all groups you can test 
count(key('sg',.))=$n
as if it is in all groups then the key will return them all

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/msg1000306746.html</link>
</item><item>
<title>RE: [xsl] Grouping into duplicates and non duplicate lists - 11/13/2009 11:22:00 PM</title>
<description><![CDATA[<pre>Hi Martin,

Sure here it is using the xml fragment below.

&lt;h1&gt;Generic Course Notes (applies to all study groups&lt;/h1&gt;
&lt;ul&gt;
	&lt;li&gt;A&lt;/li&gt;
	&lt;li&gt;B&lt;/li&gt;
&lt;/ul&gt;
&lt;h1Specific Study Group Notes&lt;/h1&gt;		
&lt;h2&gt;Award&lt;/h2&gt;
&lt;ul&gt;
	&lt;li&gt;C&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;FFS&lt;/h2&gt;
&lt;ul&gt;
	&lt;li&gt;C&lt;/li&gt;
	&lt;li&gt;D&lt;/li&gt;
&lt;/ul&gt;

There could be many more Study Groups with more specific notes (eg not duplicates.

Thanks a lot Tim
	
Cavanagh, Tim (DFEEST) wrote:
&gt; Hi, I have scoured the web for help on this and have been through the archives and Jenis' grouping pages but I cannot work it out. So here goes.
&gt; 
&gt; I am using xslt 1.0 and MSXML parser
&gt; 
&gt; I have an xml file that has a series of notes Like so
&gt; &lt;CourseNote&gt;
&gt;           &lt;CourseNoteItem&gt;
&gt;             &lt;StudyGroupName&gt;Aboriginal or Torres Strait Islanders&lt;/StudyGroupName&gt;
&gt;             &lt;Year&gt;2009&lt;/Year&gt;
&gt;             &lt;CourseNoteText&gt;A&lt;/CourseNoteText&gt;
&gt;             &lt;StudyGroupOrder&gt;2&lt;/StudyGroupOrder&gt;
&gt;             &lt;StudyGroupCode&gt;ATSI&lt;/StudyGroupCode&gt;
&gt;             &lt;DisplaySequence&gt;2&lt;/DisplaySequence&gt;
&gt;           &lt;/CourseNoteItem&gt;
&gt;           &lt;CourseNoteItem&gt;
&gt;             &lt;StudyGroupName&gt;Aboriginal or Torres Strait Islanders&lt;/StudyGroupName&gt;
&gt;             &lt;Year&gt;2009&lt;/Year&gt;
&gt;             &lt;CourseNoteText&gt;B&lt;/CourseNoteText&gt;
&gt;             &lt;StudyGroupOrder&gt;2&lt;/StudyGroupOrder&gt;
&gt;             &lt;StudyGroupCode&gt;ATSI&lt;/StudyGroupCode&gt;
&gt;             &lt;DisplaySequence&gt;5&lt;/DisplaySequence&gt;
&gt;           &lt;/CourseNoteItem&gt;
&gt;           &lt;CourseNoteItem&gt;
&gt;             &lt;StudyGroupName&gt;Award&lt;/StudyGroupName&gt;
&gt;             &lt;Year&gt;2009&lt;/Year&gt;
&gt;             &lt;CourseNoteText&gt;A&lt;/CourseNoteText&gt;
&gt;             &lt;StudyGroupOrder&gt;1&lt;/StudyGroupOrder&gt;
&gt;             &lt;StudyGroupCode&gt;AWD&lt;/StudyGroupCode&gt;
&gt;             &lt;DisplaySequence&gt;2&lt;/DisplaySequence&gt;
&gt;           &lt;/CourseNoteItem&gt;
&gt;           &lt;CourseNoteItem&gt;
&gt;             &lt;StudyGroupName&gt;Award&lt;/StudyGroupName&gt;
&gt;             &lt;Year&gt;2009&lt;/Year&gt;
&gt;             &lt;CourseNoteText&gt;B&lt;/CourseNoteText&gt;
&gt;             &lt;StudyGroupOrder&gt;1&lt;/StudyGroupOrder&gt;
&gt;             &lt;StudyGroupCode&gt;AWD&lt;/StudyGroupCode&gt;
&gt;             &lt;DisplaySequence&gt;5&lt;/DisplaySequence&gt;
&gt;           &lt;/CourseNoteItem&gt;
&gt;           &lt;CourseNoteItem&gt;
&gt;             &lt;StudyGroupName&gt;Award&lt;/StudyGroupName&gt;
&gt;             &lt;Year&gt;2009&lt;/Year&gt;
&gt;             &lt;CourseNoteText&gt;C&lt;/CourseNoteText&gt;
&gt;             &lt;StudyGroupOrder&gt;1&lt;/StudyGroupOrder&gt;
&gt;             &lt;StudyGroupCode&gt;AWD&lt;/StudyGroupCode&gt;
&gt;             &lt;DisplaySequence&gt;7&lt;/DisplaySequence&gt;
&gt;           &lt;/CourseNoteItem&gt;
&gt;	    &lt;CourseNoteItem&gt;
&gt;             &lt;StudyGroupName&gt;FFS&lt;/StudyGroupName&gt;
&gt;             &lt;Year&gt;2009&lt;/Year&gt;
&gt;             &lt;CourseNoteText&gt;C&lt;/CourseNoteText&gt;
&gt;             &lt;StudyGroupOrder&gt;4&lt;/StudyGroupOrder&gt;
&gt;             &lt;StudyGroupCode&gt;FFS&lt;/StudyGroupCode&gt;
&gt;             &lt;DisplaySequence&gt;7&lt;/DisplaySequence&gt;
&gt;           &lt;/CourseNoteItem&gt;
&gt;	    &lt;CourseNoteItem&gt;
&gt;             &lt;StudyGroupName&gt;FFS&lt;/StudyGroupName&gt;
&gt;             &lt;Year&gt;2009&lt;/Year&gt;
&gt;             &lt;CourseNoteText&gt;D&lt;/CourseNoteText&gt;
&gt;             &lt;StudyGroupOrder&gt;4&lt;/StudyGroupOrder&gt;
&gt;             &lt;StudyGroupCode&gt;FFS&lt;/StudyGroupCode&gt;
&gt;             &lt;DisplaySequence&gt;9&lt;/DisplaySequence&gt;
&gt;           &lt;/CourseNoteItem&gt;
&gt;         &lt;/CourseNote&gt;
&gt; 
&gt; There can be many different StudyGroupCodes, many CourseNoteTexts and many Years. I would like to display a 'Generic' List of notes eg those that are duplicated in every StudyGroup and then display lists of StudyGroups with the CourseNoteTexts that are not duplicated in all other StudyGroups. I am familiar with keys and get get lists of unigue items and group them but I cannot exclude the items that do not appear in all StudyGroups... 

Can you post the XSLT output you want to create for the above input?

-- 

	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/msg1000306745.html</link>
</item><item>
<title>Re: [xsl] using xsl:output-character to render characters in 2 ways - 11/13/2009 6:10:00 PM</title>
<description><![CDATA[<pre>Tom T wrote:
&gt; When I use this character map:
&gt; 
&gt; &lt;xsl:character-map name=&quot;default&quot;&gt;
&gt; 		&lt;xsl:output-character character=&quot;&amp;lt;&quot; string=&quot;&amp;#60;&quot; /&gt;
&gt; 		&lt;xsl:output-character character=&quot;&gt;&quot; string=&quot;&amp;#62;&quot; /&gt;
&gt; 		&lt;xsl:output-character character=&quot;&amp;amp;&quot; string=&quot;&amp;#38;amp;&quot; /&gt;
&gt; &lt;/xsl:character-map&gt;	
&gt; 
&gt; the unexpected behaviour occurs. When I remove the output-characters
&gt; and use this one:
&gt; 
&gt; &lt;xsl:character-map name=&quot;default&quot;/&gt;
&gt; 
&gt; There is no problem.
&gt; 
&gt; I am using Saxon 9

In that case:

As several other people have suggested, there is really no need for that
character map, if you are generating XML or HTML.  The XSLT processor
will handle necessary escaping for you.  Since eliminating the map gives
you correct behavior, just stop using it.

However, it is still a bug (IMO) that that character map results in
invalid markup; you are certainly not requesting the specific bad
behavior you&#226;€™re getting.  I would file a bug against Saxon.

~Chris
-- 
Chris Maden, text nerd  &lt;URL: http://crism.maden.org/ &gt;
&#226;€œThe State is that great fiction by which everyone tries to live at
 the expense of everyone else.&#226;€ &#226;€” Fr&#195;&#169;d&#195;&#169;ric Bastiat, &#226;€œL&#226;€™&#195;‰tat&#226;€
GnuPG Fingerprint: C6E4 E2A9 C9F8 71AC 9724 CAA3 19F8 6677 0077 C319

--~------------------------------------------------------------------
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/msg1000306734.html</link>
</item><item>
<title>Re: [xsl] using xsl:output-character to render characters in 2 ways - 11/13/2009 5:28:00 PM</title>
<description><![CDATA[<pre>&gt; I now have an attribute that is marked up by single quotes containing
&gt; a single quote. IE6 for one cannot deal with this.

XSLT is pretty much guaranteed to produce well formed output unless you
use character maps or disable output escaping in which case it is your
responsibility, just not using character maps at all here would seem to
do the right thing, no?

your sample ouput shows  /&gt; so you have used the xml or xhtml output
methods neither of which will make output suitable for IE (or suitable
for any browser if you serve it as text/html) if you use teh html output
method, xslt will use special case serialisation rules to get quoting
right for html. In particular it knows that script is a CDATA element in
html so will not use &amp;.. quoting inside script in html (but does in
xhtml or xml output)

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/msg1000306730.html</link>
</item><item>
<title>Re: [xsl] using xsl:output-character to render characters in 2 ways - 11/13/2009 5:27:00 PM</title>
<description><![CDATA[<pre>When I use this character map:

&lt;xsl:character-map name=&quot;default&quot;&gt;
		&lt;xsl:output-character character=&quot;&amp;lt;&quot; string=&quot;&amp;#60;&quot; /&gt;
		&lt;xsl:output-character character=&quot;&gt;&quot; string=&quot;&amp;#62;&quot; /&gt;
		&lt;xsl:output-character character=&quot;&amp;amp;&quot; string=&quot;&amp;#38;amp;&quot; /&gt;
&lt;/xsl:character-map&gt;	

the unexpected behaviour occurs. When I remove the output-characters
and use this one:

&lt;xsl:character-map name=&quot;default&quot;/&gt;

There is no problem.

I am using Saxon 9


On Fri, Nov 13, 2009 at 4:37 PM, Christopher R. Maden &lt;crism@maden.org&gt; wrote:
&gt; Tom T wrote:
&gt;&gt; I'll change my example.
&gt;&gt;
&gt;&gt; Financial Times, &quot;Erdo&#196;Ÿan Grubu'na&quot;
&gt;&gt;
&gt;&gt; creates
&gt;&gt;
&gt;&gt; &#194;&#160; &lt;meta name=&quot;description&quot;
&gt;&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; content='Financial Times, &amp;#34;Erdo&#196;Ÿan Grubu'na&amp;#34;'
&gt;&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160; /&gt;
&gt;&gt;
&gt;&gt; I now have an attribute that is marked up by single quotes containing
&gt;&gt; a single quote. IE6 for one cannot deal with this.
&gt;
&gt; That is clearly in error.
&gt;
&gt; Is this happening *with* your output character mapping in force, or
&gt; *without*?
&gt;
&gt; If without, then the XSLT processor has a severe bug. &#194;&#160;If with, then it
&gt; may be happening because of your character mapping.
&gt;
&gt; ~Chris
&gt; --
&gt; Chris Maden, text nerd &#194;&#160;&lt;URL: http://crism.maden.org/ &gt;
&gt; &#226;€œThe State is that great fiction by which everyone tries to live at
&gt; &#194;&#160;the expense of everyone else.&#226;€ &#226;€” Fr&#195;&#169;d&#195;&#169;ric Bastiat, &#226;€œL&#226;€™&#195;‰tat&#226;€
&gt; GnuPG Fingerprint: C6E4 E2A9 C9F8 71AC 9724 CAA3 19F8 6677 0077 C319
&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/msg1000306729.html</link>
</item><item>
<title>Re: [xsl] XSLT extensions and how to disable them - 11/13/2009 4:58:00 PM</title>
<description><![CDATA[<pre>Costello, Roger L. wrote:

&gt; I created a stylesheet to illustrate the use of three kinds of extensions (I do not show the use of an integrated extension function):
&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;                 xmlns:java=&quot;java:java.lang.Math&quot; 
&gt;                 xmlns:exslt=&quot;http://exslt.org/math&quot;
&gt;                 xmlns:saxon=&quot;http://saxon.sf.net/&quot;
&gt;                 extension-element-prefixes=&quot;java exslt&quot;               
&gt;                 version=&quot;2.0&quot;&gt;
&gt; 
&gt;     &lt;xsl:template match=&quot;/&quot; &gt;
&gt; 
&gt;             &lt;xsl:value-of select=&quot;java:sqrt(2)&quot; /&gt;
&gt;             &lt;xsl:value-of select=&quot;exslt:abs(8 - 12)&quot; /&gt;
&gt;             &lt;xsl:value-of select=&quot;saxon:is-whole-number(1.23)&quot; /&gt;
&gt; 
&gt;     &lt;/xsl:template&gt;
&gt; 
&gt; &lt;/xsl:stylesheet&gt;

I don't think there is any need for the 'extension-element-prefixes' 
attribute as you do not use any extension elements at all.

-- 

	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/msg1000306726.html</link>
</item><item>
<title>[xsl] XSLT extensions and how to disable them - 11/13/2009 4:49:00 PM</title>
<description><![CDATA[<pre>Hi Folks,

I examined two popular XSLT processors for the purpose of determining what extensions they support and whether they provide the ability to turn off the extensions:

    1. SAXON, version 9.2.0.3, Java edition.

    2. XALAN, version 2.7.0.1, Java edition.

Below is the result of my analysis.

I have a question for you. With regard to the specific XSLT processors I analyzed:

       Is my analysis complete, i.e., do these XSLT processors 
       provide extensions that I have not shown?


------------------------------------------------
                 SAXON
------------------------------------------------

SAXON supports four kinds of extensions:

    1. A stylesheet can invoke Java methods.

    2. A stylesheet can invoke functions in the EXSLT library [1].

    3. The SAXON processor comes equipped with its 
       own built-in extension functions and elements [2];
       a stylesheet can invoke any of these.

    4. A developer can implement a Java function and
       then register it with the SAXON processor. This 
       is called an integrated extension function [3].
       A stylesheet can invoke the developer-created 
       function.
       

I created a stylesheet to illustrate the use of three kinds of extensions (I do not show the use of an integrated extension function):


&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
                xmlns:java=&quot;java:java.lang.Math&quot; 
                xmlns:exslt=&quot;http://exslt.org/math&quot;
                xmlns:saxon=&quot;http://saxon.sf.net/&quot;
                extension-element-prefixes=&quot;java exslt&quot;               
                version=&quot;2.0&quot;&gt;

    &lt;xsl:template match=&quot;/&quot; &gt;

            &lt;xsl:value-of select=&quot;java:sqrt(2)&quot; /&gt;
            &lt;xsl:value-of select=&quot;exslt:abs(8 - 12)&quot; /&gt;
            &lt;xsl:value-of select=&quot;saxon:is-whole-number(1.23)&quot; /&gt;

    &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;


The first value-of element outputs the result of invoking the Java square root method. The second value-of element outputs the result of invoking the EXSLT absolute value function. The third value-of element outputs the result of invoking the SAXON-built-in is-whole-number function.


DISABLING EXTENSIONS

SAXON provides an &quot;ext&quot; flag for turning on or off access to extensions. 

When a stylesheet is run with the ext flag on: 

    -ext:on

then all four kinds of extensions are enabled.

When a stylesheet is run with the ext flag off: 

    -ext:off

then the Java and EXSLT extensions are disabled; any attempt to use these extensions results in this error message:

    external function calls have been disabled

The SAXON built-in extensions and the integrated extension functions remain enabled regardless of whether -ext is on or off. The integrated extension functions can be disabled by unregistering them with SAXON.


ANALYSIS OF SAXON 

1. SAXON supports four kinds of extensions: Java, EXSLT, SAXON-native, and developer-created (integrated) extensions.

2. The -ext:off flag disables Java and EXSLT extensions; however, the SAXON-native and integrated extensions remain enabled.

3. With -ext:on then all four kinds of extensions are enabled.

4. The integrated extensions can be disabled by unregistering them with SAXON.


------------------------------------------------
                 XALAN
------------------------------------------------

XALAN supports three kinds of extensions:

    1. A stylesheet can invoke Java methods

    2. A stylesheet can invoke functions in the EXSLT library

    3. A stylesheet can invoke JavaScript functions

I created a stylesheet to illustrate the use of the three kinds of extension functions:

&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
                xmlns:java=&quot;http://xml.apache.org/xalan/java&quot; 
                xmlns:exslt=&quot;http://exslt.org/math&quot;
                xmlns:xalan=&quot;http://xml.apache.org/xalan&quot;
                xmlns:javascript=&quot;ext1&quot;
                extension-element-prefixes=&quot;exslt java javascript&quot;               
                version=&quot;2.0&quot;&gt;

    &lt;xalan:component prefix=&quot;javascript&quot; functions=&quot;getDate&quot;&gt;
        &lt;xalan:script lang=&quot;javascript&quot;&gt;

          function getDate()
          {
            var d = new Date();
            return d.toString();
          }

        &lt;/xalan:script&gt;
    &lt;/xalan:component&gt;

    &lt;xsl:template match=&quot;/&quot; &gt;

            &lt;xsl:value-of select=&quot;java:java.lang.Math.sqrt(2)&quot; /&gt;
            &lt;xsl:value-of select=&quot;exslt:abs(8 - 12)&quot; /&gt;
            &lt;xsl:value-of select=&quot;javascript:getDate()&quot; /&gt;

    &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;

The first value-of element outputs the result of invoking the Java square root method. The second value-of element outputs the result of invoking the EXSLT absolute value function. The third value-of element outputs the result of invoking a JavaScript function, which is defined in the stylesheet.


DISABLING EXTENSIONS

Using JavaScript requires the Apache Bean Scripting Framework (BSF) library [4], the Apache Commons Logging library [5], and the Rhino JavaScript for Java library [6]. Thus, to disable JavaScript functions from being used, simply don't provide these libraries.

There is no mechanism for disabling access to Java or EXSLT.


ANALYSIS OF XALAN 

1. XALAN supports three kinds of extensions: Java, EXSLT, and JavaScript.

2. JavaScript can be disabled by simply not providing the required libraries.

3. Access to Java and EXSLT cannot be disabled.


/Roger


[1] http://www.exslt.org/download.html

[2] http://www.saxonica.com/documentation/extensions/intro.html

[3] http://www.saxonica.com/documentation/extensibility/integratedfunctions.html

[4] http://jakarta.apache.org/site/downloads/downloads_bsf.cgi

[5] http://commons.apache.org/downloads/download_logging.cgi

[6] http://www.mozilla.org/rhino/download.html
--~------------------------------------------------------------------
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/msg1000306725.html</link>
</item><item>
<title>Re: [xsl] fo:basic-link - 11/13/2009 4:46:00 PM</title>
<description><![CDATA[<pre>Thank you, Mark, for your research in this, and for sharing it with everyone!

. . . . . . . . Ken

At 2009-11-13 03:37 -0800, you wrote:
&gt;Ken,
&gt;with respect to my question about creating links to specific areas 
&gt;within a pdf document using url(&quot;...&quot;):
&gt;
&gt;You suggested experimenting with s.pdf#block1&quot; which did not work. 
&gt;You asked me to let you know what I found out.
&gt;
&gt;I learned from 
&gt;http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/pdf_creation_apis_and_specs/PDFOpenParameters.pdf
&gt;that the correct format is nearly the same as what you suggested:
&gt;
&gt;url(&quot;s.pdf#nameddest=block1&quot;).
&gt;
&gt;Unfortunately, I found at 
&gt;http://xmlgraphics.apache.org/fop/0.94/extensions.html#named-destinations
&gt;that FOP has not implemented this extension. Thus, while there is a 
&gt;means for accomplishing my goal, I will have to switch rendering 
&gt;engines to do so.
&gt;
&gt;Thanks for spending time with me on this question. I hope the 
&gt;information I found will be useful to you and others,
&gt;Mark


--
Vote for your XML training:   http://www.CraneSoftwrights.com/m/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/m/
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/m/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/msg1000306724.html</link>
</item><item>
<title>Re: [xsl] using xsl:output-character to render characters in 2 ways - 11/13/2009 4:40:00 PM</title>
<description><![CDATA[<pre>Tom T wrote:
&gt; I'll change my example.
&gt; 
&gt; Financial Times, &quot;Erdo&#196;Ÿan Grubu'na&quot;
&gt; 
&gt; creates
&gt; 
&gt;   &lt;meta name=&quot;description&quot;
&gt;             content='Financial Times, &amp;#34;Erdo&#196;Ÿan Grubu'na&amp;#34;'
&gt;             /&gt;
&gt; 
&gt; I now have an attribute that is marked up by single quotes containing
&gt; a single quote. IE6 for one cannot deal with this.

Is the above 'meta' element the output of an XSLT processor? Which one 
do you use?

For instance when I have an input XML with your above text

&lt;desc&gt;Financial Times, &quot;Erdo&#196;Ÿan Grubu'na&quot;&lt;/desc&gt;

and then use Saxon 9.2.0.3 to run the stylesheet

&lt;xsl:stylesheet
   xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
   xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;
   xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
   exclude-result-prefixes=&quot;xs&quot;
   version=&quot;2.0&quot;&gt;

   &lt;xsl:output indent=&quot;yes&quot; method=&quot;xhtml&quot; omit-xml-declaration=&quot;yes&quot;/&gt;

   &lt;xsl:template match=&quot;/&quot;&gt;
     &lt;html&gt;
       &lt;head&gt;
         &lt;title&gt;Example&lt;/title&gt;
         &lt;xsl:apply-templates select=&quot;desc&quot;/&gt;
       &lt;/head&gt;
       &lt;body&gt;
       &lt;/body&gt;
     &lt;/html&gt;
   &lt;/xsl:template&gt;

   &lt;xsl:template match=&quot;desc&quot;&gt;
     &lt;meta name=&quot;description&quot; content=&quot;{.}&quot;/&gt;
   &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;

against that input then the resulting XHTML document is

&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
    &lt;head&gt;
       &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
       &lt;title&gt;Example&lt;/title&gt;
       &lt;meta name=&quot;description&quot; content=&quot;Financial Times, &amp;#34;Erdo&#196;Ÿan 
Grubu'na&amp;#34;&quot; /&gt;
    &lt;/head&gt;
    &lt;body&gt;&lt;/body&gt;
&lt;/html&gt;

and that output looks fine to me, the content attribute value is 
delimited by double quotes and therefore any double quote in the value 
is escaped.



-- 

	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/msg1000306723.html</link>
</item><item>
<title>Re: [xsl] using xsl:output-character to render characters in 2 ways - 11/13/2009 4:38:00 PM</title>
<description><![CDATA[<pre>Tom T wrote:
&gt; I'll change my example.
&gt; 
&gt; Financial Times, &quot;Erdo&#196;Ÿan Grubu'na&quot;
&gt; 
&gt; creates
&gt; 
&gt;   &lt;meta name=&quot;description&quot;
&gt;             content='Financial Times, &amp;#34;Erdo&#196;Ÿan Grubu'na&amp;#34;'
&gt;             /&gt;
&gt; 
&gt; I now have an attribute that is marked up by single quotes containing
&gt; a single quote. IE6 for one cannot deal with this.

That is clearly in error.

Is this happening *with* your output character mapping in force, or
*without*?

If without, then the XSLT processor has a severe bug.  If with, then it
may be happening because of your character mapping.

~Chris
-- 
Chris Maden, text nerd  &lt;URL: http://crism.maden.org/ &gt;
&#226;€œThe State is that great fiction by which everyone tries to live at
 the expense of everyone else.&#226;€ &#226;€” Fr&#195;&#169;d&#195;&#169;ric Bastiat, &#226;€œL&#226;€™&#195;‰tat&#226;€
GnuPG Fingerprint: C6E4 E2A9 C9F8 71AC 9724 CAA3 19F8 6677 0077 C319

--~------------------------------------------------------------------
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/msg1000306722.html</link>
</item><item>
<title>Re: [xsl] using xsl:output-character to render characters in 2 ways - 11/13/2009 4:23:00 PM</title>
<description><![CDATA[<pre>I'll change my example.

Financial Times, &quot;Erdo&#196;Ÿan Grubu'na&quot;

creates

  &lt;meta name=&quot;description&quot;
            content='Financial Times, &amp;#34;Erdo&#196;Ÿan Grubu'na&amp;#34;'
            /&gt;

I now have an attribute that is marked up by single quotes containing
a single quote. IE6 for one cannot deal with this.



On Fri, Nov 13, 2009 at 3:45 PM, Florent Georges &lt;lists@fgeorges.org&gt; wrote:
&gt; Tom T wrote:
&gt;
&gt;&gt; &lt;meta name=&quot;description&quot; content='Financial Times,
&gt;&gt; &quot;Erdo&#196;Ÿan&quot; diyor.'&gt;
&gt;
&gt;&gt; So the attribute value is what I expect.. The problem is
&gt;&gt; that the double quotes we usually use on attributes are
&gt;&gt; now being rendered as single quotes. Any idea why?
&gt;
&gt; &#194;&#160;Why is it a problem? &#194;&#160;When the attribute value contains double quote chars and no single quote chars, that's a good choice from the serializer to use single quotes around the value IMHO.
&gt;
&gt; &#194;&#160;Regards,
&gt;
&gt; --
&gt; Florent Georges
&gt; http://www.fgeorges.org/
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&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/msg1000306721.html</link>
</item><item>
<title>Re: [xsl] using xsl:output-character to render characters in 2 ways - 11/13/2009 3:46:00 PM</title>
<description><![CDATA[<pre>Tom T wrote:

&gt; &lt;meta name=&quot;description&quot; content='Financial Times,
&gt; &quot;Erdo&#196;Ÿan&quot; diyor.'&gt;

&gt; So the attribute value is what I expect.. The problem is
&gt; that the double quotes we usually use on attributes are
&gt; now being rendered as single quotes. Any idea why?

  Why is it a problem?  When the attribute value contains double quote chars and no single quote chars, that's a good choice from the serializer to use single quotes around the value IMHO.

  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/msg1000306718.html</link>
</item><item>
<title>Re: [xsl] using xsl:output-character to render characters in 2 ways - 11/13/2009 3:41:00 PM</title>
<description><![CDATA[<pre>&gt;  but the implied question was how come the system isn't just doing the
&gt; necessary quoting for you, you must be suppressing its usual
&gt; serialisation somewhere and writing attribute syntax &quot;by hand&quot;?

The processor I am using (Saxon 9) is converting the following string:

Financial Times, &quot;Erdo&#196;Ÿan&quot; diyor.

to the following:

&lt;meta name=&quot;description&quot; content='Financial Times, &amp;#34;Erdo&#196;Ÿan&amp;#34; diyor.'&gt;

So the attribute value is what I expect. The problem is that the
double quotes we usually use on attributes are now being rendered as
single quotes. Any idea why?




On Thu, Nov 12, 2009 at 12:59 PM, David Carlisle &lt;davidc@nag.co.uk&gt; wrote:
&gt;
&gt;
&gt;&gt; Is it wrong to escape characters such as this in when its not an
&gt;&gt; attribute value? It will involve more work to cancel out the escaping.
&gt;
&gt; no or yes, depending.
&gt;
&gt; If you have a ' in a comment or cdata section or processing instruction
&gt; &#194;&#160;and quote it for example it is wrong because the xml parser won't
&gt; &#194;&#160;unquote it.
&gt;
&gt; &lt;p&gt; it's&lt;/p&gt;
&gt;
&gt; is the same as
&gt;
&gt; &lt;p&gt; it&amp;#39;s&lt;/p&gt;
&gt;
&gt; but
&gt;
&gt; &lt;?xml-stylesheet href='foo.xsl'?&gt;
&gt;
&gt; isn't the same as
&gt;
&gt;
&gt; &lt;?xml-stylesheet href=&amp;#39;foo.xsl&amp;#39;?&gt;
&gt;
&gt;
&gt; &#194;&#160;but the implied question was how come the system isn't just doing the
&gt; necessary quoting for you, you must be suppressing its usual
&gt; serialisation somewhere and writing attribute syntax &quot;by hand&quot;?
&gt;
&gt;&gt; If my way is as good as any, the only way I can get this to work is by
&gt;&gt; declaring the single-quote entity in a Doctype declaration for every
&gt;&gt; stylesheet its used in:
&gt;
&gt; given that it's easier and less keystrokes to type &amp;#xE503; as
&gt; &amp;single-quote; why bother with the entity at all, and just use &#194;&#160;&amp;#xE503;
&gt; It makes no difference to the XSLT processor, it won't see either
&gt; &amp;single-quote; or &amp;#xE503; both are expanded by teh xml parser before it
&gt; starts to look at the xslt code.
&gt;
&gt; David
&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: &#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/msg1000306717.html</link>
</item><item>
<title>RE: [xsl] xquery online tutorial - 11/13/2009 2:42:00 PM</title>
<description><![CDATA[<pre>http://www.w3schools.com/xquery/xquery_intro.asp 

-----Original Message-----
From: Selvaganesh [mailto:selvaganesh_t@hovservices.in] 
Sent: Friday, November 13, 2009 9:41 AM
To: xsl-list@lists.mulberrytech.com
Subject: [xsl] xquery online tutorial

Dear Friends,

I just want know the best and basic xquery online tutorial. Also how to
use the XSLT.

Thanks,
Selva



Confidentiality Notice:  This transmittal is a confidential
communication.  If you are not the intended recipient, you are hereby
notified that you have received this transmittal in error and that any
review, dissemination, distribution or copying of this transmittal is
strictly prohibited.  If you have received this communication in error,
please notify this office immediately by reply and immediately delete
this message and all of its attachments, if any.


--~------------------------------------------------------------------
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/msg1000306714.html</link>
</item><item>
<title>[xsl] xquery online tutorial - 11/13/2009 2:37:00 PM</title>
<description><![CDATA[<pre>Dear Friends,

I just want know the best and basic xquery online tutorial. Also how to use
the XSLT.

Thanks,
Selva



Confidentiality Notice:  This transmittal is a confidential communication.  If you are not the intended recipient, you are hereby notified that you have received this transmittal in error and that any review, dissemination, distribution or copying of this transmittal is strictly prohibited.  If you have received this communication in error, please notify this office immediately by reply and immediately delete this message and all of its attachments, if any.


--~------------------------------------------------------------------
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/msg1000306713.html</link>
</item><item>
<title>Re: [xsl] Unknown system function escape-uri() - 11/13/2009 2:31:00 PM</title>
<description><![CDATA[<pre>&gt; I suspected the naming might have been the issue, as there were a few
&gt; slight variations on the web.

when in doubt the authoritative source is freely available
 

http://www.w3.org/TR/xpath-functions

books, tutorials, examples, even mailing lists, are fine most of the time,
but sometimes you need to know the unfiltered truth....

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/msg1000306712.html</link>
</item><item>
<title>RE: [xsl] Unknown system function escape-uri() - 11/13/2009 2:23:00 PM</title>
<description><![CDATA[<pre>&gt; I am surprised, because I use xpath functions very 
&gt; frequently, and I am staring at the listing on page 773 of 
&gt; Michael Kay's XSLT 2.0 3rd ed.

&gt; Could anyone suggest a remedy?

Get yourself a copy of the 4th edition. In the 2.5 years between the 3rd
edition and the final W3C specs, a few things changed: this function was
split into several different functions.

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/msg1000306711.html</link>
</item><item>
<title>Re: [xsl] Unknown system function escape-uri() - 11/13/2009 2:14:00 PM</title>
<description><![CDATA[<pre>Thank you, David and Martin.

I suspected the naming might have been the issue, as there were a few
slight variations on the web.

Regards,
Tim


On Fri, Nov 13, 2009 at 8:02 AM, David Carlisle &lt;davidc@nag.co.uk&gt; wrote:
&gt;
&gt;
&gt;&gt; I am surprised, because I use xpath functions very frequently, and I
&gt;&gt; am staring at the listing on page 773 of Michael Kay's XSLT 2.0 3rd
&gt;&gt; ed.
&gt;&gt; Could anyone suggest a remedy?
&gt;
&gt; Michael has many admirable talents, but seeing into the future isn't one
&gt; of them.
&gt;
&gt; Check the date of that edition and the date of the final xpath2
&gt; recommendation
&gt;
&gt; the function you are looking for is probably:
&gt;
&gt;
&gt; http://www.w3.org/TR/xpath-functions/#func-encode-for-uri
&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: &#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/msg1000306710.html</link>
</item><item>
<title>Re: [xsl] multiple elements to use for grouping - 11/13/2009 1:38:00 PM</title>
<description><![CDATA[<pre>Hoskins, Dorothy [OCDUS Non J&amp;J] wrote:
&gt; HI, I have a hard time articulating this one, but I think the examples
&gt; will describe it best. I am trying to help someone sort a group of
&gt; Excel-generated content chunks, which means that the overall structure
&gt; is flat and I have to deal with siblings a lot. The output is supposed
&gt; to be a classified listing. I am using Oxygen with Saxon 9 open-source
&gt; and XSLT 2.
&gt; Input:
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt; &lt;root&gt;
&gt;    &lt;row&gt;
&gt;        &lt;Classification1&gt;Printing&lt;/Classification1&gt;
&gt;        &lt;Classification2&gt;Packaging&lt;/Classification2&gt;
&gt;        &lt;Customer&gt;Modern Press&lt;/Customer&gt;
&gt;        &lt;City&gt;Fairville&lt;/City&gt;
&gt;        &lt;Tel&gt;1-888-777-6666&lt;/Tel&gt;
&gt;        &lt;Fax&gt;1-888-777-5555&lt;/Fax&gt;
&gt;        &lt;Email&gt;name@gmail.com&lt;/Email&gt;
&gt;        &lt;Image href=&quot;images\logo.eps&quot;/&gt;
&gt;        &lt;Website&gt; www.modernprinting.com&lt;/Website&gt;
&gt;    &lt;/row&gt;
&gt;    &lt;row&gt;
&gt;        &lt;Classification1&gt;Packaging&lt;/Classification1&gt;
&gt;        &lt;Classification2&gt;Printing&lt;/Classification2&gt;
&gt;        &lt;Classification3&gt;Binding&lt;/Classification3&gt;
&gt;        &lt;Customer&gt;Complete Printing&lt;/Customer&gt;
&gt;        &lt;City&gt;Plainville&lt;/City&gt;
&gt;        &lt;Tel&gt;1-888-777-4444&lt;/Tel&gt;
&gt;        &lt;Fax&gt;1-888-777-3333&lt;/Fax&gt;
&gt;        &lt;Email&gt;name@gmail.com&lt;/Email&gt;
&gt;        &lt;Image href=&quot;images\logo.eps&quot;/&gt;
&gt;        &lt;Website&gt; www.completeprinting.com&lt;/Website&gt;
&gt;    &lt;/row&gt;
&gt;    &lt;row&gt;
&gt;        &lt;Classification1&gt;Binding&lt;/Classification3&gt;
                                   ^^^^^^^^^^^^^^^^

This is not well-formed.

&gt;        &lt;Customer&gt;The Bindery&lt;/Customer&gt;
&gt;        &lt;City&gt;Overyonder&lt;/City&gt;
&gt;        &lt;Tel&gt;1-888-777-2222&lt;/Tel&gt;
&gt;        &lt;Fax&gt;1-888-777-1111&lt;/Fax&gt;
&gt;        &lt;Email&gt;name@gmail.com&lt;/Email&gt;
&gt;        &lt;Image href=&quot;images\logo.eps&quot;/&gt;
&gt;        &lt;Website&gt; www.thebindery.com&lt;/Website&gt;
&gt;    &lt;/row&gt;
&gt; &lt;/root&gt;
&gt; 
&gt; Desired output: Group all the Customers and their sibling city, phone.
&gt; fax, etc. under one unique Classification named from the equality of
&gt; values of all Classification, Classification2 and Classification3
&gt; elements. In other words, the &lt;Customer&gt; named Modern Printing Press
&gt; would show up under each of the three different classifications
&gt; (Binding, Packaging and Printing) listed under its parent &lt;data&gt; name.
&gt; Complete Printing would show up under both Packaging and Printing. The
&gt; Bindery would appear only under Binding.

Try whether the following does what you want:

&lt;xsl:stylesheet
   xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
   xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;
   exclude-result-prefixes=&quot;xs&quot;
   version=&quot;2.0&quot;&gt;

   &lt;xsl:output indent=&quot;yes&quot;/&gt;

   &lt;xsl:template match=&quot;root&quot;&gt;
     &lt;directory&gt;
       &lt;xsl:for-each-group select=&quot;row&quot; group-by=&quot;Classification1, 
Classification2, Classification3&quot;&gt;
         &lt;xsl:sort select=&quot;current-grouping-key()&quot;/&gt;
         &lt;listing&gt;
           &lt;Classification&gt;&lt;xsl:value-of 
select=&quot;current-grouping-key()&quot;/&gt;&lt;/Classification&gt;
           &lt;xsl:copy-of select=&quot;current-group()/(* except 
(Classification1, Classification2, Classification3))&quot;/&gt;
         &lt;/listing&gt;
       &lt;/xsl:for-each-group&gt;
     &lt;/directory&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/200911/msg1000306707.html</link>
</item><item>
<title>[xsl] multiple elements to use for grouping - 11/13/2009 1:22:00 PM</title>
<description><![CDATA[<pre>HI, I have a hard time articulating this one, but I think the examples
will describe it best. I am trying to help someone sort a group of
Excel-generated content chunks, which means that the overall structure
is flat and I have to deal with siblings a lot. The output is supposed
to be a classified listing. I am using Oxygen with Saxon 9 open-source
and XSLT 2.
Input:
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;root&gt;
   &lt;row&gt;
       &lt;Classification1&gt;Printing&lt;/Classification1&gt;
       &lt;Classification2&gt;Packaging&lt;/Classification2&gt;
       &lt;Customer&gt;Modern Press&lt;/Customer&gt;
       &lt;City&gt;Fairville&lt;/City&gt;
       &lt;Tel&gt;1-888-777-6666&lt;/Tel&gt;
       &lt;Fax&gt;1-888-777-5555&lt;/Fax&gt;
       &lt;Email&gt;name@gmail.com&lt;/Email&gt;
       &lt;Image href=&quot;images\logo.eps&quot;/&gt;
       &lt;Website&gt; www.modernprinting.com&lt;/Website&gt;
   &lt;/row&gt;
   &lt;row&gt;
       &lt;Classification1&gt;Packaging&lt;/Classification1&gt;
       &lt;Classification2&gt;Printing&lt;/Classification2&gt;
       &lt;Classification3&gt;Binding&lt;/Classification3&gt;
       &lt;Customer&gt;Complete Printing&lt;/Customer&gt;
       &lt;City&gt;Plainville&lt;/City&gt;
       &lt;Tel&gt;1-888-777-4444&lt;/Tel&gt;
       &lt;Fax&gt;1-888-777-3333&lt;/Fax&gt;
       &lt;Email&gt;name@gmail.com&lt;/Email&gt;
       &lt;Image href=&quot;images\logo.eps&quot;/&gt;
       &lt;Website&gt; www.completeprinting.com&lt;/Website&gt;
   &lt;/row&gt;
   &lt;row&gt;
       &lt;Classification1&gt;Binding&lt;/Classification3&gt;
       &lt;Customer&gt;The Bindery&lt;/Customer&gt;
       &lt;City&gt;Overyonder&lt;/City&gt;
       &lt;Tel&gt;1-888-777-2222&lt;/Tel&gt;
       &lt;Fax&gt;1-888-777-1111&lt;/Fax&gt;
       &lt;Email&gt;name@gmail.com&lt;/Email&gt;
       &lt;Image href=&quot;images\logo.eps&quot;/&gt;
       &lt;Website&gt; www.thebindery.com&lt;/Website&gt;
   &lt;/row&gt;
&lt;/root&gt;

Desired output: Group all the Customers and their sibling city, phone.
fax, etc. under one unique Classification named from the equality of
values of all Classification, Classification2 and Classification3
elements. In other words, the &lt;Customer&gt; named Modern Printing Press
would show up under each of the three different classifications
(Binding, Packaging and Printing) listed under its parent &lt;data&gt; name.
Complete Printing would show up under both Packaging and Printing. The
Bindery would appear only under Binding.
&lt;directory&gt;
   &lt;listing&gt;
       &lt;Classification&gt;Binding&lt;/Classification&gt;
       &lt;Customer&gt;The Bindery&lt;/Customer&gt;
       &lt;City&gt;Overyonder&lt;/City&gt;
       &lt;Box&gt;7654&lt;/Box&gt;
       &lt;Tel&gt;1-888-777-2222&lt;/Tel&gt;
       &lt;Fax&gt;1-888-777-1111&lt;/Fax&gt;
       &lt;Email&gt;name@gmail.com&lt;/Email&gt;
       &lt;Image href=&quot;images\logo.eps&quot;/&gt;
       &lt;Website&gt; www.thebindery.com&lt;/Website&gt;
       &lt;Customer&gt;Complete Printing&lt;/Customer&gt;
       &lt;City&gt;Plainville&lt;/City&gt;
       &lt;Box&gt;1234&lt;/Box&gt;
       &lt;Tel&gt;1-888-777-4444&lt;/Tel&gt;
       &lt;Fax&gt;1-888-777-3333&lt;/Fax&gt;
       &lt;Email&gt;name@gmail.com&lt;/Email&gt;
       &lt;Image href=&quot;images\logo.eps&quot;/&gt;
       &lt;Website&gt; www.completeprinting.com&lt;/Website&gt;
   &lt;/listing&gt;
   &lt;listing&gt;
       &lt;Classification&gt;Packaging&lt;/Classification&gt;
       &lt;Customer&gt;Complete Printing&lt;/Customer&gt;
       &lt;City&gt;Plainville&lt;/City&gt;
       &lt;Box&gt;1234&lt;/Box&gt;
       &lt;Tel&gt;1-888-777-4444&lt;/Tel&gt;
       &lt;Fax&gt;1-888-777-3333&lt;/Fax&gt;
       &lt;Email&gt;name@gmail.com&lt;/Email&gt;
       &lt;Image href=&quot;images\logo.eps&quot;/&gt;
       &lt;Website&gt; www.completeprinting.com&lt;/Website&gt;
       &lt;Customer&gt;Modern Press&lt;/Customer&gt;
       &lt;City&gt;Fairville&lt;/City&gt;
       &lt;Box&gt;5294&lt;/Box&gt;
       &lt;Tel&gt;1-888-777-6666&lt;/Tel&gt;
       &lt;Fax&gt;1-888-777-5555&lt;/Fax&gt;
       &lt;Email&gt;name@gmail.com&lt;/Email&gt;
       &lt;Image href=&quot;images\logo.eps&quot;/&gt;
       &lt;Website&gt; www.mycompany.com&lt;/Website&gt;
   &lt;/listing&gt;
   &lt;listing&gt;
       &lt;Classification&gt;Printing&lt;/Classification&gt;
       &lt;Customer&gt;Complete Printing&lt;/Customer&gt;
       &lt;City&gt;Plainville&lt;/City&gt;
       &lt;Box&gt;1234&lt;/Box&gt;
       &lt;Tel&gt;1-888-777-4444&lt;/Tel&gt;
       &lt;Fax&gt;1-888-777-3333&lt;/Fax&gt;
       &lt;Email&gt;name@gmail.com&lt;/Email&gt;
       &lt;Image href=&quot;images\logo.eps&quot;/&gt;
       &lt;Website&gt; www.completeprinting.com&lt;/Website&gt;
       &lt;Customer&gt;Modern Press&lt;/Customer&gt;
       &lt;City&gt;Fairville&lt;/City&gt;
       &lt;Box&gt;5294&lt;/Box&gt;
       &lt;Tel&gt;1-888-777-6666&lt;/Tel&gt;
       &lt;Fax&gt;1-888-777-5555&lt;/Fax&gt;
       &lt;Email&gt;name@gmail.com&lt;/Email&gt;
       &lt;Image href=&quot;images\logo.eps&quot;/&gt;
       &lt;Website&gt; www.mycompany.com&lt;/Website&gt;
   &lt;/listing&gt;
&lt;/directory&gt;


I had great success helping this person with the project when there was
one Classification in each &lt;data&gt; (thanks to xsl-list archives,
especially Ken Holman). Now that my friend says that a &lt;Customer&gt; can
belong with up to three different headings in the directory, the flat
structure has me confused how to approach the sorting and grouping.
So please help me understand. I know that I go up to the grandparent
axis, &lt;root&gt;, so that I can remove duplicates based upon the entire set
of grandchild &lt;Classification&gt;, &lt;Classification2&gt;, &lt;Classification3&gt;
elements. But how do I create the grouping and remove duplicate value
classifications, would I use
       contains(local-name(),'Classification')
or something of that sort? or is this an occasion for a regex?

And then recasting the unique value of the for-each-group to a single
element named &lt;Classification&gt; would use current-grouping-key?

Is this best done with two passes, or can I do it with a single XLS?
Regards, Dorothy

--~------------------------------------------------------------------
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/msg1000306706.html</link>
</item><item>
<title>Re: [xsl] Unknown system function escape-uri() - 11/13/2009 1:04:00 PM</title>
<description><![CDATA[<pre>&gt; I am surprised, because I use xpath functions very frequently, and I
&gt; am staring at the listing on page 773 of Michael Kay's XSLT 2.0 3rd
&gt; ed.
&gt; Could anyone suggest a remedy?

Michael has many admirable talents, but seeing into the future isn't one
of them.

Check the date of that edition and the date of the final xpath2
recommendation 

the function you are looking for is probably:


http://www.w3.org/TR/xpath-functions/#func-encode-for-uri

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/msg1000306705.html</link>
</item><item>
<title>Re: [xsl] Unknown system function escape-uri() - 11/13/2009 1:01:00 PM</title>
<description><![CDATA[<pre>Tim Lebo wrote:

&gt; Error at xsl:variable on line 14 column 108 of page2.xsl:
&gt;   XPST0017: XPath syntax error at char 68 on line 14 in {...+named url
&gt; file*.xml',false...}:
&gt;     Unknown system function escape-uri()

Maybe http://www.w3.org/TR/xpath-functions/#func-encode-for-uri is what 
you are looking for.


-- 

	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/msg1000306704.html</link>
</item><item>
<title>[xsl] Unknown system function escape-uri() - 11/13/2009 12:56:00 PM</title>
<description><![CDATA[<pre>xsl-list,

I am attempting to retrieve a document from a URL with the following
script and saxonhe9-2-0-3j.jar
I have done this before with URLs that do not contain characters such
as {*+ etc.

I am getting the error:

Error at xsl:variable on line 14 column 108 of page2.xsl:
  XPST0017: XPath syntax error at char 68 on line 14 in {...+named url
file*.xml',false...}:
    Unknown system function escape-uri()


I am surprised, because I use xpath functions very frequently, and I
am staring at the listing on page 773 of Michael Kay's XSLT 2.0 3rd
ed.
Could anyone suggest a remedy?

Regards,
Tim Lebo


&lt;xsl:transform version=&quot;2.0&quot;
               xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
               exclude-result-prefixes=&quot;&quot;&gt;
&lt;xsl:output method=&quot;xml&quot; indent=&quot;yes&quot; omit-xml-declaration=&quot;yes&quot;/&gt;

&lt;xsl:template match=&quot;/&quot;&gt;
   &lt;xsl:variable name=&quot;url&quot; select=&quot;escape-uri('http://files.com/my
poorly+named url file*.xml',false())&quot;/&gt;
   &lt;xsl:variable name=&quot;webfile&quot; select=&quot;doc($url)&quot;/&gt;
   &lt;xsl:apply-templates select=&quot;$webfile/*&quot;/&gt;


   &lt;!-- just to check that I can call default xpath functions --&gt;
   &lt;xsl:variable name=&quot;check-fn&quot; select=&quot;distinct-values((4, 4, 5))&quot;/&gt;
   &lt;xsl:for-each select=&quot;$check-fn&quot;&gt;
      &lt;xsl:value-of select=&quot;.&quot;/&gt;
   &lt;/xsl:for-each&gt;
&lt;/xsl:template&gt;

&lt;/xsl:transform&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/msg1000306700.html</link>
</item><item>
<title>Re: [xsl] fo:basic-link - 11/13/2009 11:37:00 AM</title>
<description><![CDATA[<pre>Ken,
with respect to my question about creating links to specific areas within a 
pdf document using url(&quot;...&quot;):

You suggested experimenting with s.pdf#block1&quot; which did not work. You asked 
me to let you know what I found out.

I learned from 
http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/pdf_creation_apis_and_specs/PDFOpenParameters.pdf
that the correct format is nearly the same as what you suggested:

url(&quot;s.pdf#nameddest=block1&quot;).

Unfortunately, I found at 
http://xmlgraphics.apache.org/fop/0.94/extensions.html#named-destinations
that FOP has not implemented this extension. Thus, while there is a means 
for accomplishing my goal, I will have to switch rendering engines to do so.

Thanks for spending time with me on this question. I hope the information I 
found will be useful to you and others,
Mark
--------------------------------------------------
From: &quot;G. Ken Holman&quot; &lt;gkholman@CraneSoftwrights.com&gt;
Sent: Friday, November 06, 2009 6:45 PM
To: &lt;xsl-list@lists.mulberrytech.com&gt;
Subject: Re: [xsl] fo:basic-link

&gt;
&gt; I would experiment with:
&gt;
&gt;   external-destination='url(&quot;s.pdf#block1&quot;)'
&gt;
&gt; .... but I don't know of any browser/reader that supports such a syntax 
&gt; but perhaps your platform combination described above supports that (it 
&gt; has been many years since I've tried).

&gt;I look forward to hearing of your progress in finding how to do this.

&gt;. . . . . . . . . . . Ken

 



--~------------------------------------------------------------------
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/msg1000306695.html</link>
</item><item>
<title>Re: [xsl] Grouping into duplicates and non duplicate lists - 11/13/2009 11:16:00 AM</title>
<description><![CDATA[<pre>Cavanagh, Tim (DFEEST) wrote:
&gt; Hi, I have scoured the web for help on this and have been through the archives and Jenis' grouping pages but I cannot work it out. So here goes.
&gt; 
&gt; I am using xslt 1.0 and MSXML parser
&gt; 
&gt; I have an xml file that has a series of notes Like so
&gt; &lt;CourseNote&gt;
&gt;           &lt;CourseNoteItem&gt;
&gt;             &lt;StudyGroupName&gt;Aboriginal or Torres Strait Islanders&lt;/StudyGroupName&gt;
&gt;             &lt;Year&gt;2009&lt;/Year&gt;
&gt;             &lt;CourseNoteText&gt;A&lt;/CourseNoteText&gt;
&gt;             &lt;StudyGroupOrder&gt;2&lt;/StudyGroupOrder&gt;
&gt;             &lt;StudyGroupCode&gt;ATSI&lt;/StudyGroupCode&gt;
&gt;             &lt;DisplaySequence&gt;2&lt;/DisplaySequence&gt;
&gt;           &lt;/CourseNoteItem&gt;
&gt;           &lt;CourseNoteItem&gt;
&gt;             &lt;StudyGroupName&gt;Aboriginal or Torres Strait Islanders&lt;/StudyGroupName&gt;
&gt;             &lt;Year&gt;2009&lt;/Year&gt;
&gt;             &lt;CourseNoteText&gt;B&lt;/CourseNoteText&gt;
&gt;             &lt;StudyGroupOrder&gt;2&lt;/StudyGroupOrder&gt;
&gt;             &lt;StudyGroupCode&gt;ATSI&lt;/StudyGroupCode&gt;
&gt;             &lt;DisplaySequence&gt;5&lt;/DisplaySequence&gt;
&gt;           &lt;/CourseNoteItem&gt;
&gt;           &lt;CourseNoteItem&gt;
&gt;             &lt;StudyGroupName&gt;Award&lt;/StudyGroupName&gt;
&gt;             &lt;Year&gt;2009&lt;/Year&gt;
&gt;             &lt;CourseNoteText&gt;A&lt;/CourseNoteText&gt;
&gt;             &lt;StudyGroupOrder&gt;1&lt;/StudyGroupOrder&gt;
&gt;             &lt;StudyGroupCode&gt;AWD&lt;/StudyGroupCode&gt;
&gt;             &lt;DisplaySequence&gt;2&lt;/DisplaySequence&gt;
&gt;           &lt;/CourseNoteItem&gt;
&gt;           &lt;CourseNoteItem&gt;
&gt;             &lt;StudyGroupName&gt;Award&lt;/StudyGroupName&gt;
&gt;             &lt;Year&gt;2009&lt;/Year&gt;
&gt;             &lt;CourseNoteText&gt;B&lt;/CourseNoteText&gt;
&gt;             &lt;StudyGroupOrder&gt;1&lt;/StudyGroupOrder&gt;
&gt;             &lt;StudyGroupCode&gt;AWD&lt;/StudyGroupCode&gt;
&gt;             &lt;DisplaySequence&gt;5&lt;/DisplaySequence&gt;
&gt;           &lt;/CourseNoteItem&gt;
&gt;           &lt;CourseNoteItem&gt;
&gt;             &lt;StudyGroupName&gt;Award&lt;/StudyGroupName&gt;
&gt;             &lt;Year&gt;2009&lt;/Year&gt;
&gt;             &lt;CourseNoteText&gt;C&lt;/CourseNoteText&gt;
&gt;             &lt;StudyGroupOrder&gt;1&lt;/StudyGroupOrder&gt;
&gt;             &lt;StudyGroupCode&gt;AWD&lt;/StudyGroupCode&gt;
&gt;             &lt;DisplaySequence&gt;7&lt;/DisplaySequence&gt;
&gt;           &lt;/CourseNoteItem&gt;
&gt;         &lt;/CourseNote&gt;
&gt; 
&gt; There can be many different StudyGroupCodes, many CourseNoteTexts and many Years. I would like to display a 'Generic' List of notes eg those that are duplicated in every StudyGroup and then display lists of StudyGroups with the CourseNoteTexts that are not duplicated in all other StudyGroups. I am familiar with keys and get get lists of unigue items and group them but I cannot exclude the items that do not appear in all StudyGroups... 

Can you post the XSLT output you want to create for the above input?

-- 

	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/msg1000306694.html</link>
</item><item>
<title>[xsl] Grouping into duplicates and non duplicate lists - 11/13/2009 6:45:00 AM</title>
<description><![CDATA[<pre>Hi, I have scoured the web for help on this and have been through the archives and Jenis' grouping pages but I cannot work it out. So here goes.

I am using xslt 1.0 and MSXML parser

I have an xml file that has a series of notes Like so
&lt;CourseNote&gt;
          &lt;CourseNoteItem&gt;
            &lt;StudyGroupName&gt;Aboriginal or Torres Strait Islanders&lt;/StudyGroupName&gt;
            &lt;Year&gt;2009&lt;/Year&gt;
            &lt;CourseNoteText&gt;A&lt;/CourseNoteText&gt;
            &lt;StudyGroupOrder&gt;2&lt;/StudyGroupOrder&gt;
            &lt;StudyGroupCode&gt;ATSI&lt;/StudyGroupCode&gt;
            &lt;DisplaySequence&gt;2&lt;/DisplaySequence&gt;
          &lt;/CourseNoteItem&gt;
          &lt;CourseNoteItem&gt;
            &lt;StudyGroupName&gt;Aboriginal or Torres Strait Islanders&lt;/StudyGroupName&gt;
            &lt;Year&gt;2009&lt;/Year&gt;
            &lt;CourseNoteText&gt;B&lt;/CourseNoteText&gt;
            &lt;StudyGroupOrder&gt;2&lt;/StudyGroupOrder&gt;
            &lt;StudyGroupCode&gt;ATSI&lt;/StudyGroupCode&gt;
            &lt;DisplaySequence&gt;5&lt;/DisplaySequence&gt;
          &lt;/CourseNoteItem&gt;
          &lt;CourseNoteItem&gt;
            &lt;StudyGroupName&gt;Award&lt;/StudyGroupName&gt;
            &lt;Year&gt;2009&lt;/Year&gt;
            &lt;CourseNoteText&gt;A&lt;/CourseNoteText&gt;
            &lt;StudyGroupOrder&gt;1&lt;/StudyGroupOrder&gt;
            &lt;StudyGroupCode&gt;AWD&lt;/StudyGroupCode&gt;
            &lt;DisplaySequence&gt;2&lt;/DisplaySequence&gt;
          &lt;/CourseNoteItem&gt;
          &lt;CourseNoteItem&gt;
            &lt;StudyGroupName&gt;Award&lt;/StudyGroupName&gt;
            &lt;Year&gt;2009&lt;/Year&gt;
            &lt;CourseNoteText&gt;B&lt;/CourseNoteText&gt;
            &lt;StudyGroupOrder&gt;1&lt;/StudyGroupOrder&gt;
            &lt;StudyGroupCode&gt;AWD&lt;/StudyGroupCode&gt;
            &lt;DisplaySequence&gt;5&lt;/DisplaySequence&gt;
          &lt;/CourseNoteItem&gt;
          &lt;CourseNoteItem&gt;
            &lt;StudyGroupName&gt;Award&lt;/StudyGroupName&gt;
            &lt;Year&gt;2009&lt;/Year&gt;
            &lt;CourseNoteText&gt;C&lt;/CourseNoteText&gt;
            &lt;StudyGroupOrder&gt;1&lt;/StudyGroupOrder&gt;
            &lt;StudyGroupCode&gt;AWD&lt;/StudyGroupCode&gt;
            &lt;DisplaySequence&gt;7&lt;/DisplaySequence&gt;
          &lt;/CourseNoteItem&gt;
        &lt;/CourseNote&gt;

There can be many different StudyGroupCodes, many CourseNoteTexts and many Years. I would like to display a 'Generic' List of notes eg those that are duplicated in every StudyGroup and then display lists of StudyGroups with the CourseNoteTexts that are not duplicated in all other StudyGroups. I am familiar with keys and get get lists of unigue items and group them but I cannot exclude the items that do not appear in all StudyGroups... 

Here is a fragment of my very poor solution which does not allow me to group by StudyGroup the Notes that are not in all StudyGroups:

&lt;ul&gt;
&lt;xsl:for-each select=&quot;CourseNoteItem[count(. | key('CN-T', concat(Year, CourseNoteText))[1]) = 1]&quot;&gt;
&lt;xsl:if test=&quot;count(preceding-sibling::node()[name()=name(current())])=0&quot;&gt;
&lt;li&gt;
&lt;strong&gt;Applies to all Study Groups&lt;/strong&gt;
&lt;br /&gt;
&lt;xsl:copy-of select=&quot;CourseNoteText/node()&quot; /&gt;
&lt;/li&gt;
&lt;/xsl:if&gt;
&lt;xsl:if test=&quot;count(preceding-sibling::node()[name()=name(current())])!=0&quot;&gt;
&lt;li&gt;
&lt;strong&gt;
&lt;xsl:value-of select=&quot;StudyGroupName&quot; /&gt;
&lt;/strong&gt;
&lt;br /&gt;
&lt;xsl:copy-of select=&quot;CourseNoteText/node()&quot; /&gt;
&lt;/li&gt;
&lt;/xsl:if&gt;
&lt;/xsl:for-each&gt;
&lt;/ul&gt;

Any help appreciated
Regards
&#160;
Tim Cavanagh
Senior Technical Architect

--~------------------------------------------------------------------
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/msg1000306678.html</link>
</item><item>
<title>Re: [xsl] Axis specifier questions once again - 11/12/2009 6:42:00 PM</title>
<description><![CDATA[<pre>Hi Ken:

I did explain the original mail that
Every listX/listlevel represents a stepX when transformed. StepX is
also a nested list.

I should have included the XSLT snippet in the original mail. Sorry
for that. But my problem is the same. Maybe I have expressed it
differently in the follow-up.

Anywayz, thank you for all your help.

On Thu, Nov 12, 2009 at 10:54 AM, G. Ken Holman
&lt;gkholman@cranesoftwrights.com&gt; wrote:
&gt; At 2009-11-12 10:05 -0600, you wrote:
&gt;&gt;
&gt;&gt; Hi Ken:
&gt;&gt;
&gt;&gt; Thank you for your response.
&gt;&gt;
&gt;&gt; Here is my problem.
&gt;
&gt; Forgive me for bowing out of this thread, but perhaps someone else can help
&gt; you. &#160;It is awkward to invest time in volunteering only to discover the
&gt; requirements were not fully explained.
&gt;
&gt; Here is the complete statement you supplied for your problem:
&gt;
&gt;&gt;&gt; Now, here is my problem. I want the &lt;note&gt; elements at the end of the
&gt;&gt;&gt; last &lt;listlevel&gt; element to come under the last step2 element.
&gt;
&gt; ... and I supplied a solution.
&gt;
&gt; At 2009-11-12 10:05 -0600, you wrote:
&gt;&gt;
&gt;&gt; So my template for each list looks like this:
&gt;
&gt; Furthermore, you still haven't described the real problem you are trying to
&gt; solve, this time you have only described a small fragment of the code of
&gt; your own that you want to change. &#160;This will rarely solve the problem at
&gt; hand, because if your approach was correct in the first place you wouldn't
&gt; have had the problem to report.
&gt;
&gt; It is unfortunate the code I gave you was unable to help you with your
&gt; problem. &#160;Please review the list guidelines regarding the posting of a
&gt; complete statement of your requirement and, hopefully, a complete stylesheet
&gt; fragment that illustrates the problem with as little extraneous information
&gt; as possible, so that volunteers can quickly address the real issue at hand
&gt; without investing time that gets wasted.
&gt;
&gt; I hope someone else can help you with your issue given the information
&gt; you've shared with the list.
&gt;
&gt; . . . . . . . . . . . Ken
&gt;
&gt;
&gt; --
&gt; Vote for your XML training: &#160; http://www.CraneSoftwrights.com/s/i/
&gt; Crane Softwrights Ltd. &#160; &#160; &#160; &#160; &#160;http://www.CraneSoftwrights.com/s/
&gt; Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
&gt; Video lesson: &#160; &#160;http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
&gt; Video overview: &#160;http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
&gt; G. Ken Holman &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; mailto:gkholman@CraneSoftwrights.com
&gt; Male Cancer Awareness Nov'07 &#160;http://www.CraneSoftwrights.com/s/bc
&gt; Legal business disclaimers: &#160;http://www.CraneSoftwrights.com/legal
&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/200911/msg1000306647.html</link>
</item><item>
<title>Re: [xsl] Axis specifier questions once again - 11/12/2009 4:57:00 PM</title>
<description><![CDATA[<pre>At 2009-11-12 10:05 -0600, you wrote:
&gt;Hi Ken:
&gt;
&gt;Thank you for your response.
&gt;
&gt;Here is my problem.

Forgive me for bowing out of this thread, but perhaps someone else 
can help you.  It is awkward to invest time in volunteering only to 
discover the requirements were not fully explained.

Here is the complete statement you supplied for your problem:

 &gt;&gt; Now, here is my problem. I want the &lt;note&gt; elements at the end of the
 &gt;&gt; last &lt;listlevel&gt; element to come under the last step2 element.

... and I supplied a solution.

At 2009-11-12 10:05 -0600, you wrote:
&gt;So my template for each list looks like this:

Furthermore, you still haven't described the real problem you are 
trying to solve, this time you have only described a small fragment 
of the code of your own that you want to change.  This will rarely 
solve the problem at hand, because if your approach was correct in 
the first place you wouldn't have had the problem to report.

It is unfortunate the code I gave you was unable to help you with 
your problem.  Please review the list guidelines regarding the 
posting of a complete statement of your requirement and, hopefully, a 
complete stylesheet fragment that illustrates the problem with as 
little extraneous information as possible, so that volunteers can 
quickly address the real issue at hand without investing time that gets wasted.

I hope someone else can help you with your issue given the 
information you've shared with the list.

. . . . . . . . . . . Ken


--
Vote for your XML training:   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/msg1000306639.html</link>
</item><item>
<title>Re: [xsl] Using 'validation' in xsl:result-document - 11/12/2009 4:11:00 PM</title>
<description><![CDATA[<pre>Thank you. That was very helpful.

On Tue, Nov 10, 2009 at 5:33 PM, Michael Kay &lt;mike@saxonica.com&gt; wrote:
&gt;&gt;
&gt;&gt; Thank you. So it is a correct understanding that it the
&gt;&gt; result-document goes after the schema in &lt;xsl:import-schema
&gt;&gt; schema-location=&quot;test.xsd&quot;/&gt; to validate the document?
&gt;&gt;
&gt;
&gt; No, the xsl:import-schema declaration can be anywhere in the stylesheet.
&gt; With very few exceptions, the order of components in a stylesheet makes no
&gt; difference.
&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/200911/msg1000306638.html</link>
</item><item>
<title>Re: [xsl] Axis specifier questions once again - 11/12/2009 4:06:00 PM</title>
<description><![CDATA[<pre>Hi Ken:

Thank you for your response.

Here is my problem.

Step1-3 have to be a nested list.

Every listlevel in list1 =step1, listlevel  in list2=step2 and
listlevel in list3=step3.

So my template for each list looks like this:

&lt;xsl:template match=&quot;list2&quot;&gt;
&lt;xsl:param name=&quot;level&quot; select=&quot;substring-after(local-name(), 'list')&quot;/&gt;
		&lt;xsl:for-each-group select=&quot;./listlevel&quot; group-by=&quot;.&quot;&gt;
&lt;xsl:element name=&quot;{ak:step($level)}&quot;&gt;
	&lt;text&gt;
					&lt;para&gt;
					
&lt;xsl:apply-templates select=&quot;*[not(following-sibling::list3) and
not(self::note)]&quot;/&gt;
					&lt;/para&gt;
				&lt;/text&gt;
&lt;xsl:apply-templates
select=&quot;following-sibling::*[1][not(self::listlevel)]|list3|listlevel&quot;/&gt;
&lt;/xsl:element&gt;
&lt;/xsl:for-each-group&gt;
&lt;/xsl:template&gt;


Now, if I do a &lt;xsl:apply-templates select=&quot;note&quot;/&gt; at the end, my output is

&lt;step1&gt;

&lt;note&gt;&lt;para&gt;test&lt;/para&gt;&lt;/note&gt;
 &lt;text&gt;
 sample1
 &lt;/text&gt;

&lt;step2&gt;

 &lt;text&gt;
 sample2
 &lt;/text&gt;
&lt;note&gt;&lt;para&gt;1 Note&lt;/para&gt;
&lt;/note&gt;
&lt;note&gt;&lt;para&gt;2 Note&lt;/para&gt;
&lt;/note&gt;
&lt;note&gt;&lt;para&gt;3 Note&lt;/para&gt;
&lt;/note&gt;
&lt;step3&gt;

 &lt;text&gt;
sample3
 &lt;/text&gt;
&lt;/step3&gt;

 &lt;text&gt;
 sample4
 &lt;/text&gt;
&lt;step3&gt;

 &lt;text&gt;
 sample5
 &lt;/text&gt;
&lt;/step3&gt;
 &lt;text&gt;
 sample6
 &lt;/text&gt;



&lt;/step2&gt;
&lt;note&gt;&lt;para&gt;1 Note&lt;/para&gt;
&lt;/note&gt;
&lt;note&gt;&lt;para&gt;2 Note&lt;/para&gt;
&lt;/note&gt;
&lt;note&gt;&lt;para&gt;3 Note&lt;/para&gt;
&lt;/note&gt;
&lt;/step1&gt;

Should I just change my approach in the the way I am numbering these
steps? Please advice.

Thanks






On Wed, Nov 11, 2009 at 3:01 PM, G. Ken Holman
&lt;gkholman@cranesoftwrights.com&gt; wrote:
&gt; At 2009-11-11 13:26 -0600, a kusa wrote:
&gt;&gt;
&gt;&gt; I have a nested list like this:
&gt;&gt; ...
&gt;&gt; So in my transformation, the above snippet would transform as follows
&gt;&gt; with the exception of the last notes where I am having a problem:
&gt;&gt; ...
&gt;&gt; Now, here is my problem. I want the &lt;note&gt; elements at the end of the
&gt;&gt; last &lt;listlevel&gt; element to come under the last step2 element.
&gt;
&gt; Fine ... so you want to first process step2 without processing notes, and
&gt; then you want to process the notes. &#160;I think regarding your issue this way
&gt; (if I've understood you correctly) is better than trying to conceive of axis
&gt; addressing as you've tried. &#160;I think you are missing the issue that the
&gt; result tree is created in the order of the result tree, not in the order of
&gt; the source tree.
&gt;
&gt; I hope the example below helps.
&gt;
&gt; . . . . . . . Ken
&gt;
&gt; t:\ftemp&gt;type akusa.xml
&gt; &lt;list1&gt;
&gt; &lt;note&gt;&lt;para&gt;test&lt;/para&gt;&lt;/note&gt;
&gt; &#160;&lt;listlevel&gt;
&gt; &#160;sample1
&gt; &#160;&lt;/listlevel&gt;
&gt;
&gt; &lt;list2&gt;
&gt; &#160;&lt;listlevel&gt;
&gt; &#160;sample2
&gt; &#160;&lt;/listlevel&gt;
&gt; &lt;list3&gt;
&gt;
&gt; &#160;&lt;listlevel&gt;
&gt; sample3
&gt; &#160;&lt;/listlevel&gt;
&gt; &lt;/list3&gt;
&gt;
&gt; &#160;&lt;listlevel&gt;
&gt; &#160;sample4
&gt; &#160;&lt;/listlevel&gt;
&gt; &lt;list3&gt;
&gt;
&gt; &#160;&lt;listlevel&gt;
&gt; &#160;sample5
&gt; &#160;&lt;/listlevel&gt;
&gt; &lt;/list3&gt;
&gt; &#160;&lt;listlevel&gt;
&gt; &#160;sample6
&gt; &#160;&lt;/listlevel&gt;
&gt; &lt;note&gt;&lt;para&gt;1 Note&lt;/para&gt;&lt;/note&gt;
&gt; &lt;note&gt;&lt;para&gt;2 Note&lt;/para&gt;&lt;/note&gt;
&gt; &lt;note&gt;&lt;para&gt;3 Note&lt;/para&gt;&lt;/note&gt;
&gt; &lt;/list2&gt;
&gt; &lt;/list1&gt;
&gt; t:\ftemp&gt;call xslt akusa.xml akusa.xsl
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;step1&gt;
&gt; &lt;note&gt;&lt;para&gt;test&lt;/para&gt;&lt;/note&gt;
&gt; &#160;&lt;text&gt;
&gt; &#160;sample1
&gt; &#160;&lt;/text&gt;
&gt;
&gt; &lt;step2&gt;
&gt; &#160;&lt;text&gt;
&gt; &#160;sample2
&gt; &#160;&lt;/text&gt;
&gt; &lt;step3&gt;
&gt;
&gt; &#160;&lt;text&gt;
&gt; sample3
&gt; &#160;&lt;/text&gt;
&gt; &lt;/step3&gt;
&gt;
&gt; &#160;&lt;text&gt;
&gt; &#160;sample4
&gt; &#160;&lt;/text&gt;
&gt; &lt;step3&gt;
&gt;
&gt; &#160;&lt;text&gt;
&gt; &#160;sample5
&gt; &#160;&lt;/text&gt;
&gt; &lt;/step3&gt;
&gt; &#160;&lt;text&gt;
&gt; &#160;sample6
&gt; &#160;&lt;/text&gt;
&gt;
&gt;
&gt;
&gt; &lt;/step2&gt;&lt;note&gt;&lt;para&gt;1 Note&lt;/para&gt;&lt;/note&gt;&lt;note&gt;&lt;para&gt;2
&gt; Note&lt;/para&gt;&lt;/note&gt;&lt;note&gt;&lt;para&gt;3 Note&lt;/para&gt;&lt;/note&gt;
&gt; &lt;/step1&gt;
&gt; t:\ftemp&gt;type akusa.xsl
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;US-ASCII&quot;?&gt;
&gt; &lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;version=&quot;1.0&quot;&gt;
&gt;
&gt; &lt;xsl:template match=&quot;list1&quot;&gt;
&gt; &#160;&lt;step1&gt;
&gt; &#160; &#160;&lt;xsl:apply-templates/&gt;
&gt; &#160;&lt;/step1&gt;
&gt; &lt;/xsl:template&gt;
&gt;
&gt; &lt;xsl:template match=&quot;list2&quot;&gt;
&gt; &#160;&lt;!--first produce the output not considering notes--&gt;
&gt; &#160;&lt;step2&gt;
&gt; &#160; &#160;&lt;xsl:apply-templates select=&quot;node()[not(self::note)]&quot;/&gt;
&gt; &#160;&lt;/step2&gt;
&gt; &#160;&lt;!--then continue the output with the notes--&gt;
&gt; &#160;&lt;xsl:apply-templates select=&quot;note&quot;/&gt;
&gt; &lt;/xsl:template&gt;
&gt;
&gt; &lt;xsl:template match=&quot;list3&quot;&gt;
&gt; &#160;&lt;step3&gt;
&gt; &#160; &#160;&lt;xsl:apply-templates/&gt;
&gt; &#160;&lt;/step3&gt;
&gt; &lt;/xsl:template&gt;
&gt;
&gt; &lt;xsl:template match=&quot;listlevel&quot;&gt;
&gt; &#160;&lt;text&gt;
&gt; &#160; &#160;&lt;xsl:apply-templates/&gt;
&gt; &#160;&lt;/text&gt;
&gt; &lt;/xsl:template&gt;
&gt;
&gt; &lt;xsl:template match=&quot;note&quot;&gt;
&gt; &#160;&lt;xsl:copy-of select=&quot;.&quot;/&gt;
&gt; &lt;/xsl:template&gt;
&gt;
&gt; &lt;/xsl:stylesheet&gt;
&gt; t:\ftemp&gt;rem Done!
&gt;
&gt;
&gt;
&gt; --
&gt; Vote for your XML training: &#160; http://www.CraneSoftwrights.com/s/i/
&gt; Crane Softwrights Ltd. &#160; &#160; &#160; &#160; &#160;http://www.CraneSoftwrights.com/s/
&gt; Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
&gt; Video lesson: &#160; &#160;http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
&gt; Video overview: &#160;http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
&gt; G. Ken Holman &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; mailto:gkholman@CraneSoftwrights.com
&gt; Male Cancer Awareness Nov'07 &#160;http://www.CraneSoftwrights.com/s/bc
&gt; Legal business disclaimers: &#160;http://www.CraneSoftwrights.com/legal
&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/200911/msg1000306637.html</link>
</item><item>
<title>RE: [xsl] Para element - 11/12/2009 2:51:00 PM</title>
<description><![CDATA[<pre>This discussion is out of scope for XSL-List.

Original Poster: this is a basic XML question, and thus inappropriate 
on XSL-List, which is a forum for discussion of XSL specifically, and 
not for general discussion of XML.

XSL-List Regulars: it is nice of you to try to help this newbie, but 
please respond off list to questions like this one, that are clearly 
off topic for XSL-List.

-- Tommie
    Owner, XSL-List

-- 

======================================================================
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/200911/msg1000306627.html</link>
</item><item>
<title>Re: [xsl] using xsl:output-character to render characters in 2 ways - 11/12/2009 1:02:00 PM</title>
<description><![CDATA[<pre>&gt; I do not, the JS does not work in an HTML doc if it is escaped.

But if you are using the html output method and the system is (as most
do) using &quot; to delimit attribute values, I wouldn't expect it to quote
the ' anyway.

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/msg1000306623.html</link>
</item><item>
<title>Re: [xsl] using xsl:output-character to render characters in 2 ways - 11/12/2009 1:00:00 PM</title>
<description><![CDATA[<pre>&gt; Is it wrong to escape characters such as this in when its not an
&gt; attribute value? It will involve more work to cancel out the escaping.

no or yes, depending.

If you have a ' in a comment or cdata section or processing instruction
 and quote it for example it is wrong because the xml parser won't
 unquote it.

&lt;p&gt; it's&lt;/p&gt;

is the same as 

&lt;p&gt; it&amp;#39;s&lt;/p&gt;

but

&lt;?xml-stylesheet href='foo.xsl'?&gt;

isn't the same as


&lt;?xml-stylesheet href=&amp;#39;foo.xsl&amp;#39;?&gt;


 but the implied question was how come the system isn't just doing the
necessary quoting for you, you must be suppressing its usual
serialisation somewhere and writing attribute syntax &quot;by hand&quot;?

&gt; If my way is as good as any, the only way I can get this to work is by
&gt; declaring the single-quote entity in a Doctype declaration for every
&gt; stylesheet its used in:

given that it's easier and less keystrokes to type &amp;#xE503; as
&amp;single-quote; why bother with the entity at all, and just use  &amp;#xE503;
It makes no difference to the XSLT processor, it won't see either
&amp;single-quote; or &amp;#xE503; both are expanded by teh xml parser before it
starts to look at the xslt code.

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/msg1000306622.html</link>
</item><item>
<title>Re: [xsl] using xsl:output-character to render characters in 2 ways - 11/12/2009 12:52:00 PM</title>
<description><![CDATA[<pre>I care because in some situations (such as attribute values) I need
the quote to be escaped but in other situations (eg in a JS function)
I do not, the JS does not work in an HTML doc if it is escaped.


On Thu, Nov 12, 2009 at 12:47 PM, Michael Kay &lt;mike@saxonica.com&gt; wrote:
&gt;
&gt; (a) character maps apply to all characters in the result tree, regardless
&gt; whether they originated in the source document or the stylesheet.
&gt;
&gt; (b) there's something fishy about your requirements that make one wants to
&gt; probe deeper. If you care whether or not numeric character references are
&gt; used in the result document, then you're not using XML the way it was
&gt; designed to be used.
&gt;
&gt; Regards,
&gt;
&gt; Michael Kay
&gt; http://www.saxonica.com/
&gt; http://twitter.com/michaelhkay
&gt;
&gt;&gt; -----Original Message-----
&gt;&gt; From: Tom T [mailto:tomw289@googlemail.com]
&gt;&gt; Sent: 12 November 2009 12:16
&gt;&gt; To: xsl-list@lists.mulberrytech.com
&gt;&gt; Subject: [xsl] using xsl:output-character to render
&gt;&gt; characters in 2 ways
&gt;&gt;
&gt;&gt; I wish to process single quotes in the following way:
&gt;&gt;
&gt;&gt; - when it is retreived from the source XML it should be
&gt;&gt; escaped to &amp;#39;
&gt;&gt;
&gt;&gt; - when it is embedded within the XSLT stylesheet it should
&gt;&gt; not be escaped and rendered as a '.
&gt;&gt;
&gt;&gt; To acheive this I have set up the following output-characters
&gt;&gt; in a character map:
&gt;&gt;
&gt;&gt; &lt;xsl:output-character character=&quot;&amp;#39;&quot; string=&quot;&amp;#38;#39;&quot; /&gt;
&gt;&gt; &lt;xsl:output-character character=&quot;&amp;single-quote;&quot; string=&quot;&amp;#39;&quot; /&gt;
&gt;&gt;
&gt;&gt; This works but it means I have to use the &amp;single-quote;
&gt;&gt; entity every time I want to use a single quote in the xslt
&gt;&gt; (eg for javascript.)
&gt;&gt;
&gt;&gt; Is there a better way to do this in XSLT 2?
&gt;&gt;
&gt;&gt; Thanks
&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; --~------------------------------------------------------------------
&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/msg1000306616.html</link>
</item><item>
<title>Re: [xsl] using xsl:output-character to render characters in 2 ways - 11/12/2009 12:50:00 PM</title>
<description><![CDATA[<pre>Its not just single quotes, it is a few other things as well including
double quotes, left double quotes, right double quotes and ampersands.
In my example, yes, it was to delimit attribute values.

Is it wrong to escape characters such as this in when its not an
attribute value? It will involve more work to cancel out the escaping.

If my way is as good as any, the only way I can get this to work is by
declaring the single-quote entity in a Doctype declaration for every
stylesheet its used in:

&lt;!DOCTYPE xsl:stylesheet [
	&lt;!ENTITY  single-quote &quot;&amp;#xE503;&quot;&gt;
]&gt;

is this the right way to go about this?


On Thu, Nov 12, 2009 at 12:29 PM, David Carlisle &lt;davidc@nag.co.uk&gt; wrote:
&gt;
&gt; If you are writing xml you shouldn't have to escape ' ever unless you
&gt; use ' to delimit attribute or entity values. If you really need to do
&gt; this then possibly your way is as good as any, I assume you've made
&gt; single-quote expand to some random unused character?
&gt;
&gt; An alternative that would allow you to use ' as ' in the stylesheet
&gt; would be to just have one character mapping
&gt;
&gt; &lt;xsl:output-character character=&quot;&amp;single-quote;&quot; string=&quot;&amp;amp;#39;&quot; /&gt;
&gt;
&gt; and then modify your input text with
&gt;
&gt; &lt;xsl:template match=&quot;text&quot;&gt;
&gt; &#160;&lt;xsl:value-of select=&quot;replace(.,'''','&amp;single-quote;')&quot;/&gt;
&gt; &lt;/xsl:template&gt;
&gt;
&gt; David
&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: &#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/msg1000306615.html</link>
</item><item>
<title>RE: [xsl] using xsl:output-character to render characters in 2 ways - 11/12/2009 12:48:00 PM</title>
<description><![CDATA[<pre>(a) character maps apply to all characters in the result tree, regardless
whether they originated in the source document or the stylesheet.

(b) there's something fishy about your requirements that make one wants to
probe deeper. If you care whether or not numeric character references are
used in the result document, then you're not using XML the way it was
designed to be used.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 

&gt; -----Original Message-----
&gt; From: Tom T [mailto:tomw289@googlemail.com] 
&gt; Sent: 12 November 2009 12:16
&gt; To: xsl-list@lists.mulberrytech.com
&gt; Subject: [xsl] using xsl:output-character to render 
&gt; characters in 2 ways
&gt; 
&gt; I wish to process single quotes in the following way:
&gt; 
&gt; - when it is retreived from the source XML it should be 
&gt; escaped to &amp;#39;
&gt; 
&gt; - when it is embedded within the XSLT stylesheet it should 
&gt; not be escaped and rendered as a '.
&gt; 
&gt; To acheive this I have set up the following output-characters 
&gt; in a character map:
&gt; 
&gt; &lt;xsl:output-character character=&quot;&amp;#39;&quot; string=&quot;&amp;#38;#39;&quot; /&gt; 
&gt; &lt;xsl:output-character character=&quot;&amp;single-quote;&quot; string=&quot;&amp;#39;&quot; /&gt;
&gt; 
&gt; This works but it means I have to use the &amp;single-quote; 
&gt; entity every time I want to use a single quote in the xslt 
&gt; (eg for javascript.)
&gt; 
&gt; Is there a better way to do this in XSLT 2?
&gt; 
&gt; Thanks
&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/msg1000306614.html</link>
</item><item>
<title>RE: [xsl] Para element - 11/12/2009 12:45:00 PM</title>
<description><![CDATA[<pre>&gt; Is the following statement true about a para element:
&gt; &quot;When you find a para element, you're only moving on to the 
&gt; next para element with the same name - if there isn't one you 
&gt; stop, so the section elements afterwards are ignored.&quot;

This sentence is talking about the behaviour of a particular XML structure.
It's only true or false in the context of that structure (and it's very
informal language anyway, so it also depends on the context of the
conversation.)

Asking whether this is true is like asking whether it's true that Mary is
married to John. The names mean nothing when taken out of context.

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/msg1000306613.html</link>
</item><item>
<title>Re: [xsl] using xsl:output-character to render characters in 2 ways - 11/12/2009 12:30:00 PM</title>
<description><![CDATA[<pre>If you are writing xml you shouldn't have to escape ' ever unless you
use ' to delimit attribute or entity values. If you really need to do
this then possibly your way is as good as any, I assume you've made 
single-quote expand to some random unused character?

An alternative that would allow you to use ' as ' in the stylesheet
would be to just have one character mapping

&lt;xsl:output-character character=&quot;&amp;single-quote;&quot; string=&quot;&amp;amp;#39;&quot; /&gt;

and then modify your input text with

&lt;xsl:template match=&quot;text&quot;&gt;
  &lt;xsl:value-of select=&quot;replace(.,'''','&amp;single-quote;')&quot;/&gt;
&lt;/xsl:template&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/msg1000306612.html</link>
</item><item>
<title>[xsl] using xsl:output-character to render characters in 2 ways - 11/12/2009 12:17:00 PM</title>
<description><![CDATA[<pre>I wish to process single quotes in the following way:

- when it is retreived from the source XML it should be escaped to &amp;#39;

- when it is embedded within the XSLT stylesheet it should not be
escaped and rendered as a '.

To acheive this I have set up the following output-characters in a
character map:

&lt;xsl:output-character character=&quot;&amp;#39;&quot; string=&quot;&amp;#38;#39;&quot; /&gt;
&lt;xsl:output-character character=&quot;&amp;single-quote;&quot; string=&quot;&amp;#39;&quot; /&gt;

This works but it means I have to use the &amp;single-quote; entity every
time I want to use a single quote in the xslt (eg for javascript.)

Is there a better way to do this in XSLT 2?

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/msg1000306611.html</link>
</item><item>
<title>RE: [xsl] Para element - 11/12/2009 11:10:00 AM</title>
<description><![CDATA[<pre>None of us can know what it means, unless you tell us about the schema you're using.
You might be using Docbook, in which case &lt;para&gt; means &quot;paragraph&quot;.
Or into extreme sports, in which case it might mean something related to &quot;parachute&quot;. 
If it's something military, &lt;para&gt; might mean &quot;paratroop&quot;.
Or something about political extremism, in which case it might mean &quot;para-military&quot;.
Or mathemiatical, where it might mean &quot;parameter&quot;.

Etc.



Unhelpfully,
Richard.



&gt; -----Original Message-----
&gt; From: Surana, Swati [mailto:swati.surana@citi.com] 
&gt; Sent: 12 November 2009 10:57
&gt; To: 'xsl-list@lists.mulberrytech.com'
&gt; Subject: RE: [xsl] Para element
&gt; 
&gt; 
&gt; Thanks Michael.
&gt; Is the following statement true about a para element:
&gt; &quot;When you find a para element, you're only moving on to the 
&gt; next para element with the same name - if there isn't one you 
&gt; stop, so the section elements afterwards are ignored.&quot;
&gt; 
&gt; 
&gt; Regards,
&gt; Swati
&gt; -----Original Message-----
&gt; From: Michael Kay [mailto:mike@saxonica.com]
&gt; Sent: 12 November 2009 10:07
&gt; To: xsl-list@lists.mulberrytech.com
&gt; Subject: RE: [xsl] Para element
&gt; 
&gt; &gt;
&gt; &gt; What exactly is a para element?
&gt; 
&gt; It's whatever you want it to be. Or rather, what the designer 
&gt; of the XML vocabulary you are using wants it to be. For 
&gt; example, if your input is DocBook, then para is what the 
&gt; DocBook definition says it is; if your input is XHTML, then 
&gt; you need to turn to the XHTML definition. That's the whole 
&gt; point about XML: anyone can define their own vocabulary, and 
&gt; the tags have no meaning except in the context of a specific 
&gt; vocabulary.
&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:  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; --~------------------------------------------------------------------
&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/msg1000306606.html</link>
</item><item>
<title>RE: [xsl] multiple + empty output - 11/12/2009 10:30:00 AM</title>
<description><![CDATA[<pre>&gt; 
&gt; Thx for your answer !
&gt; Unfortunately the problem remains :(
&gt; 

Then please raise it on the Saxon list and supply a repro so I can
investigate.

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/msg1000306603.html</link>
</item><item>
<title>AW: [xsl] multiple + empty output - 11/12/2009 10:22:00 AM</title>
<description><![CDATA[<pre>Thx for your answer !
Unfortunately the problem remains :(

regards


Patrick Szabo
 XSLT-Entwickler 

Tel.: +43 (1) 534 52 - 1573 
Fax: +43 (1) 534 52 - 146 

Patrick.Szabo@lexisnexis.at

LexisNexis Verlag ARD Orac GmbH &amp; Co KG
Marxergasse 25, 1030 Wien
FN 8333f, Handelsgericht Wien
http://www.lexisnexis.at/
 
-----Urspr&#195;&#188;ngliche Nachricht-----

Von: Michael Kay [mailto:mike@saxonica.com] 
Gesendet: Donnerstag, 12. November 2009 11:11
An: xsl-list@lists.mulberrytech.com
Betreff: RE: [xsl] multiple + empty output


Try adding &lt;xsl:template match=&quot;/&quot;&gt;&lt;xsl:apply-templates
select=&quot;//artikel&quot;/&gt;&lt;/xsl:template&gt;

I suspect that the processing of the content outside (or between) the
artikel elements - perhaps only whitespace - is finding its way into the
so-called principal result tree. The output file for the principal result
tree is created only if you write something to it.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 

&gt; -----Original Message-----
&gt; From: Szabo, Patrick (LNG-VIE) [mailto:patrick.szabo@lexisnexis.at] 
&gt; Sent: 12 November 2009 09:29
&gt; To: xsl-list@lists.mulberrytech.com
&gt; Subject: [xsl] multiple + empty output
&gt; 
&gt; Hi, 
&gt;  
&gt; I'm using Saxon 9 and XSLT 2.0.
&gt; I want to split 1 input-file in several output-files.
&gt; The problem is that i get the multiple files plus 1 empty file.
&gt;  
&gt; Like this:
&gt;  
&gt; 1_2006.xml --&gt; stylesheet --&gt; file1, file2, file3, 1_2006.xml
&gt;  
&gt; I don't want to create this empty 1_2006.xml :(
&gt;  
&gt; I've tried &lt;xsl:output 
&gt; method=&quot;saxon:net.sf.saxon.event.Sink&quot;/&gt; but it doesn't seem to work.
&gt;  
&gt; The stylesheet:
&gt; 
&gt; &lt;xsl:stylesheet version=&quot;2.0&quot;
&gt; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
&gt; xmlns:saxon=&quot;http://saxon.sf.net/&quot; 
&gt; exclude-result-prefixes=&quot;#all&quot;&gt; &lt;xsl:strip-space 
&gt; elements=&quot;zs_absatz&quot;/&gt; &lt;xsl:output 
&gt; method=&quot;saxon:net.sf.saxon.event.Sink&quot;/&gt;
&gt; &lt;xsl:output method=&quot;xml&quot; encoding=&quot;ISO-8859-1&quot; name=&quot;output&quot;/&gt;
&gt; &lt;!-- ========================================================== --&gt;
&gt; &lt;!-- Stylesheet: splitartikel --&gt;
&gt; &lt;!-- pro Beitrag eine Datei --&gt;
&gt; &lt;!-- 
&gt; ========================================================== 
&gt; --&gt; &lt;xsl:template match=&quot;artikel&quot;&gt;
&gt; 	&lt;xsl:variable name=&quot;filename&quot;&gt;
&gt; 		&lt;xsl:text&gt;../step12/MuR_&lt;/xsl:text&gt;
&gt; 		&lt;xsl:value-of
&gt; select=&quot;format-number(descendant::jahrgang[1], '0000')&quot;/&gt;
&gt; 		&lt;xsl:text&gt;_&lt;/xsl:text&gt;
&gt; 		&lt;xsl:choose&gt;
&gt; 			&lt;xsl:when
&gt; test=&quot;not(contains(descendant::ausgabe[1], '-'))&quot;&gt;
&gt; 				&lt;xsl:value-of
&gt; select=&quot;format-number(descendant::ausgabe[1], '00')&quot;/&gt;
&gt; 			&lt;/xsl:when&gt;
&gt; 			&lt;xsl:otherwise&gt;
&gt; 				&lt;xsl:value-of
&gt; select=&quot;descendant::ausgabe[1]&quot;/&gt;
&gt; 			&lt;/xsl:otherwise&gt;
&gt; 		&lt;/xsl:choose&gt; 
&gt; 		&lt;xsl:text&gt;_&lt;/xsl:text&gt;
&gt; 		&lt;xsl:value-of
&gt; select=&quot;format-number(descendant::seite-von[1], '000')&quot;/&gt;
&gt; 		&lt;xsl:if test=&quot;descendant::position&quot;&gt;
&gt; 			&lt;xsl:text&gt;_&lt;/xsl:text&gt;
&gt; 			&lt;xsl:value-of select=&quot;descendant::position[1]&quot;/&gt;
&gt; 		&lt;/xsl:if&gt;
&gt; 		&lt;xsl:text&gt;.xml&lt;/xsl:text&gt;
&gt; 	&lt;/xsl:variable&gt; 
&gt; 
&gt; 	&lt;xsl:result-document href=&quot;{$filename}&quot; format=&quot;output&quot;&gt;
&gt; 		&lt;xsl:copy-of select=&quot;.&quot;/&gt;
&gt; 	&lt;/xsl:result-document&gt;
&gt; &lt;/xsl:template&gt;
&gt; &lt;/xsl:stylesheet&gt;
&gt;  
&gt; 
&gt; Idea anyone ?!
&gt; 
&gt; regards
&gt; 
&gt; 
&gt; Patrick Szabo
&gt;  XSLT-Entwickler 
&gt; 
&gt; Tel.: +43 (1) 534 52 - 1573 
&gt; Fax: +43 (1) 534 52 - 146 
&gt; 
&gt; Patrick.Szabo@lexisnexis.at
&gt; 
&gt; LexisNexis Verlag ARD Orac GmbH &amp; Co KG
&gt; Marxergasse 25, 1030 Wien
&gt; FN 8333f, Handelsgericht Wien
&gt; http://www.lexisnexis.at/
&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;
--~--




--~------------------------------------------------------------------
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/msg1000306602.html</link>
</item><item>
<title>RE: [xsl] multiple + empty output - 11/12/2009 10:11:00 AM</title>
<description><![CDATA[<pre>Try adding &lt;xsl:template match=&quot;/&quot;&gt;&lt;xsl:apply-templates
select=&quot;//artikel&quot;/&gt;&lt;/xsl:template&gt;

I suspect that the processing of the content outside (or between) the
artikel elements - perhaps only whitespace - is finding its way into the
so-called principal result tree. The output file for the principal result
tree is created only if you write something to it.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 

&gt; -----Original Message-----
&gt; From: Szabo, Patrick (LNG-VIE) [mailto:patrick.szabo@lexisnexis.at] 
&gt; Sent: 12 November 2009 09:29
&gt; To: xsl-list@lists.mulberrytech.com
&gt; Subject: [xsl] multiple + empty output
&gt; 
&gt; Hi, 
&gt;  
&gt; I'm using Saxon 9 and XSLT 2.0.
&gt; I want to split 1 input-file in several output-files.
&gt; The problem is that i get the multiple files plus 1 empty file.
&gt;  
&gt; Like this:
&gt;  
&gt; 1_2006.xml --&gt; stylesheet --&gt; file1, file2, file3, 1_2006.xml
&gt;  
&gt; I don't want to create this empty 1_2006.xml :(
&gt;  
&gt; I've tried &lt;xsl:output 
&gt; method=&quot;saxon:net.sf.saxon.event.Sink&quot;/&gt; but it doesn't seem to work.
&gt;  
&gt; The stylesheet:
&gt; 
&gt; &lt;xsl:stylesheet version=&quot;2.0&quot;
&gt; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
&gt; xmlns:saxon=&quot;http://saxon.sf.net/&quot; 
&gt; exclude-result-prefixes=&quot;#all&quot;&gt; &lt;xsl:strip-space 
&gt; elements=&quot;zs_absatz&quot;/&gt; &lt;xsl:output 
&gt; method=&quot;saxon:net.sf.saxon.event.Sink&quot;/&gt;
&gt; &lt;xsl:output method=&quot;xml&quot; encoding=&quot;ISO-8859-1&quot; name=&quot;output&quot;/&gt;
&gt; &lt;!-- ========================================================== --&gt;
&gt; &lt;!-- Stylesheet: splitartikel --&gt;
&gt; &lt;!-- pro Beitrag eine Datei --&gt;
&gt; &lt;!-- 
&gt; ========================================================== 
&gt; --&gt; &lt;xsl:template match=&quot;artikel&quot;&gt;
&gt; 	&lt;xsl:variable name=&quot;filename&quot;&gt;
&gt; 		&lt;xsl:text&gt;../step12/MuR_&lt;/xsl:text&gt;
&gt; 		&lt;xsl:value-of
&gt; select=&quot;format-number(descendant::jahrgang[1], '0000')&quot;/&gt;
&gt; 		&lt;xsl:text&gt;_&lt;/xsl:text&gt;
&gt; 		&lt;xsl:choose&gt;
&gt; 			&lt;xsl:when
&gt; test=&quot;not(contains(descendant::ausgabe[1], '-'))&quot;&gt;
&gt; 				&lt;xsl:value-of
&gt; select=&quot;format-number(descendant::ausgabe[1], '00')&quot;/&gt;
&gt; 			&lt;/xsl:when&gt;
&gt; 			&lt;xsl:otherwise&gt;
&gt; 				&lt;xsl:value-of
&gt; select=&quot;descendant::ausgabe[1]&quot;/&gt;
&gt; 			&lt;/xsl:otherwise&gt;
&gt; 		&lt;/xsl:choose&gt; 
&gt; 		&lt;xsl:text&gt;_&lt;/xsl:text&gt;
&gt; 		&lt;xsl:value-of
&gt; select=&quot;format-number(descendant::seite-von[1], '000')&quot;/&gt;
&gt; 		&lt;xsl:if test=&quot;descendant::position&quot;&gt;
&gt; 			&lt;xsl:text&gt;_&lt;/xsl:text&gt;
&gt; 			&lt;xsl:value-of select=&quot;descendant::position[1]&quot;/&gt;
&gt; 		&lt;/xsl:if&gt;
&gt; 		&lt;xsl:text&gt;.xml&lt;/xsl:text&gt;
&gt; 	&lt;/xsl:variable&gt; 
&gt; 
&gt; 	&lt;xsl:result-document href=&quot;{$filename}&quot; format=&quot;output&quot;&gt;
&gt; 		&lt;xsl:copy-of select=&quot;.&quot;/&gt;
&gt; 	&lt;/xsl:result-document&gt;
&gt; &lt;/xsl:template&gt;
&gt; &lt;/xsl:stylesheet&gt;
&gt;  
&gt; 
&gt; Idea anyone ?!
&gt; 
&gt; regards
&gt; 
&gt; 
&gt; Patrick Szabo
&gt;  XSLT-Entwickler 
&gt; 
&gt; Tel.: +43 (1) 534 52 - 1573 
&gt; Fax: +43 (1) 534 52 - 146 
&gt; 
&gt; Patrick.Szabo@lexisnexis.at
&gt; 
&gt; LexisNexis Verlag ARD Orac GmbH &amp; Co KG
&gt; Marxergasse 25, 1030 Wien
&gt; FN 8333f, Handelsgericht Wien
&gt; http://www.lexisnexis.at/
&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/msg1000306601.html</link>
</item><item>
<title>RE: [xsl] Para element - 11/12/2009 10:07:00 AM</title>
<description><![CDATA[<pre>&gt; 
&gt; What exactly is a para element?

It's whatever you want it to be. Or rather, what the designer of the XML
vocabulary you are using wants it to be. For example, if your input is
DocBook, then para is what the DocBook definition says it is; if your input
is XHTML, then you need to turn to the XHTML definition. That's the whole
point about XML: anyone can define their own vocabulary, and the tags have
no meaning except in the context of a specific vocabulary.

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/msg1000306600.html</link>
</item><item>
<title>[xsl] multiple + empty output - 11/12/2009 9:29:00 AM</title>
<description><![CDATA[<pre>Hi, 
 
I'm using Saxon 9 and XSLT 2.0.
I want to split 1 input-file in several output-files.
The problem is that i get the multiple files plus 1 empty file.
 
Like this:
 
1_2006.xml --&gt; stylesheet --&gt; file1, file2, file3, 1_2006.xml
 
I don't want to create this empty 1_2006.xml :(
 
I've tried &lt;xsl:output method=&quot;saxon:net.sf.saxon.event.Sink&quot;/&gt; but it
doesn't seem to work.
 
The stylesheet:

&lt;xsl:stylesheet version=&quot;2.0&quot;
xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
xmlns:saxon=&quot;http://saxon.sf.net/&quot; exclude-result-prefixes=&quot;#all&quot;&gt;
&lt;xsl:strip-space elements=&quot;zs_absatz&quot;/&gt;
&lt;xsl:output method=&quot;saxon:net.sf.saxon.event.Sink&quot;/&gt;
&lt;xsl:output method=&quot;xml&quot; encoding=&quot;ISO-8859-1&quot; name=&quot;output&quot;/&gt;
&lt;!-- ========================================================== --&gt;
&lt;!-- Stylesheet: splitartikel --&gt;
&lt;!-- pro Beitrag eine Datei --&gt;
&lt;!-- ========================================================== --&gt;
&lt;xsl:template match=&quot;artikel&quot;&gt;
	&lt;xsl:variable name=&quot;filename&quot;&gt;
		&lt;xsl:text&gt;../step12/MuR_&lt;/xsl:text&gt;
		&lt;xsl:value-of
select=&quot;format-number(descendant::jahrgang[1], '0000')&quot;/&gt;
		&lt;xsl:text&gt;_&lt;/xsl:text&gt;
		&lt;xsl:choose&gt;
			&lt;xsl:when
test=&quot;not(contains(descendant::ausgabe[1], '-'))&quot;&gt;
				&lt;xsl:value-of
select=&quot;format-number(descendant::ausgabe[1], '00')&quot;/&gt;
			&lt;/xsl:when&gt;
			&lt;xsl:otherwise&gt;
				&lt;xsl:value-of
select=&quot;descendant::ausgabe[1]&quot;/&gt;
			&lt;/xsl:otherwise&gt;
		&lt;/xsl:choose&gt; 
		&lt;xsl:text&gt;_&lt;/xsl:text&gt;
		&lt;xsl:value-of
select=&quot;format-number(descendant::seite-von[1], '000')&quot;/&gt;
		&lt;xsl:if test=&quot;descendant::position&quot;&gt;
			&lt;xsl:text&gt;_&lt;/xsl:text&gt;
			&lt;xsl:value-of select=&quot;descendant::position[1]&quot;/&gt;
		&lt;/xsl:if&gt;
		&lt;xsl:text&gt;.xml&lt;/xsl:text&gt;
	&lt;/xsl:variable&gt; 

	&lt;xsl:result-document href=&quot;{$filename}&quot; format=&quot;output&quot;&gt;
		&lt;xsl:copy-of select=&quot;.&quot;/&gt;
	&lt;/xsl:result-document&gt; 
&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;
 

Idea anyone ?!

regards


Patrick Szabo
 XSLT-Entwickler 

Tel.: +43 (1) 534 52 - 1573 
Fax: +43 (1) 534 52 - 146 

Patrick.Szabo@lexisnexis.at

LexisNexis Verlag ARD Orac GmbH &amp; Co KG
Marxergasse 25, 1030 Wien
FN 8333f, Handelsgericht Wien
http://www.lexisnexis.at/
 




--~------------------------------------------------------------------
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/msg1000306597.html</link>
</item><item>
<title>RE: [xsl] Generate a list of declared namespaces - 11/12/2009 9:05:00 AM</title>
<description><![CDATA[<pre>This works, but is likely to be horribly inefficient: if you have 10,000
elements, and declare 10 namespaces on the outermost element, then the
document will contain 100,000 namespace nodes, and you are then doing
10,000,000,000 comparisons to eliminate the duplicates. (Moreover, you
aren't just accessing the nodes, you are creating them: because namespace
nodes represent information in a highly redundant way, it's likely that most
implementations will only create them when they are referenced.)

I would suggest using keys: but you can't, because there is no XSLT match
pattern that matches a namespace node. In 2.0, using xsl:for-each-group() or
distinct-values() to eliminate the duplicates is likely to work much better.

Something like:

&lt;xsl:function name=&quot;f:namespace-pair&quot;&gt;
  &lt;xsl:param name=&quot;e&quot; as=&quot;node()&quot;/&gt; &lt;!-- a namespace node --&gt;
  &lt;xsl:sequence select=&quot;concat($e/name(), '=', $e/string())&quot;/&gt;
&lt;/xsl:function&gt;

and then the result is

distinct-values(//*/namespace::*/f:namespace-pair(.))

A decent implementation will stream this so it never allocates the whole
list of namespace nodes in memory.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


&gt; &gt;
&gt; &gt;Use the namespace axis.  You have to search the entire 
&gt; document in case 
&gt; &gt;you have namespaces declared below the document element.
&gt; &gt;
&gt; &gt;I hope the example below helps.
&gt; &gt;
&gt; &gt;. . . . . . . Ken
&gt; 
&gt; I had second thoughts about my first answer, which was 
&gt; looking for uniqueness in the name of the prefix, when it 
&gt; should have been looking for uniqueness in the namespace URI.
&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/msg1000306596.html</link>
</item><item>
<title>RE: [xsl] Generate a list of declared namespaces - 11/12/2009 9:01:00 AM</title>
<description><![CDATA[<pre>For anyone interested, I came up with this solution:

&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;
&#160;&#160;&#160; &lt;xsl:template match=&quot;/&quot;&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsl:for-each select= &quot;//namespace::*&quot;&gt;&lt;xsl:value-of select=&quot;.&quot;/&gt;,&lt;/xsl:for-each&gt;
&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;
 		 	   		  
_________________________________________________________________
Keep your friends updated—even when you’re not signed in.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_5:092010
--~------------------------------------------------------------------
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/msg1000306595.html</link>
</item><item>
<title>Re: [xsl] Generate a list of declared namespaces - 11/12/2009 2:05:00 AM</title>
<description><![CDATA[<pre>At 2009-11-11 21:00 -0500, I wrote:
&gt;At 2009-11-12 00:42 +0000, Anders Viklund wrote:
&gt;&gt;I would like to generate a list of declared namespaces for an xml file.
&gt;&gt;
&gt;&gt;Any ideas how I can do this?
&gt;
&gt;Use the namespace axis.  You have to search the entire document in 
&gt;case you have namespaces declared below the document element.
&gt;
&gt;I hope the example below helps.
&gt;
&gt;. . . . . . . Ken

I had second thoughts about my first answer, which was looking for 
uniqueness in the name of the prefix, when it should have been 
looking for uniqueness in the namespace URI.

A revision is below that gives the same answer, but I'm now thinking 
you should be reporting the unique namespaces and not the unique 
prefixes.  If you need the unique declarations, you'll need to 
combine these two examples.

. . . . . . . . . . Ken

t:\ftemp&gt;xslt anders.xsl anders.xsl
xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
xmlns:anders=&quot;urn:X-Anders&quot;

t:\ftemp&gt;type anders.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:variable name=&quot;ns&quot; select=&quot;//namespace::*[name(.)!='xml']&quot;/&gt;

&lt;xsl:template match=&quot;/&quot; xmlns:anders=&quot;urn:X-Anders&quot;&gt;
   &lt;xsl:for-each select=&quot;$ns&quot;&gt;
     &lt;xsl:if test=&quot;generate-id(.)=
                   generate-id($ns[.=current()][1])&quot;&gt;
     &lt;xsl:value-of select=&quot;concat('xmlns:',name(.),'=&amp;#x22;',.,'&amp;#x22;')&quot;/&gt;
     &lt;xsl:text&gt;
&lt;/xsl:text&gt;
     &lt;/xsl:if&gt;
   &lt;/xsl:for-each&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;

t:\ftemp&gt;

--
Vote for your XML training:   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/msg1000306579.html</link>
</item><item>
<title>Re: [xsl] Generate a list of declared namespaces - 11/12/2009 2:01:00 AM</title>
<description><![CDATA[<pre>At 2009-11-12 00:42 +0000, Anders Viklund wrote:
&gt;I would like to generate a list of declared namespaces for an xml file.
&gt;
&gt;Any ideas how I can do this?

Use the namespace axis.  You have to search the entire document in 
case you have namespaces declared below the document element.

I hope the example below helps.

. . . . . . . Ken

t:\ftemp&gt;xslt anders.xsl anders.xsl
xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
xmlns:anders=&quot;urn:X-Anders&quot;

t:\ftemp&gt;type anders.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:variable name=&quot;ns&quot; select=&quot;//namespace::*[name(.)!='xml']&quot;/&gt;

&lt;xsl:template match=&quot;/&quot; xmlns:anders=&quot;urn:X-Anders&quot;&gt;
   &lt;xsl:for-each select=&quot;$ns&quot;&gt;
     &lt;xsl:if test=&quot;generate-id(.)=
                   generate-id($ns[name(.)=name(current())][1])&quot;&gt;
     &lt;xsl:value-of select=&quot;concat('xmlns:',name(.),'=&amp;#x22;',.,'&amp;#x22;')&quot;/&gt;
     &lt;xsl:text&gt;
&lt;/xsl:text&gt;
     &lt;/xsl:if&gt;
   &lt;/xsl:for-each&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;

t:\ftemp&gt;

--
Vote for your XML training:   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/msg1000306578.html</link>
</item><item>
<title>[xsl] Generate a list of declared namespaces - 11/12/2009 12:43:00 AM</title>
<description><![CDATA[<pre>Hi,

I would like to generate a list of declared namespaces for an xml file.

Any ideas how I can do this?

Thanks! 		 	   		  
_________________________________________________________________
Windows Live Hotmail: Your friends can get your Facebook updates, right from Hotmail&#174;.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_4:092009
--~------------------------------------------------------------------
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/msg1000306573.html</link>
</item><item>
<title>Re: [xsl] Consolidating three xml requests in xsl - 11/11/2009 9:10:00 PM</title>
<description><![CDATA[<pre>At 2009-11-11 12:22 -0800, Anonymous Anonymous wrote:
&gt;I'm consolidating three xml requests into one page
&gt;using the curl library. The curl php is working fine but I'm having trouble
&gt;with the xsl. How should I properly structure the code below so that it pulls
&gt;the xml from three sources?

Using the document() function.

&gt;Only the tourism photos section is
&gt;displaying right now. Note that the hotels and cars xml files have a 
&gt;similar structure.

You can take advantage of common code fragments after pulling the 
nodes from each file.

I hope the example below helps.

. . . . . . . . Ken

t:\ftemp&gt;type hotels.xml
&lt;catalog&gt;
  &lt;hotels&gt;
    &lt;hotel&gt;
      &lt;name&gt;Hotel Name&lt;/name&gt;
      &lt;description&gt;Hotel Description&lt;/description&gt;
    &lt;/hotel&gt;
  &lt;/hotels&gt;
&lt;/catalog&gt;

t:\ftemp&gt;type cars.xml
&lt;catalog&gt;
  &lt;cars&gt;
    &lt;car&gt;
      &lt;company_name&gt;Car Name&lt;/company_name&gt;
      &lt;description&gt;Car Description&lt;/description&gt;
    &lt;/car&gt;
  &lt;/cars&gt;
&lt;/catalog&gt;

t:\ftemp&gt;type photos.xml
&lt;!-- photos xsl --&gt;
&lt;rsp&gt;
  &lt;photos&gt;
    &lt;photo&gt;url&lt;/photo&gt;
  &lt;/photos&gt;
&lt;/rsp&gt;

t:\ftemp&gt;call xslt anon.xsl anon.xsl
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;tr&gt;
      Hotel Name
      Hotel Description
    &lt;/tr&gt;&lt;tr&gt;
      Car Name
      Car Description
    &lt;/tr&gt;&lt;tr&gt;&lt;img src=&quot;url&quot;/&gt;&lt;/tr&gt;
t:\ftemp&gt;type anon.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;!-- hotels --&gt;
   &lt;xsl:for-each
       select=&quot;document('hotels.xml')/catalog/hotels/hotel&quot;&gt;
     &lt;tr&gt;&lt;xsl:value-of
     select=&quot;.&quot;/&gt;&lt;/tr&gt;
   &lt;/xsl:for-each&gt;

   &lt;!-- cars --&gt;
   &lt;xsl:for-each
       select=&quot;document('cars.xml')/catalog/cars/car&quot;&gt;
     &lt;tr&gt;&lt;xsl:value-of
     select=&quot;.&quot;/&gt;&lt;/tr&gt;
   &lt;/xsl:for-each&gt;

   &lt;!-- photos --&gt;
   &lt;xsl:for-each
       select=&quot;document('photos.xml')/rsp/photos/photo&quot;&gt;
     &lt;tr&gt;&lt;img
     src=&quot;{.}&quot;/&gt;&lt;/tr&gt;
   &lt;/xsl:for-each&gt;

&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
t:\ftemp&gt;

--
Vote for your XML training:   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/msg1000306566.html</link>
</item><item>
<title>Re: [xsl] Axis specifier questions once again - 11/11/2009 9:02:00 PM</title>
<description><![CDATA[<pre>At 2009-11-11 13:26 -0600, a kusa wrote:
&gt;I have a nested list like this:
&gt;...
&gt;So in my transformation, the above snippet would transform as follows
&gt;with the exception of the last notes where I am having a problem:
&gt;...
&gt;Now, here is my problem. I want the &lt;note&gt; elements at the end of the
&gt;last &lt;listlevel&gt; element to come under the last step2 element.

Fine ... so you want to first process step2 without processing notes, 
and then you want to process the notes.  I think regarding your issue 
this way (if I've understood you correctly) is better than trying to 
conceive of axis addressing as you've tried.  I think you are missing 
the issue that the result tree is created in the order of the result 
tree, not in the order of the source tree.

I hope the example below helps.

. . . . . . . Ken

t:\ftemp&gt;type akusa.xml
&lt;list1&gt;
&lt;note&gt;&lt;para&gt;test&lt;/para&gt;&lt;/note&gt;
   &lt;listlevel&gt;
   sample1
  &lt;/listlevel&gt;

&lt;list2&gt;
   &lt;listlevel&gt;
   sample2
  &lt;/listlevel&gt;
&lt;list3&gt;

   &lt;listlevel&gt;
sample3
  &lt;/listlevel&gt;
&lt;/list3&gt;

   &lt;listlevel&gt;
   sample4
  &lt;/listlevel&gt;
&lt;list3&gt;

   &lt;listlevel&gt;
   sample5
  &lt;/listlevel&gt;
&lt;/list3&gt;
   &lt;listlevel&gt;
   sample6
  &lt;/listlevel&gt;
&lt;note&gt;&lt;para&gt;1 Note&lt;/para&gt;&lt;/note&gt;
&lt;note&gt;&lt;para&gt;2 Note&lt;/para&gt;&lt;/note&gt;
&lt;note&gt;&lt;para&gt;3 Note&lt;/para&gt;&lt;/note&gt;
&lt;/list2&gt;
&lt;/list1&gt;
t:\ftemp&gt;call xslt akusa.xml akusa.xsl
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;step1&gt;
&lt;note&gt;&lt;para&gt;test&lt;/para&gt;&lt;/note&gt;
   &lt;text&gt;
   sample1
  &lt;/text&gt;

&lt;step2&gt;
   &lt;text&gt;
   sample2
  &lt;/text&gt;
&lt;step3&gt;

   &lt;text&gt;
sample3
  &lt;/text&gt;
&lt;/step3&gt;

   &lt;text&gt;
   sample4
  &lt;/text&gt;
&lt;step3&gt;

   &lt;text&gt;
   sample5
  &lt;/text&gt;
&lt;/step3&gt;
   &lt;text&gt;
   sample6
  &lt;/text&gt;



&lt;/step2&gt;&lt;note&gt;&lt;para&gt;1 Note&lt;/para&gt;&lt;/note&gt;&lt;note&gt;&lt;para&gt;2 
Note&lt;/para&gt;&lt;/note&gt;&lt;note&gt;&lt;para&gt;3 Note&lt;/para&gt;&lt;/note&gt;
&lt;/step1&gt;
t:\ftemp&gt;type akusa.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;list1&quot;&gt;
   &lt;step1&gt;
     &lt;xsl:apply-templates/&gt;
   &lt;/step1&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match=&quot;list2&quot;&gt;
   &lt;!--first produce the output not considering notes--&gt;
   &lt;step2&gt;
     &lt;xsl:apply-templates select=&quot;node()[not(self::note)]&quot;/&gt;
   &lt;/step2&gt;
   &lt;!--then continue the output with the notes--&gt;
   &lt;xsl:apply-templates select=&quot;note&quot;/&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match=&quot;list3&quot;&gt;
   &lt;step3&gt;
     &lt;xsl:apply-templates/&gt;
   &lt;/step3&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match=&quot;listlevel&quot;&gt;
   &lt;text&gt;
     &lt;xsl:apply-templates/&gt;
   &lt;/text&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match=&quot;note&quot;&gt;
   &lt;xsl:copy-of select=&quot;.&quot;/&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
t:\ftemp&gt;rem Done!



--
Vote for your XML training:   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/msg1000306565.html</link>
</item><item>
<title>[xsl] Consolidating three xml requests in xsl - 11/11/2009 8:23:00 PM</title>
<description><![CDATA[<pre>I&#226;€™m consolidating three xml requests into one page
using the curl library. The curl php is working fine but I&#226;€™m having trouble
with the xsl. How should I properly structure the code below so that it pulls
the xml from three sources? Only the tourism photos section is
displaying right now. Note that the hotels and cars xml files have a similar structure.
 
XSL
&lt;!-- hotels --&gt;
&lt;xsl:for-each
select=&quot;catalog/hotels/hotel&quot;&gt;
  &lt;tr&gt;&lt;xsl:value-of
select=&quot;.&quot;/&gt;&lt;/tr&gt;
&lt;/xsl:for-each&gt;
 
&lt;!-- cars --&gt;
&lt;xsl:for-each
select=&quot;catalog/cars/car&quot;&gt;
  &lt;tr&gt;&lt;xsl:value-of
select=&quot;.&quot;/&gt;&lt;/tr&gt;
&lt;/xsl:for-each&gt;
 
&lt;!-- photos --&gt;
&lt;xsl:for-each
select=&quot;rsp/photos/photo&quot;&gt;
  &lt;tr&gt;&lt;img
src=&quot;{@url}&quot;/&gt;&lt;/tr&gt;
&lt;/xsl:for-each&gt;
 
- -
- - - - - - - - - - - - - - - - - - - - -
 
XML
&lt;!-- hotels xml --&gt;
&lt;catalog&gt;
  &lt;cars&gt;
    &lt;car&gt;
      &lt;company_name&gt;Name&lt;/company_name&gt;
      &lt;description&gt;Description&lt;/description&gt;
    &lt;/car&gt;
&lt;/catalog&gt;
 
&lt;!-- cars xsl --&gt;
&lt;catalog&gt;
  &lt;hotels&gt;
    &lt;hotel
      &lt;name&gt;Name&lt;/name&gt;
      &lt;description&gt;Description&lt;/description&gt;
    &lt;/hotel&gt;
&lt;/catalog&gt;
 
&lt;!-- photos xsl --&gt;
&lt;rsp&gt;
  &lt;photos&gt;
    &lt;photo&gt;url&lt;/photo&gt;
  &lt;/photos&gt;
&lt;/rsp&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/msg1000306562.html</link>
</item><item>
<title>[xsl] Axis specifier questions once again - 11/11/2009 7:26:00 PM</title>
<description><![CDATA[<pre>Hi:

I have a nested list like this:

&lt;list1&gt;
&lt;note&gt;&lt;para&gt;test&lt;/para&gt;&lt;/note&gt;
  &lt;listlevel&gt;
  sample1
 &lt;/listlevel&gt;

&lt;list2&gt;
  &lt;listlevel&gt;
  sample2
 &lt;/listlevel&gt;
&lt;list3&gt;

  &lt;listlevel&gt;
sample3
 &lt;/listlevel&gt;
&lt;/list3&gt;

  &lt;listlevel&gt;
  sample4
 &lt;/listlevel&gt;
&lt;list3&gt;

  &lt;listlevel&gt;
  sample5
 &lt;/listlevel&gt;
&lt;/list3&gt;
  &lt;listlevel&gt;
  sample6
 &lt;/listlevel&gt;
&lt;note&gt;&lt;para&gt;1 Note&lt;/para&gt;&lt;/note&gt;
&lt;note&gt;&lt;para&gt;2 Note&lt;/para&gt;&lt;/note&gt;
&lt;note&gt;&lt;para&gt;3 Note&lt;/para&gt;&lt;/note&gt;
&lt;/list2&gt;
&lt;/list1&gt;

Every listX/listlevel represents a stepX when transformed. StepX is
also a nested list.

So, &lt;list1&gt; would be transformed into &lt;step1&gt;&lt;text&gt;sample&lt;/text&gt;&lt;/step1&gt;
&lt;listlevel&gt;
sample
&lt;listlevel&gt;

So in my transformation, the above snippet would transform as follows
with the exception of the last notes where I am having a problem:

&lt;step1&gt;
&lt;note&gt;&lt;para&gt;test&lt;/para&gt;&lt;/note&gt;
  &lt;text&gt;
  sample1
&lt;/text&gt;
&lt;step2&gt;
    &lt;text&gt;
  sample2
  &lt;/text&gt;
&lt;step3&gt;

  &lt;text&gt;
sample3
 &lt;/text&gt;
&lt;/step3&gt;
&lt;/step2&gt;
&lt;step2&gt;
  &lt;text&gt;
  sample4
 &lt;/text&gt;
&lt;step3&gt;

  &lt;text&gt;
  sample5
 &lt;/text&gt;
&lt;/step3&gt;
&lt;/step2&gt;
&lt;step2&gt;
  &lt;text&gt;
  sample6
 &lt;/text&gt;

&lt;note&gt;&lt;para&gt;1 Note&lt;/para&gt;&lt;/note&gt;
&lt;note&gt;&lt;para&gt;2 Note&lt;/para&gt;&lt;/note&gt;
&lt;note&gt;&lt;para&gt;3 Note&lt;/para&gt;&lt;/note&gt;
&lt;/step2&gt;
&lt;/step1&gt;

Now, here is my problem. I want the &lt;note&gt; elements at the end of the
last &lt;listlevel&gt; element to come under the last step2 element.

If I use following-sibling::*[self::note], that obviously does not
work because those notes will be displayed even under &lt;step3&gt;.

I am having a hard time coming up with a specific rule for these
&lt;note&gt; elements right under the last listlevel so that theybe
displayed only under that listlevel.

Can anyone please help me here?

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/msg1000306558.html</link>
</item><item>
<title>Re: [xsl] Transform symbol to element - 11/11/2009 4:20:00 PM</title>
<description><![CDATA[<pre>Syd,

At 07:30 AM 11/11/2009, you wrote:
&gt;But, perhaps more importantly, keep in mind that Martin's sample code
&gt;drops the encoding of child elements.

Indeed, but not to drop them turns this into an overlap problem, 
since the new element will span across elements and text node 
fragments in the source. :-&gt;

&gt;  E.g.
&gt;        &quot;A Detailed Analysis of Allusions to Markup Technology
&gt;         in Homer's &lt;title&gt;Iliad&lt;/title&gt;&quot;
&gt;would become
&gt;        &lt;quote&gt;A detailed ... Homer's Iliad&lt;/quote&gt;
&gt;losing the &lt;title&gt; tags, I think.

Would that be:

   Just as the drudge marking meter with attribute syntax
   Counts lines left in the day's work, so godlike Achilles
   Gazed, all dismayed, on the hosts of the weary Achaians

...?

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/msg1000306544.html</link>
</item><item>
<title>Re: [xsl] Transform symbol to element - 11/11/2009 12:31:00 PM</title>
<description><![CDATA[<pre>I'm not sure that regular expression is exactly what Martin intended,
or if mail gateways have mucked it enough that I couldn't tell
anyway. In any case, if you never have quoted phrases nested inside
quoted phrases, it makes little or no difference whether you use left
or right quotation marks in the negated 2nd group. But if you might
have nestings of pairs of quotation marks you want to catch properly
(even if not completely), you probably need to have both in there.
I.e., using 'L' for left and 'R' for right:
    (L)([^LR]*)(R)

This works (or at least, does what I expect :-) in the single-match
case (i.e., matching either single or double). But when matches for
both single and double are combined using a pipe character, it fails
to handle the second case, I haven't figured out why. I.e.
    (L)([^LR]*)(R)|(l)([^lr]*)(r)
catches quotations surrounded by 'L' and 'R', but fails to catch the
case of quotations surrounded by 'l' and 'r'. (Using Saxon-HE
9.2.0.3J from Saxonica).


But, perhaps more importantly, keep in mind that Martin's sample code
drops the encoding of child elements. E.g.
       &quot;A Detailed Analysis of Allusions to Markup Technology 
        in Homer's &lt;title&gt;Iliad&lt;/title&gt;&quot;
would become
       &lt;quote&gt;A detailed ... Homer's Iliad&lt;/quote&gt;
losing the &lt;title&gt; tags, I think.


&gt; With XSLT 2.0 you can try it as follows:
&gt;    &lt;xsl:template match=&quot;p&quot;&gt;
&gt;      &lt;para&gt;
&gt;        &lt;xsl:analyze-string select=&quot;.&quot; regex=&quot;(“)([^“]*)(”)|(‘)([^‘]*)(’)&quot;&gt;
&gt;          &lt;xsl:matching-substring&gt;
&gt;            &lt;quote open=&quot;{regex-group(1)}&quot; close=&quot;{regex-group(3)}&quot;&gt;
&gt;              &lt;xsl:value-of select=&quot;regex-group(2)&quot;/&gt;
&gt;            &lt;/quote&gt;
&gt;          &lt;/xsl:matching-substring&gt;
&gt;          &lt;xsl:non-matching-substring&gt;
&gt;            &lt;xsl:value-of select=&quot;.&quot;/&gt;
&gt;          &lt;/xsl:non-matching-substring&gt;
&gt;        &lt;/xsl:analyze-string&gt;
&gt;      &lt;/para&gt;
&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/msg1000306526.html</link>
</item><item>
<title>Re: [xsl] Transform symbol to element - 11/11/2009 11:37:00 AM</title>
<description><![CDATA[<pre>Selvaganesh wrote:

&gt; This is possible to convert the quote symbol to xml elements?
&gt; 
&gt; If anybody know the way please share me, below placed my input file format
&gt; and required output format.
&gt;  
&gt; Input XML:
&gt; 
&gt; &lt;p&gt;This is the sample of double quote starting “the double publication”
&gt; ended&lt;/p&gt;
&gt; &lt;p&gt;This is the sample of single quote starting ‘the single publication’
&gt; ended&lt;/p&gt;
&gt; 
&gt; 
&gt; Output XML:
&gt; 
&gt; &lt;para&gt;This is the sample of double quote starting &lt;quote open=&quot;“&quot;
&gt; close=&quot;”&quot;&gt;the double publication&lt;/quote&gt; ended&lt;/para&gt;
&gt; &lt;para&gt;This is the sample of single quote starting &lt;quote open=&quot;‘&quot;
&gt; close=&quot;’&quot;&gt;the single publication&lt;/quote&gt; ended&lt;/para&gt;

With XSLT 2.0 you can try it as follows:


   &lt;xsl:template match=&quot;p&quot;&gt;
     &lt;para&gt;
       &lt;xsl:analyze-string select=&quot;.&quot; regex=&quot;(“)([^“]*)(”)|(‘)([^‘]*)(’)&quot;&gt;
         &lt;xsl:matching-substring&gt;
           &lt;quote open=&quot;{regex-group(1)}&quot; close=&quot;{regex-group(3)}&quot;&gt;
             &lt;xsl:value-of select=&quot;regex-group(2)&quot;/&gt;
           &lt;/quote&gt;
         &lt;/xsl:matching-substring&gt;
         &lt;xsl:non-matching-substring&gt;
           &lt;xsl:value-of select=&quot;.&quot;/&gt;
         &lt;/xsl:non-matching-substring&gt;
       &lt;/xsl:analyze-string&gt;
     &lt;/para&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/msg1000306523.html</link>
</item><item>
<title>[xsl] Transform symbol to element - 11/11/2009 5:30:00 AM</title>
<description><![CDATA[<pre>Dear Friends,

This is possible to convert the quote symbol to xml elements?

If anybody know the way please share me, below placed my input file format
and required output format.
&#160;
Input XML:

&lt;p&gt;This is the sample of double quote starting “the double publication”
ended&lt;/p&gt;
&lt;p&gt;This is the sample of single quote starting ‘the single publication’
ended&lt;/p&gt;


Output XML:

&lt;para&gt;This is the sample of double quote starting &lt;quote open=&quot;“&quot;
close=&quot;”&quot;&gt;the double publication&lt;/quote&gt; ended&lt;/para&gt;
&lt;para&gt;This is the sample of single quote starting &lt;quote open=&quot;‘&quot;
close=&quot;’&quot;&gt;the single publication&lt;/quote&gt; ended&lt;/para&gt;

Advance in thanks,
Selva.


Confidentiality Notice:  This transmittal is a confidential communication.  If you are not the intended recipient, you are hereby notified that you have received this transmittal in error and that any review, dissemination, distribution or copying of this transmittal is strictly prohibited.  If you have received this communication in error, please notify this office immediately by reply and immediately delete this message and all of its attachments, if any.


--~------------------------------------------------------------------
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/msg1000306506.html</link>
</item><item>
<title>Re: [xsl] fo basic link question - 11/11/2009 4:10:00 AM</title>
<description><![CDATA[<pre>At 2009-11-10 19:56 -0800, Mark Wilson wrote:
&gt;I think I just figured it out:
&gt;
&gt;&lt;fo:basic-link  color=&quot;blue&quot;&gt;
&gt;         &lt;xsl:attribute name=&quot;external-destination&quot;&gt;
&gt;          &lt;xsl:text&gt;uri(&amp;quot;&lt;/xsl:text&gt;
&gt;          &lt;xsl:value-of select=&quot;Heading/@file&quot;/&gt;
&gt;           &lt;xsl:text&gt;&amp;quot;)&lt;/xsl:text&gt;
&gt;            &lt;/xsl:attribute&gt;
&gt;            &lt;xsl:value-of select=&quot;Heading&quot;/&gt;
&gt;  &lt;/fo:basic-link&gt;

Yes, that is certainly suitable, but check out my earlier post 
showing how to do this with an attribute value template.

I see above you have included the quote, and that is good as I 
explained.  Note that since you are in #PCDATA in your stylesheet, 
you don't need to escape it, and the following would have worked just 
as well (and not needing you to change what you have):

  &lt;fo:basic-link  color=&quot;blue&quot;&gt;
   &lt;xsl:attribute name=&quot;external-destination&quot;&gt;
    &lt;xsl:text/&gt;uri(&quot;&lt;xsl:value-of select=&quot;Heading/@file&quot;/&gt;&quot;)&lt;xsl:text/&gt;
   &lt;/xsl:attribute&gt;
   &lt;xsl:value-of select=&quot;Heading&quot;/&gt;
  &lt;/fo:basic-link&gt;

&gt;I think this works because uri(&quot;...&quot;) is not actually a function.

It certainly isn't at XSLT time.  It is a syntactic convention at 
XSL-FO time ... I don't think anything is actually &quot;called&quot; 
though.  As you don't have it in a select= and you don't have it in 
an attribute value template &quot;{}&quot;, it is just text with parentheses in 
it from XSLT's perspective.

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/msg1000306496.html</link>
</item><item>
<title>Re: [xsl] fo basic link question - 11/11/2009 4:10:00 AM</title>
<description><![CDATA[<pre>At 2009-11-10 19:12 -0800, Mark Wilson wrote:
&gt;Every example for building a uri(&quot;...&quot;) I can find always fills the 
&gt;parentheses with a quoted string, like uri(&quot;s.pdf&quot;). I want to use 
&gt;the value of an attribute:
&gt;
&gt;&lt;fo:basic-link external-destination=&quot;url(Heading/@file)&quot; color=&quot;blue&quot;&gt;
&gt;
&gt;Can I do that? If so, how?

Using an attribute value template:

   &lt;fo:basic-link external-destination='url(&quot;{Heading/@file}&quot;)' color=&quot;blue&quot;&gt;

I tell my students it is safest to use double quotes inside the url() syntax:

    url(&quot;.....uri.....&quot;)

... because URI syntax in RFC2141 section 2.2 production &lt;other&gt; 
allows each of &quot;(&quot;, &quot;)&quot; and &quot;'&quot; in a URI, but it doesn't allow a 
double quote.  So imagine that you have used either of the other 
combinations the specification allows:

    url('......uri.....')
    url(.......uri......)

... and your users end up creating a URI that contains &quot;'&quot; or &quot;)&quot; 
(respectively).  You don't know the syntax they are using, you are 
just plugging it into the result using XSLT.  The resulting XSL-FO 
has a malformed specification because the URI string is prematurely terminated.

And don't forget about your attribute delimiters.  If you want to use 
double quotes as your attribute delimiter, you'll need to escape the 
double quote inside.  In my example above I've used single quotes for 
the attribute delimiters which allows me to use naked double quotes inside.

This happened to be part of today's lecture as I am teaching XSL-FO 
this week in Washington DC.

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/msg1000306497.html</link>
</item><item>
<title>Re: [xsl] fo basic link question - 11/11/2009 3:57:00 AM</title>
<description><![CDATA[<pre>I think I just figured it out:

&lt;fo:basic-link  color=&quot;blue&quot;&gt;
         &lt;xsl:attribute name=&quot;external-destination&quot;&gt;
          &lt;xsl:text&gt;uri(&amp;quot;&lt;/xsl:text&gt;
          &lt;xsl:value-of select=&quot;Heading/@file&quot;/&gt;
           &lt;xsl:text&gt;&amp;quot;)&lt;/xsl:text&gt;
            &lt;/xsl:attribute&gt;
            &lt;xsl:value-of select=&quot;Heading&quot;/&gt;
  &lt;/fo:basic-link&gt;
I think this works because uri(&quot;...&quot;) is not actually a function.
Mark

--------------------------------------------------
From: &quot;Mark Wilson&quot; &lt;mark@knihtisk.org&gt;
Sent: Tuesday, November 10, 2009 7:12 PM
To: &lt;xsl-list@lists.mulberrytech.com&gt;
Subject: [xsl] fo basic link question

&gt; Every example for building a uri(&quot;...&quot;) I can find always fills the 
&gt; parentheses with a quoted string, like uri(&quot;s.pdf&quot;). I want to use the 
&gt; value of an attribute:
&gt;
&gt; &lt;fo:basic-link external-destination=&quot;url(Heading/@file)&quot; color=&quot;blue&quot;&gt;
&gt;
&gt; Can I do that? If so, how?
&gt;
&gt; Thanks,
&gt; Mark
&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/200911/msg1000306495.html</link>
</item><item>
<title>Re: [xsl] fo:basic-link - 11/11/2009 3:30:00 AM</title>
<description><![CDATA[<pre>Ken,
(By the way, I am using your book &quot;Definitive XSL-FO&quot; as my XSL-FO source)

On the subject of linking to specific locations within an external PDF 
document, so far my findings are:

I read in the XEP literature that they have implemented such a thing. 
Because I am unsure that my use of XEP would qualify under their &quot;free&quot; 
license requirement, I have written to them. If I get an answer, I'll let 
you know.
Mark
--------------------------------------------------


&gt;&gt;The &quot;s.pdf#block1&quot; experiment did not work. I will take my question to an 
&gt;&gt;Adobe PDF list, assuming I can find one.
&gt;
&gt; I look forward to hearing of your progress in finding how to do this.
&gt;
&gt; . . . . . . . . . . . Ken
 



--~------------------------------------------------------------------
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/msg1000306494.html</link>
</item><item>
<title>[xsl] fo basic link question - 11/11/2009 3:12:00 AM</title>
<description><![CDATA[<pre>Every example for building a uri(&quot;...&quot;) I can find always fills the 
parentheses with a quoted string, like uri(&quot;s.pdf&quot;). I want to use the value 
of an attribute:

&lt;fo:basic-link external-destination=&quot;url(Heading/@file)&quot; color=&quot;blue&quot;&gt;

Can I do that? 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/200911/msg1000306493.html</link>
</item><item>
<title>RE: [xsl] Using 'validation' in xsl:result-document - 11/10/2009 11:33:00 PM</title>
<description><![CDATA[<pre>&gt; 
&gt; Thank you. So it is a correct understanding that it the 
&gt; result-document goes after the schema in &lt;xsl:import-schema 
&gt; schema-location=&quot;test.xsd&quot;/&gt; to validate the document?
&gt; 

No, the xsl:import-schema declaration can be anywhere in the stylesheet.
With very few exceptions, the order of components in a stylesheet makes no
difference.

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/msg1000306485.html</link>
</item><item>
<title>Re: [xsl] Using 'validation' in xsl:result-document - 11/10/2009 10:34:00 PM</title>
<description><![CDATA[<pre>Thank you. So it is a correct understanding that it the
result-document goes after the schema in
&lt;xsl:import-schema schema-location=&quot;test.xsd&quot;/&gt; to validate the document?


On Tue, Nov 10, 2009 at 4:13 PM, Michael Kay &lt;mike@saxonica.com&gt; wrote:
&gt;&gt;
&gt;&gt; Can anyone tell me what exactly the options (strict, lax, strip,
&gt;&gt; preserve) &#160;for attribute validation under element
&gt;&gt; &lt;xsl:result-document&gt; mean?
&gt;
&gt; The spec says *exactly* what they mean, but I expect you really want to know
&gt; in plain language what they mean.
&gt;
&gt; strict means the system must find an element declaration in a schema for the
&gt; named element at the root of your result document, and must validate the
&gt; result document against that declaration, throwing an error if it's found to
&gt; be invalid.
&gt;
&gt; lax means the system should try to find an element declaration matching the
&gt; root element name; if it finds one, it must perform validation against this
&gt; element and throw an error if it's invalid; if it doesn't find one, then it
&gt; doesn't perform validation (except that it keeps looking for schema
&gt; declarations that match elements further down the tree).
&gt;
&gt; preserve means output the result tree with type annotations as they are
&gt; (some branches of the tree might have been validated while they were being
&gt; constructed, other branches might be untyped).
&gt;
&gt; strip means remove all type annotations from the result tree.
&gt;
&gt;&gt;
&gt;&gt; When I use validation=strict, I get XTTE1550 error in XML Spy.
&gt;
&gt; That is most likely to mean that your result tree is invalid against the
&gt; schema. It could also mean that the schema is invalid, or that it does not
&gt; contain an element declaration for the outermost element of your result
&gt; document.
&gt;
&gt; To debug this, if the error messages aren't helpful, you might find it
&gt; useful to output the result document with validation=&quot;strip&quot;, and then
&gt; validate it against the schema &quot;by hand&quot;.
&gt;
&gt; Michael Kay
&gt; Saxonica
&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/200911/msg1000306482.html</link>
</item><item>
<title>RE: [xsl] Using 'validation' in xsl:result-document - 11/10/2009 10:14:00 PM</title>
<description><![CDATA[<pre>&gt; 
&gt; Can anyone tell me what exactly the options (strict, lax, strip,
&gt; preserve)  for attribute validation under element 
&gt; &lt;xsl:result-document&gt; mean?

The spec says *exactly* what they mean, but I expect you really want to know
in plain language what they mean.

strict means the system must find an element declaration in a schema for the
named element at the root of your result document, and must validate the
result document against that declaration, throwing an error if it's found to
be invalid.

lax means the system should try to find an element declaration matching the
root element name; if it finds one, it must perform validation against this
element and throw an error if it's invalid; if it doesn't find one, then it
doesn't perform validation (except that it keeps looking for schema
declarations that match elements further down the tree).

preserve means output the result tree with type annotations as they are
(some branches of the tree might have been validated while they were being
constructed, other branches might be untyped).

strip means remove all type annotations from the result tree.

&gt; 
&gt; When I use validation=strict, I get XTTE1550 error in XML Spy.

That is most likely to mean that your result tree is invalid against the
schema. It could also mean that the schema is invalid, or that it does not
contain an element declaration for the outermost element of your result
document.

To debug this, if the error messages aren't helpful, you might find it
useful to output the result document with validation=&quot;strip&quot;, and then
validate it against the schema &quot;by hand&quot;.

Michael Kay
Saxonica


--~------------------------------------------------------------------
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/msg1000306481.html</link>
</item><item>
<title>RE: [xsl] Best XSLT tutorial - 11/10/2009 10:00:00 PM</title>
<description><![CDATA[<pre>Selva wrote:

&gt;Hi Team,
&gt;
&gt;I just want to know which is the best online XSLT tutorial, please
guide me.
&gt;
&gt;Thanks,
&gt;Selva


I have found that http://www.learn-xslt-tutorial.com/ has a lot of good
tutorial information regarding XSLT and XSL-FO.


Mark J. Miller

--~------------------------------------------------------------------
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/msg1000306477.html</link>
</item><item>
<title>[xsl] Using 'validation' in xsl:result-document - 11/10/2009 9:58:00 PM</title>
<description><![CDATA[<pre>Hi

Can anyone tell me what exactly the options (strict, lax, strip,
preserve)  for attribute validation under element
&lt;xsl:result-document&gt; mean?

When I use validation=strict, I get XTTE1550 error in XML Spy.

My XSL snippet is as follows:

&lt;xsl:template match=&quot;/&quot;&gt;

&lt;xsl:for-each select=&quot;.&quot;&gt;
&lt;xsl:result-document method=&quot;xml&quot; href=&quot;{$in}.xml&quot; validation=&quot;s&quot;
doctype-public=&quot;card&quot; doctype-system=&quot;system&quot;&gt;
						&lt;xsl:apply-templates/&gt;
					&lt;/xsl:result-document&gt;

&lt;/xsl:for-each&gt;
&lt;/xsl:template&gt;

where I have a rule for variable $in.

What am I doing wrong here? Should I not be using validation=strict here?

I have also declared the schema to be used by inclusing this statement
at the beginning of the style sheet.

&lt;xsl:import-schema schema-location=&quot;test.xsd&quot;/&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/msg1000306476.html</link>
</item><item>
<title>RE: [xsl] Best XSLT tutorial - 11/10/2009 9:56:00 PM</title>
<description><![CDATA[<pre>Selva,

The W3schools overview of XSLT is not comprehensive,
but I've found their tutorials to be very helpful in the past.
This might be a good place to start:

http://www.w3schools.com/xsl/default.asp

Enjoy,
Abe



-----Original Message-----
From: Selvaganesh [mailto:selvaganesh_t@hovservices.in] 
Sent: Tuesday, November 10, 2009 1:04 AM
To: xsl-list@lists.mulberrytech.com
Subject: [xsl] Best XSLT tutorial

Hi Team,

I just want to know which is the best online XSLT tutorial, please guide
me.

Thanks,
Selva



Confidentiality Notice:  This transmittal is a confidential
communication.  If you are not the intended recipient, you are hereby
notified that you have received this transmittal in error and that any
review, dissemination, distribution or copying of this transmittal is
strictly prohibited.  If you have received this communication in error,
please notify this office immediately by reply and immediately delete
this message and all of its attachments, if any.


--~------------------------------------------------------------------
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/msg1000306475.html</link>
</item><item>
<title>Re: [xsl] Can an element have 2 namespaces? - 11/10/2009 8:04:00 AM</title>
<description><![CDATA[<pre>&gt; My question was, what is the namespace of this root element: is it
&gt;
&gt; http://www.w3.org/1999/02/22-rdf-syntax-ns# because the
&gt; root element has an rdf prefix

Yes, any elements with the &quot;rdf&quot; prefix are in that namespace.

&gt; or is it &#160;http://purl.org/rss/1.0/

Only elements without a prefix are in that namespace (the default namespace).




-- 
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/msg1000306433.html</link>
</item><item>
<title>Re: [xsl] Can an element have 2 namespaces? - 11/10/2009 7:33:00 AM</title>
<description><![CDATA[<pre>On Mon, Nov 9, 2009 at 11:47 PM, cert21 &lt;cert21@ptd.net&gt; wrote:
&gt; I am having trouble parsing this rss 1.0 feed
&gt; The reason is that it appears that there are 2 different namespaces declared
&gt; in the root document
&gt;
&gt; This is how the document starts:
&gt;
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&gt; &lt;rdf:RDF xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;
&gt; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot;
&gt; xmlns:sy=&quot;http://purl.org/rss/1.0/modules/syndication/&quot;
&gt; xmlns:admin=&quot;http://webns.net/mvcb/&quot; xmlns=&quot;http://purl.org/rss/1.0/&quot;&gt;
&gt;

This root element defines the namespace prefixes rdf, dc, sy, admin and a
default namespace (http://purl.org/rss/1.0). Starting with this
element and ending
with the corresponding closing tag and inherited by all child elements
(except (1)),
any element or attribute name prefixed with one of these prefixes is in the
corresponding namespace associated with the URI, and an element without a prefix
is in the default namespace, whereas attributes without a prefix are in the
namespace of the tag of the element they belong to.

(1) Prefixes may be redefined in an inner element.

&gt; The parser (in php, a DOMDocument class) reports the namespace to be
&gt;
&gt; http://www.w3.org/1999/02/22-rdf-syntax-ns#
&gt;
&gt; but why then they declared another namespace with
&gt; xmlns=&quot;http://purl.org/rss/1.0/&quot;
&gt;
&gt; Is it even a valid way to declare 2 namespaces together like this?
&gt;

Only prefixes are declared, and a namespace for tags with only a local part.

&gt; Anyway, which one is considered to be the correct one?
&gt;

I think all of these questions are answered by my explanation. The root
element of a document is frequently used for declaring prefixes for
all namespaces that may appear, and possibly, a default namespace.

-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/msg1000306428.html</link>
</item><item>
<title>[xsl] Best XSLT tutorial - 11/10/2009 6:00:00 AM</title>
<description><![CDATA[<pre>Hi Team,

I just want to know which is the best online XSLT tutorial, please guide me.

Thanks,
Selva



Confidentiality Notice:  This transmittal is a confidential communication.  If you are not the intended recipient, you are hereby notified that you have received this transmittal in error and that any review, dissemination, distribution or copying of this transmittal is strictly prohibited.  If you have received this communication in error, please notify this office immediately by reply and immediately delete this message and all of its attachments, if any.


--~------------------------------------------------------------------
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/msg1000306422.html</link>
</item><item>
<title>Re: [xsl] Can an element have 2 namespaces? - 11/10/2009 3:00:00 AM</title>
<description><![CDATA[<pre>cert21 wrote:
&gt; My question was, what is the namespace of this root element: is it
&gt; 
&gt; http://www.w3.org/1999/02/22-rdf-syntax-ns# because the
&gt; root element has an rdf prefix
&gt; 
&gt; or is it  http://purl.org/rss/1.0/

The element is not in a namespace, nor does it have a namespace.

The *name* of the element has two parts: a namespace and a local part.

The *name* of the element has the namespace part
&#226;€œhttp://www.w3.org/1999/02/22-rdf-syntax-ns#&#226;€ and the local part &#226;€œRDF.&#226;€

There are many namespace declarations in scope for this element.  Its
literal name, &#226;€œrdf:RDF,&#226;€ is interpreted with respect to the in-scope
declarations.

(I submit that this is arguably on-topic for this mailing list, as much
XSLT confusion arises from interpretation of namespaces. (-: )

~Chris
-- 
Chris Maden, text nerd  &lt;URL: http://crism.maden.org/ &gt;
&#226;€œThe State is that great fiction by which everyone tries to live at
 the expense of everyone else.&#226;€ &#226;€” Fr&#195;&#169;d&#195;&#169;ric Bastiat, &#226;€œL&#226;€™&#195;‰tat&#226;€
GnuPG Fingerprint: C6E4 E2A9 C9F8 71AC 9724 CAA3 19F8 6677 0077 C319

--~------------------------------------------------------------------
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/msg1000306414.html</link>
</item><item>
<title>Re: [xsl] document(@href)/id('content') - 11/10/2009 1:36:00 AM</title>
<description><![CDATA[<pre>oh I forgot to say in xpath 1 you can't use function calls to the right
of / so if you are using xpath1 you need to do it in two steps eg
&lt;xsl:for-each select=&quot;document(@href)&quot;&gt;
  &lt;xsl:apply-templates select=&quot;id('content')&quot;

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/msg1000306411.html</link>
</item><item>
<title>Re: [xsl] document(@href)/id('content') - 11/10/2009 1:32:00 AM</title>
<description><![CDATA[<pre>&lt;xsl:apply-templates select=&quot;document(@href)/id('content')&quot;/&gt;

use of id() depends on the parser reporting the dtd types, it's often
safer to use key. If you are using xslt2 you can use
select=&quot;key('id','content',document(@href))&quot;
where the key is defined by
xsl:key name=&quot;key&quot; match=&quot;*[@id]&quot; use=&quot;@id&quot;

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/msg1000306410.html</link>
</item><item>
<title>[xsl] document(@href)/id('content') - 11/10/2009 1:12:00 AM</title>
<description><![CDATA[<pre>I want to apply templates to the element with id &quot;content&quot; in a document
other than the main source document

So I tried variations on,

&lt;xsl:apply-templates select=&quot;document(@href)/id('content')&quot;/&gt;

Nothing has worked so far - how can I apply templates to the element
with id &quot;content&quot; in a document other than the main source document?

I read at, http://www.w3.org/TR/xpath#function-id

- that id() selects elements in the same document as the context node,
and in XSLT, the context node comes from the current node

But I also read that for each step in an XPath, each selected node is
used as a context node for the following step

So shouldn't the context node of the id() step in
&quot;document(@href)/id('content')&quot; be the result of the document() step?

--~------------------------------------------------------------------
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/msg1000306409.html</link>
</item><item>
<title>Re: [xsl] Can an element have 2 namespaces? - 11/9/2009 11:40:00 PM</title>
<description><![CDATA[<pre>Florent Georges wrote:
&gt;   This is a general XML question.  The RSS namespace URI is bound as the default namespace (with no prefix) and the RDF namespace URI is bound to the prefix 'rdf'.  Thus 'rdf:RDF' is an element with the local name 'RDF' in the RDF namespace (the URI bound to the prefix 'rdf'.)
&gt;
&gt;   I am not sure what exactly the question is.
&gt;
&gt;   Regards,
&gt;
&gt;   
My question was, what is the namespace of this root element: is it

http://www.w3.org/1999/02/22-rdf-syntax-ns# because the
root element has an rdf prefix

or is it  http://purl.org/rss/1.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/200911/msg1000306404.html</link>
</item><item>
<title>Re: [xsl] Can an element have 2 namespaces? - 11/9/2009 11:06:00 PM</title>
<description><![CDATA[<pre>cert21 wrote:

&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&gt; &lt;rdf:RDF xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;
&gt; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot;
&gt; xmlns:sy=&quot;http://purl.org/rss/1.0/modules/syndication/&quot;
&gt; xmlns:admin=&quot;http://webns.net/mvcb/&quot; xmlns=&quot;http://purl.org/rss/1.0/&quot;&gt;

&gt; [...]

&gt; Is it even a valid way to declare 2 namespaces together
&gt; like this?

  This is a general XML question.  The RSS namespace URI is bound as the default namespace (with no prefix) and the RDF namespace URI is bound to the prefix 'rdf'.  Thus 'rdf:RDF' is an element with the local name 'RDF' in the RDF namespace (the URI bound to the prefix 'rdf'.)

  I am not sure what exactly the question is.

  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/msg1000306403.html</link>
</item><item>
<title>RE: [xsl] Can an element have 2 namespaces? - 11/9/2009 11:04:00 PM</title>
<description><![CDATA[<pre>While I follow this list, it's been a while since I've posted. There are five namespaces declared if I read this correctly. The default namespace is http://purl.org/rss/1.0/. That is to say, unless an element or an attribute has an overriding namespace declared

ex: &lt;rdf:xxx&gt;&lt;/rdf&gt;

an element or attribute is assigned to the default namespace.

It looks like there's a problem with your parser, but I could be wrong as I am a little rusty.
-- 
Charles Knell
cknell@onebox.com - email



-----Original Message-----
From:     cert21 &lt;cert21@ptd.net&gt;
Sent:     Mon, 09 Nov 2009 17:47:49 -0500
To:       xsl-list@lists.mulberrytech.com
Subject:  [xsl] Can an element have 2 namespaces?

I am having trouble parsing this rss 1.0 feed
The reason is that it appears that there are 2 different namespaces 
declared in the root document

This is how the document starts:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;rdf:RDF xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:sy=&quot;http://purl.org/rss/1.0/modules/syndication/&quot; xmlns:admin=&quot;http://webns.net/mvcb/&quot; xmlns=&quot;http://purl.org/rss/1.0/&quot;&gt;

The parser (in php, a DOMDocument class) reports the namespace to be

http://www.w3.org/1999/02/22-rdf-syntax-ns#

but why then they declared another namespace with 
xmlns=&quot;http://purl.org/rss/1.0/&quot;

Is it even a valid way to declare 2 namespaces together like this?

Anyway, which one is considered to be the correct one?




--~------------------------------------------------------------------
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/msg1000306402.html</link>
</item><item>
<title>[xsl] Can an element have 2 namespaces? - 11/9/2009 10:48:00 PM</title>
<description><![CDATA[<pre>I am having trouble parsing this rss 1.0 feed
The reason is that it appears that there are 2 different namespaces 
declared in the root document

This is how the document starts:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;rdf:RDF xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:sy=&quot;http://purl.org/rss/1.0/modules/syndication/&quot; xmlns:admin=&quot;http://webns.net/mvcb/&quot; xmlns=&quot;http://purl.org/rss/1.0/&quot;&gt;

The parser (in php, a DOMDocument class) reports the namespace to be

http://www.w3.org/1999/02/22-rdf-syntax-ns#

but why then they declared another namespace with 
xmlns=&quot;http://purl.org/rss/1.0/&quot;

Is it even a valid way to declare 2 namespaces together like this?

Anyway, which one is considered to be the correct one?




--~------------------------------------------------------------------
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/msg1000306399.html</link>
</item><item>
<title>Re: [xsl] Re: removing a specific namespace declaration - 11/9/2009 5:22:00 PM</title>
<description><![CDATA[<pre>Hi,

At 04:02 PM 11/8/2009, Eliot wrote:
&gt;On 11/8/09 2:15 PM, &quot;G. Ken Holman&quot; &lt;gkholman@CraneSoftwrights.com&gt; wrote:
&gt; &gt; Fine ... but just remember an unused namespace is supposed to be
&gt; &gt; benign to XML-based applications.
&gt; &gt;
&gt; &gt;&gt; It's still a little unclear to me why this approach requires a
&gt; &gt;&gt; namespace declaration in the element
&gt; &gt;&gt; (namespace=&quot;{namespace-uri(.)}&quot;), as I would have thought the
&gt; &gt;&gt; explicit copying of namespace nodes would have taken care of it,
&gt;
&gt;Unexpected (and unneeded) namespace declarations can be a problem for
&gt;DTD-validated documents where not all elements provide the namespace
&gt;declaration attributes. Thus a namespace declaration emitted on an element
&gt;the DTD didn't provide for will result in an invalid document.

This, plus also softer reasons.

By design, XML passes through the hands of many people who haven't 
been schooled in its deeper mysteries, and who don't know what 
namespace declarations are and whether they should be alarmed by 
them, especially when they are littered throughout a document. 
Namespace discipline (including namespace cleanup and avoiding 
namespace clutter) can be very useful and helpful from a systems 
management perspective even if pointless and unnecessary from a 
processing perspective.

I think Ken's choice of the word &quot;benign&quot; here is interesting. Unused 
namespace declarations are benign the way warts are benign. Do they 
really matter? Probably not, unless they matter to you -- or unless 
it matters to you if they matter to someone else. :-)

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/msg1000306388.html</link>
</item><item>
<title>Re: [xsl] Filtering out a specific attribute - 11/9/2009 2:20:00 PM</title>
<description><![CDATA[<pre>Hi Vyacheslav,
Thank you for the improvement.
Mark

--------------------------------------------------
From: &quot;Vyacheslav Sedov&quot; &lt;vyacheslav.sedov@gmail.com&gt;
Sent: Monday, November 09, 2009 6:03 AM
To: &lt;xsl-list@lists.mulberrytech.com&gt;
Subject: Re: [xsl] Filtering out a specific attribute

&gt; &quot;Heading/(@* except @id)&quot; much better ;)
&gt;
&gt;
&gt; 2009/11/9 Martin Honnen &lt;Martin.Honnen@gmx.de&gt;:
&gt;&gt; Mark Wilson wrote:
&gt;&gt;
&gt;&gt;&gt; I know that &lt;xsl:copy-of select=&quot;Heading/@*&quot;/&gt; copies all of the
&gt;&gt;&gt; attributes. How do I copy all the attributes except a specific one, say: 
&gt;&gt;&gt; @id
&gt;&gt;&gt; ?
&gt;&gt;
&gt;&gt; With XSLT 2.0 you can literally write that
&gt;&gt; &lt;xsl:copy-of select=&quot;Heading/@* except Heading/@id&quot;/&gt;
&gt;&gt;
&gt;&gt; --
&gt;&gt;
&gt;&gt; Martin Honnen
&gt;&gt; http://msmvps.com/blogs/martin_honnen/
&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; 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/200911/msg1000306381.html</link>
</item><item>
<title>Re: [xsl] Filtering out a specific attribute - 11/9/2009 2:07:00 PM</title>
<description><![CDATA[<pre>Neat! I'm using XSLT 2.0.
Thanks Martin.
Mark

--------------------------------------------------
From: &quot;Martin Honnen&quot; &lt;Martin.Honnen@gmx.de&gt;
Sent: Monday, November 09, 2009 5:53 AM
To: &lt;xsl-list@lists.mulberrytech.com&gt;
Subject: Re: [xsl] Filtering out a specific attribute

&gt; Mark Wilson wrote:
&gt;
&gt;&gt; I know that &lt;xsl:copy-of select=&quot;Heading/@*&quot;/&gt; copies all of the 
&gt;&gt; attributes. How do I copy all the attributes except a specific one, say: 
&gt;&gt; @id ?
&gt;
&gt; With XSLT 2.0 you can literally write that
&gt;   &lt;xsl:copy-of select=&quot;Heading/@* except Heading/@id&quot;/&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/200911/msg1000306380.html</link>
</item><item>
<title>Re: [xsl] Filtering out a specific attribute - 11/9/2009 2:04:00 PM</title>
<description><![CDATA[<pre>&quot;Heading/(@* except @id)&quot; much better ;)


2009/11/9 Martin Honnen &lt;Martin.Honnen@gmx.de&gt;:
&gt; Mark Wilson wrote:
&gt;
&gt;&gt; I know that &lt;xsl:copy-of select=&quot;Heading/@*&quot;/&gt; copies all of the
&gt;&gt; attributes. How do I copy all the attributes except a specific one, say: @id
&gt;&gt; ?
&gt;
&gt; With XSLT 2.0 you can literally write that
&gt; &#194;&#160;&lt;xsl:copy-of select=&quot;Heading/@* except Heading/@id&quot;/&gt;
&gt;
&gt; --
&gt;
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160;Martin Honnen
&gt; &#194;&#160; &#194;&#160; &#194;&#160; &#194;&#160;http://msmvps.com/blogs/martin_honnen/
&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/msg1000306379.html</link>
</item><item>
<title>Re: [xsl] Filtering out a specific attribute - 11/9/2009 1:54:00 PM</title>
<description><![CDATA[<pre>Mark Wilson wrote:

&gt; I know that &lt;xsl:copy-of select=&quot;Heading/@*&quot;/&gt; copies all of the 
&gt; attributes. How do I copy all the attributes except a specific one, say: 
&gt; @id ?

With XSLT 2.0 you can literally write that
   &lt;xsl:copy-of select=&quot;Heading/@* except Heading/@id&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/msg1000306375.html</link>
</item><item>
<title>[xsl] Filtering out a specific attribute - 11/9/2009 1:52:00 PM</title>
<description><![CDATA[<pre>Hi,
I know that &lt;xsl:copy-of select=&quot;Heading/@*&quot;/&gt; copies all of the attributes. 
How do I copy all the attributes except a specific one, say: @id ?
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/msg1000306374.html</link>
</item><item>
<title>RE: [xsl] transforming xml data in cdata - 11/9/2009 9:25:00 AM</title>
<description><![CDATA[<pre>Generally I advise against designing your XML this way: the purpose of CDATA
is to say &quot;the stuff in here is not to be treated as markup&quot;, and if you
then want to treat it as markup after all, you've burnt your boats.

However, since so many people dig themselves into this hole, Saxon has an
extension saxon:parse() designed to get you out of it: you can take the
contents of the SkuDetails element and pass it to the XML parser, getting
back a tree of nodes which will essentially be the same as if you had left
out the CDATA start and end tags in the first place.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay  

&gt; -----Original Message-----
&gt; From: road speeder [mailto:roadspeed2002@yahoo.com] 
&gt; Sent: 09 November 2009 02:59
&gt; To: xsl-list@lists.mulberrytech.com
&gt; Subject: [xsl] transforming xml data in cdata
&gt; 
&gt; Hi, I have the following xml data:
&gt; &lt;Sale&gt;&lt;Site&gt;101&lt;/Site&gt;
&gt; &lt;Details&gt;&lt;![CDATA[ &lt;?xml 
&gt; version=&quot;1.0&quot;?&gt;&lt;items&gt;&lt;item&gt;desk&lt;/item&gt;&lt;cost&gt;10&lt;/cost&gt;&lt;/items&gt;
&gt;  ]]&gt; &lt;/Details&gt; &lt;/Sale&gt;
&gt;  
&gt;  I have an xslt &quot;my.xslt&quot; that tranforms the elements above 
&gt; except cdata part to result.xml. e.g 
&gt; &lt;SalesItem&gt;&lt;Location&gt;101&lt;/Location&gt;&lt;/SalesItem&gt;
&gt;  However, I also have &quot;another.xslt&quot; that can transform the 
&gt; xml part within the cdata section.
&gt;  I would like to import &quot;another.xslt&quot; into my.xslt and be 
&gt; able to transform the xml document within cdata as well.
&gt;  With the result looking similar to the following:
&gt;  &lt;SalesItem&gt;&lt;Location&gt;101&lt;/Location&gt;&lt;SkuDetails&gt;
&gt;  &lt;![CDATA&lt;?xml 
&gt; version=&quot;1.0&quot;?&gt;&lt;skus&gt;&lt;sku&gt;desk&lt;/sku&gt;&lt;amount&gt;10&lt;/amount&gt;&lt;/skus&gt;]]&gt;
&gt; &lt;/SkuDetails&gt;&lt;/SalesItem&gt;
&gt; 
&gt; Any ideas would be appreciated if this can be accomplished.
&gt; Thanks
&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/msg1000306356.html</link>
</item><item>
<title>Re: [xsl] transforming xml data in cdata - 11/9/2009 8:44:00 AM</title>
<description><![CDATA[<pre>What happens (as is likely) when there is more than one &lt;SkuDetails&gt;
element in the original XML? I guess they'll all be written to the
same temp.xml and finally be all inserted (in translated form) in all
&lt;SkuDetails&gt; elements. Although I guess a unique filename could be
generated for each &lt;SkuDetails&gt;, this will make the translation step
more complicated, but easily solvable on UNIX (I've absolutely
forgotten the bat-ty commands).

Since a most experienced contributor on this list has suggested using
Perl or sed for a similar problem, I'll do so for this problem, too.

Below is the set of sed commands that would achieve the renaming, and
the sed command to do the transformation

$ cat sale.sed
\|\(&lt;/\{0,1\}\)item&gt;|  s//\1sku&gt;/g
\|\(&lt;/\{0,1\}\)items&gt;| s//\1skus&gt;/g
\|\(&lt;/\{0,1\}\)cost&gt;|  s//\1amount&gt;/g
\|\(&lt;/\{0,1\}\)Sale&gt;|  s//\1SalesItem&gt;/g
\|\(&lt;/\{0,1\}\)Site&gt;|  s//\1Location&gt;/g

$  sed -f sale.sed sale.xml &gt;sale1.xml

If you are on Windows, you could install Perl (from Activestate),
which will give you psed, a highly compatible Perl implementation of
sed.

-W

On Mon, Nov 9, 2009 at 4:24 AM, G. Ken Holman
&lt;gkholman@cranesoftwrights.com&gt; wrote:
&gt;
&gt; At 2009-11-08 18:58 -0800, road speeder wrote:
&gt;&gt;
&gt;&gt; Hi, I have the following xml data:
&gt;&gt; &lt;Sale&gt;&lt;Site&gt;101&lt;/Site&gt;
&gt;&gt; &lt;Details&gt;&lt;![CDATA[ &lt;?xml version=&quot;1.0&quot;?&gt;&lt;items&gt;&lt;item&gt;desk&lt;/item&gt;&lt;cost&gt;10&lt;/cost&gt;&lt;/items&gt; ]]&gt;
&gt;&gt; &lt;/Details&gt;
&gt;&gt; &lt;/Sale&gt;
&gt;&gt;
&gt;&gt; &#160;I have an xslt &quot;my.xslt&quot; that tranforms the elements above except cdata part to result.xml. e.g &lt;SalesItem&gt;&lt;Location&gt;101&lt;/Location&gt;&lt;/SalesItem&gt;
&gt;&gt; &#160;However, I also have &quot;another.xslt&quot; that can transform the xml part within the cdata section.
&gt;&gt; &#160;I would like to import &quot;another.xslt&quot; into my.xslt and be able to transform the xml document within cdata as well.
&gt;&gt; &#160;With the result looking similar to the following:
&gt;&gt; &#160;&lt;SalesItem&gt;&lt;Location&gt;101&lt;/Location&gt;&lt;SkuDetails&gt;
&gt;&gt; &#160;&lt;![CDATA&lt;?xml version=&quot;1.0&quot;?&gt;&lt;skus&gt;&lt;sku&gt;desk&lt;/sku&gt;&lt;amount&gt;10&lt;/amount&gt;&lt;/skus&gt;]]&gt;
&gt;&gt; &lt;/SkuDetails&gt;&lt;/SalesItem&gt;
&gt;&gt;
&gt;&gt; Any ideas would be appreciated if this can be accomplished.
&gt;
&gt; Without using any proprietary extensions, I suggest you write out the &lt;Details&gt; element to a text file, transform it as an XML file, and then in a second pass on the first file pull in the transformed result again as a text file.
&gt;
&gt; Using standard XSLT you cannot parse character data using template rules.
&gt;
&gt; I hope this helps. &#160;The example stylesheets below produce the output you cite above without using any extensions, though I have no idea if it would meet any other requirements you aren't stating as I'm only using the one file for testing.
&gt;
&gt; . . . . . . . . . . . . Ken
&gt;
&gt;
&gt; T:\ftemp&gt;type speeder.xml
&gt; &lt;Sale&gt;&lt;Site&gt;101&lt;/Site&gt;
&gt; &lt;Details&gt;&lt;![CDATA[&lt;?xml version=&quot;1.0&quot;?&gt;&lt;items&gt;&lt;item&gt;desk&lt;/item&gt;&lt;cost&gt;10&lt;/cost&gt;&lt;/items&gt; ]]&gt;
&gt; &lt;/Details&gt;
&gt; &lt;/Sale&gt;
&gt;
&gt; T:\ftemp&gt;call xslt2 speeder.xml speeder1.xsl temp.xml
&gt;
&gt; T:\ftemp&gt;type temp.xml
&gt; &lt;?xml version=&quot;1.0&quot;?&gt;&lt;items&gt;&lt;item&gt;desk&lt;/item&gt;&lt;cost&gt;10&lt;/cost&gt;&lt;/items&gt;
&gt;
&gt; T:\ftemp&gt;call xslt2 temp.xml speeder2.xsl temp2.xml
&gt;
&gt; T:\ftemp&gt;type temp2.xml
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;skus&gt;&lt;sku&gt;desk&lt;/sku&gt;&lt;amount&gt;10&lt;/amount&gt;&lt;/skus&gt;
&gt; T:\ftemp&gt;call xslt2 speeder.xml speeder3.xsl speeder.out.xml &quot;detailsfile=temp2.xml&quot;
&gt;
&gt; T:\ftemp&gt;type speeder.out.xml
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;SalesItem&gt;&lt;Location&gt;101&lt;/Location&gt;
&gt; &lt;SkuDetails&gt;&lt;![CDATA[&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;skus&gt;&lt;sku&gt;desk&lt;/sku&gt;&lt;amount&gt;10&lt;/amount&gt;&lt;/skus&gt;]]&gt;&lt;/SkuDetails&gt;
&gt; &lt;/SalesItem&gt;
&gt; T:\ftemp&gt;type speeder1.xsl
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;US-ASCII&quot;?&gt;
&gt; &lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;version=&quot;2.0&quot;&gt;
&gt;
&gt; &lt;xsl:output method=&quot;text&quot;/&gt;
&gt;
&gt; &lt;xsl:template match=&quot;/&quot;&gt;
&gt; &#160;&lt;xsl:value-of select=&quot;Sale/Details&quot;/&gt;
&gt; &lt;/xsl:template&gt;
&gt;
&gt; &lt;/xsl:stylesheet&gt;
&gt; T:\ftemp&gt;type speeder2.xsl
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;US-ASCII&quot;?&gt;
&gt; &lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;version=&quot;2.0&quot;&gt;
&gt;
&gt; &lt;xsl:template match=&quot;items&quot;&gt;
&gt; &#160;&lt;skus&gt;
&gt; &#160; &#160;&lt;xsl:apply-templates/&gt;
&gt; &#160;&lt;/skus&gt;
&gt; &lt;/xsl:template&gt;
&gt;
&gt; &lt;xsl:template match=&quot;item&quot;&gt;
&gt; &#160;&lt;sku&gt;
&gt; &#160; &#160;&lt;xsl:apply-templates/&gt;
&gt; &#160;&lt;/sku&gt;
&gt; &lt;/xsl:template&gt;
&gt;
&gt; &lt;xsl:template match=&quot;cost&quot;&gt;
&gt; &#160;&lt;amount&gt;
&gt; &#160; &#160;&lt;xsl:apply-templates/&gt;
&gt; &#160;&lt;/amount&gt;
&gt; &lt;/xsl:template&gt;
&gt;
&gt; &lt;/xsl:stylesheet&gt;
&gt;
&gt; T:\ftemp&gt;type speeder3.xsl
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;US-ASCII&quot;?&gt;
&gt; &lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;version=&quot;2.0&quot;&gt;
&gt;
&gt; &lt;xsl:param name=&quot;detailsfile&quot;/&gt;
&gt;
&gt; &lt;xsl:output cdata-section-elements=&quot;SkuDetails&quot;/&gt;
&gt;
&gt; &lt;xsl:template match=&quot;Sale&quot;&gt;
&gt; &#160;&lt;SalesItem&gt;
&gt; &#160; &#160;&lt;xsl:apply-templates/&gt;
&gt; &#160;&lt;/SalesItem&gt;
&gt; &lt;/xsl:template&gt;
&gt;
&gt; &lt;xsl:template match=&quot;Site&quot;&gt;
&gt; &#160;&lt;Location&gt;
&gt; &#160; &#160;&lt;xsl:apply-templates/&gt;
&gt; &#160;&lt;/Location&gt;
&gt; &lt;/xsl:template&gt;
&gt;
&gt; &lt;xsl:template match=&quot;Details&quot;&gt;
&gt; &#160;&lt;SkuDetails&gt;
&gt; &#160; &#160;&lt;xsl:value-of select=&quot;unparsed-text($detailsfile)&quot;/&gt;
&gt; &#160;&lt;/SkuDetails&gt;
&gt; &lt;/xsl:template&gt;
&gt;
&gt; &lt;/xsl:stylesheet&gt;
&gt;
&gt; T:\ftemp&gt;rem Done!
&gt;
&gt;
&gt; --
&gt; Upcoming: &#160;hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
&gt; Interested in other classes? &#160;http://www.CraneSoftwrights.com/s/i/
&gt; Crane Softwrights Ltd. &#160; &#160; &#160; &#160; &#160;http://www.CraneSoftwrights.com/s/
&gt; Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
&gt; Video lesson: &#160; &#160;http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18
&gt; Video overview: &#160;http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18
&gt; G. Ken Holman &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; mailto:gkholman@CraneSoftwrights.com
&gt; Male Cancer Awareness Nov'07 &#160;http://www.CraneSoftwrights.com/s/bc
&gt; Legal business disclaimers: &#160;http://www.CraneSoftwrights.com/legal
&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/200911/msg1000306352.html</link>
</item><item>
<title>Re: [xsl] transforming xml data in cdata - 11/9/2009 3:26:00 AM</title>
<description><![CDATA[<pre>At 2009-11-08 18:58 -0800, road speeder wrote:
&gt;Hi, I have the following xml data:
&gt;&lt;Sale&gt;&lt;Site&gt;101&lt;/Site&gt;
&gt;&lt;Details&gt;&lt;![CDATA[ &lt;?xml 
&gt;version=&quot;1.0&quot;?&gt;&lt;items&gt;&lt;item&gt;desk&lt;/item&gt;&lt;cost&gt;10&lt;/cost&gt;&lt;/items&gt; ]]&gt;
&gt;&lt;/Details&gt;
&gt;&lt;/Sale&gt;
&gt;
&gt;  I have an xslt &quot;my.xslt&quot; that tranforms the elements above except 
&gt; cdata part to result.xml. e.g &lt;SalesItem&gt;&lt;Location&gt;101&lt;/Location&gt;&lt;/SalesItem&gt;
&gt;  However, I also have &quot;another.xslt&quot; that can transform the xml 
&gt; part within the cdata section.
&gt;  I would like to import &quot;another.xslt&quot; into my.xslt and be able to 
&gt; transform the xml document within cdata as well.
&gt;  With the result looking similar to the following:
&gt;  &lt;SalesItem&gt;&lt;Location&gt;101&lt;/Location&gt;&lt;SkuDetails&gt;
&gt;  &lt;![CDATA&lt;?xml 
&gt; version=&quot;1.0&quot;?&gt;&lt;skus&gt;&lt;sku&gt;desk&lt;/sku&gt;&lt;amount&gt;10&lt;/amount&gt;&lt;/skus&gt;]]&gt;
&gt;&lt;/SkuDetails&gt;&lt;/SalesItem&gt;
&gt;
&gt;Any ideas would be appreciated if this can be accomplished.

Without using any proprietary extensions, I suggest you write out the 
&lt;Details&gt; element to a text file, transform it as an XML file, and 
then in a second pass on the first file pull in the transformed 
result again as a text file.

Using standard XSLT you cannot parse character data using template rules.

I hope this helps.  The example stylesheets below produce the output 
you cite above without using any extensions, though I have no idea if 
it would meet any other requirements you aren't stating as I'm only 
using the one file for testing.

. . . . . . . . . . . . Ken


T:\ftemp&gt;type speeder.xml
&lt;Sale&gt;&lt;Site&gt;101&lt;/Site&gt;
&lt;Details&gt;&lt;![CDATA[&lt;?xml 
version=&quot;1.0&quot;?&gt;&lt;items&gt;&lt;item&gt;desk&lt;/item&gt;&lt;cost&gt;10&lt;/cost&gt;&lt;/items&gt; ]]&gt;
&lt;/Details&gt;
&lt;/Sale&gt;

T:\ftemp&gt;call xslt2 speeder.xml speeder1.xsl temp.xml

T:\ftemp&gt;type temp.xml
&lt;?xml version=&quot;1.0&quot;?&gt;&lt;items&gt;&lt;item&gt;desk&lt;/item&gt;&lt;cost&gt;10&lt;/cost&gt;&lt;/items&gt;

T:\ftemp&gt;call xslt2 temp.xml speeder2.xsl temp2.xml

T:\ftemp&gt;type temp2.xml
&lt;?xml version=&quot;1.0&quot; 
encoding=&quot;UTF-8&quot;?&gt;&lt;skus&gt;&lt;sku&gt;desk&lt;/sku&gt;&lt;amount&gt;10&lt;/amount&gt;&lt;/skus&gt;
T:\ftemp&gt;call xslt2 speeder.xml speeder3.xsl speeder.out.xml 
&quot;detailsfile=temp2.xml&quot;

T:\ftemp&gt;type speeder.out.xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;SalesItem&gt;&lt;Location&gt;101&lt;/Location&gt;
&lt;SkuDetails&gt;&lt;![CDATA[&lt;?xml version=&quot;1.0&quot; 
encoding=&quot;UTF-8&quot;?&gt;&lt;skus&gt;&lt;sku&gt;desk&lt;/sku&gt;&lt;amount&gt;10&lt;/amount&gt;&lt;/skus&gt;]]&gt;&lt;/SkuDetails&gt;
&lt;/SalesItem&gt;
T:\ftemp&gt;type speeder1.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 method=&quot;text&quot;/&gt;

&lt;xsl:template match=&quot;/&quot;&gt;
   &lt;xsl:value-of select=&quot;Sale/Details&quot;/&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
T:\ftemp&gt;type speeder2.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:template match=&quot;items&quot;&gt;
   &lt;skus&gt;
     &lt;xsl:apply-templates/&gt;
   &lt;/skus&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match=&quot;item&quot;&gt;
   &lt;sku&gt;
     &lt;xsl:apply-templates/&gt;
   &lt;/sku&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match=&quot;cost&quot;&gt;
   &lt;amount&gt;
     &lt;xsl:apply-templates/&gt;
   &lt;/amount&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;

T:\ftemp&gt;type speeder3.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:param name=&quot;detailsfile&quot;/&gt;

&lt;xsl:output cdata-section-elements=&quot;SkuDetails&quot;/&gt;

&lt;xsl:template match=&quot;Sale&quot;&gt;
   &lt;SalesItem&gt;
     &lt;xsl:apply-templates/&gt;
   &lt;/SalesItem&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match=&quot;Site&quot;&gt;
   &lt;Location&gt;
     &lt;xsl:apply-templates/&gt;
   &lt;/Location&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match=&quot;Details&quot;&gt;
   &lt;SkuDetails&gt;
     &lt;xsl:value-of select=&quot;unparsed-text($detailsfile)&quot;/&gt;
   &lt;/SkuDetails&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;

T:\ftemp&gt;rem Done!


--
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/msg1000306339.html</link>
</item><item>
<title>[xsl] transforming xml data in cdata - 11/9/2009 2:59:00 AM</title>
<description><![CDATA[<pre>Hi, I have the following xml data:
&lt;Sale&gt;&lt;Site&gt;101&lt;/Site&gt;
&lt;Details&gt;&lt;![CDATA[ &lt;?xml version=&quot;1.0&quot;?&gt;&lt;items&gt;&lt;item&gt;desk&lt;/item&gt;&lt;cost&gt;10&lt;/cost&gt;&lt;/items&gt; ]]&gt;
&lt;/Details&gt;
&lt;/Sale&gt;
 
 I have an xslt &quot;my.xslt&quot; that tranforms the elements above except cdata part to result.xml. e.g &lt;SalesItem&gt;&lt;Location&gt;101&lt;/Location&gt;&lt;/SalesItem&gt;
 However, I also have &quot;another.xslt&quot; that can transform the xml part within the cdata section.
 I would like to import &quot;another.xslt&quot; into my.xslt and be able to transform the xml document within cdata as well.
 With the result looking similar to the following:
 &lt;SalesItem&gt;&lt;Location&gt;101&lt;/Location&gt;&lt;SkuDetails&gt;
 &lt;![CDATA&lt;?xml version=&quot;1.0&quot;?&gt;&lt;skus&gt;&lt;sku&gt;desk&lt;/sku&gt;&lt;amount&gt;10&lt;/amount&gt;&lt;/skus&gt;]]&gt;
&lt;/SkuDetails&gt;&lt;/SalesItem&gt;

Any ideas would be appreciated if this can be accomplished.
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/msg1000306335.html</link>
</item><item>
<title>Re: [xsl] Obtaining a specific context position() - 11/8/2009 10:59:00 PM</title>
<description><![CDATA[<pre>Hi David,
That worked just fine.
 I misunderstood the nature of XSLT variables and was under the impression 
that once initialized their value could not be changed. Clearly, I need to 
re-read that section of the book.

I am actually generating a series of id's and need the value of the id to be 
constant across files. My reading of gererate-id() was that the id could 
change each time the file was processed. and that it was not recommended for 
use in hyperlinks between different HTML files. (Michael's book on XSLT and 
XPath).

Thanks,
Mark

--------------------------------------------------
From: &quot;David Carlisle&quot; &lt;davidc@nag.co.uk&gt;
Sent: Sunday, November 08, 2009 2:35 PM
To: &lt;xsl-list@lists.mulberrytech.com&gt;
Subject: Re: [xsl] Obtaining a specific context position()

&gt;
&gt; the value returned by position() is unrelated to the position of the node
&gt; in the source tree, it is just a function of the context selected by the
&gt; current xpath (for example if you select a node with . then it has
&gt; position()=1 whevever it appears in the source)
&gt;
&gt; It's not clear really what you want for the subdiv version, in your
&gt; posted sample it was the same value as in the heading, in which case you
&gt; can just save it in a variable and use it twice.
&gt;
&gt;
&gt; &lt;xsl:variable name=&quot;h&quot; select=&quot;position()&quot;/&gt;
&gt;
&gt;               &lt;Heading&gt;
&gt;                  &lt;xsl:value-of select=&quot;$h&quot;/&gt; &lt;!-- first call --&gt;
&gt;                &lt;/Heading&gt;
&gt;
&gt;                &lt;xsl:for-each-group select=&quot;current-group()&quot; 
&gt; group-by=&quot;SubDiv1&quot;&gt;
&gt;                &lt;xsl:sort select=&quot;current-grouping-key()&quot; 
&gt; collation=&quot;{$sorting-collation}&quot;/&gt;
&gt;
&gt;                    &lt;SubDiv1&gt;
&gt;                  &lt;xsl:value-of select=&quot;$h&quot;/&gt; &lt;!-- second call --&gt;
&gt;
&gt; David
&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;
&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/msg1000306326.html</link>
</item><item>
<title>Re: [xsl] Obtaining a specific context position() - 11/8/2009 10:36:00 PM</title>
<description><![CDATA[<pre>the value returned by position() is unrelated to the position of the node
in the source tree, it is just a function of the context selected by the
current xpath (for example if you select a node with . then it has
position()=1 whevever it appears in the source)

It's not clear really what you want for the subdiv version, in your
posted sample it was the same value as in the heading, in which case you
can just save it in a variable and use it twice.


&lt;xsl:variable name=&quot;h&quot; select=&quot;position()&quot;/&gt;

               &lt;Heading&gt;
                  &lt;xsl:value-of select=&quot;$h&quot;/&gt; &lt;!-- first call --&gt;
                &lt;/Heading&gt;

                &lt;xsl:for-each-group select=&quot;current-group()&quot; group-by=&quot;SubDiv1&quot;&gt;
                &lt;xsl:sort select=&quot;current-grouping-key()&quot; collation=&quot;{$sorting-collation}&quot;/&gt;

                    &lt;SubDiv1&gt;
                  &lt;xsl:value-of select=&quot;$h&quot;/&gt; &lt;!-- second call --&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/msg1000306325.html</link>
</item><item>
<title>[xsl] Obtaining a specific context position() - 11/8/2009 10:09:00 PM</title>
<description><![CDATA[<pre>Hi All,
I have a nested grouping arrangement, simplified (I hope not too much or 
incorrectly) below in Listing 2.
 It operates on the xml file simplified in Listing 3.

&lt;xsl:value-of select=&quot;//List/Item/position()&quot;/&gt;&quot;

returns the position of every &lt;Item&gt; in the list.  What I want as a result 
is the position in the &lt;List&gt; of the &lt;SubDiv1&gt;'s parent &lt;Item&gt;.

The output I want is in Listing 1a, the output I get is in Listing 1b.
Thanks,
Mark

Listing 1a: desired.
&lt;List&gt;
&lt;Item&gt;
    &lt;Heading&gt;1&lt;/Heading&gt;
    &lt;SubDiv1&gt;1&lt;/SubDiv1&gt;
&lt;/Item&gt;
&lt;Item&gt;
    &lt;Heading&gt;2&lt;/Heading&gt;
    &lt;SubDiv1&gt;2&lt;/SubDiv&gt;
&lt;/Item&gt;
&lt;/List&gt;

Listing 1a: actual

&lt;List&gt;
&lt;Item&gt;
    &lt;Heading&gt;1&lt;/Heading&gt;
    &lt;SubDiv1&gt;1 2&lt;/SubDiv1&gt;
&lt;/Item&gt;
&lt;Item&gt;
    &lt;Heading&gt;2&lt;/Heading&gt;
    &lt;SubDiv1&gt;1 2&lt;/SubDiv&gt;
&lt;/Item&gt;
&lt;/List&gt;


Listing 2: simplified xsl:

 &lt;xsl:template match=&quot;List&quot;&gt;
    &lt;List&gt;
        &lt;xsl:for-each-group select=&quot;Item&quot; group-by=&quot;Heading&quot; 
collation=&quot;{$sorting-collation}&quot;&gt;
        &lt;xsl:sort select=&quot;current-grouping-key()&quot; 
collation=&quot;{$sorting-collation}&quot;/&gt;
            &lt;Item&gt;
               &lt;Heading&gt;
                  &lt;xsl:value-of select=&quot;position()&quot;/&gt; &lt;!-- first call --&gt;
                &lt;/Heading&gt;

                &lt;xsl:for-each-group select=&quot;current-group()&quot; 
group-by=&quot;SubDiv1&quot;&gt;
                &lt;xsl:sort select=&quot;current-grouping-key()&quot; 
collation=&quot;{$sorting-collation}&quot;/&gt;

                    &lt;SubDiv1&gt;
                         &lt;xsl:value-of select=&quot;//List/Item/position()&quot;/&gt; 
&lt;!-- second call --&gt;
                    &lt;/SubDiv1&gt;
            ...........
&lt;/xsl:template&gt;

Listing 3: xml
&lt;List&gt;
    &lt;Item&gt;
      &lt;Heading&gt;Poland&lt;/Heading&gt;
        &lt;SubDiv1&gt;1958&lt;/SubDiv1&gt;
    &lt;/Item&gt;
    &lt;Item&gt;
      &lt;Heading &gt;Spain&lt;/Heading&gt;
       &lt;SubDiv1&gt;1958&lt;/SubDiv1&gt;
   &lt;/Item&gt;
&lt;/List&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/msg1000306324.html</link>
</item><item>
<title>Re: [xsl] Re: removing a specific namespace declaration - 11/8/2009 9:03:00 PM</title>
<description><![CDATA[<pre>On 11/8/09 2:15 PM, &quot;G. Ken Holman&quot; &lt;gkholman@CraneSoftwrights.com&gt; wrote:


&gt; Fine ... but just remember an unused namespace is supposed to be
&gt; benign to XML-based applications.
&gt; 
&gt;&gt; It's still a little unclear to me why this approach requires a
&gt;&gt; namespace declaration in the element
&gt;&gt; (namespace=&quot;{namespace-uri(.)}&quot;), as I would have thought the
&gt;&gt; explicit copying of namespace nodes would have taken care of it,

Unexpected (and unneeded) namespace declarations can be a problem for
DTD-validated documents where not all elements provide the namespace
declaration attributes. Thus a namespace declaration emitted on an element
the DTD didn't provide for will result in an invalid document.

Cheers,

Eliot

----
Eliot Kimber | Senior Solutions Architect | Really Strategies, Inc.
email:  ekimber@reallysi.com &lt;mailto:ekimber@reallysi.com&gt;
office: 610.631.6770 | cell: 512.554.9368
2570 Boulevard of the Generals | Suite 213 | Audubon, PA 19403
www.reallysi.com &lt;http://www.reallysi.com&gt;  | http://blog.reallysi.com
&lt;http://blog.reallysi.com&gt; | www.rsuitecms.com &lt;http://www.rsuitecms.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/msg1000306320.html</link>
</item><item>
<title>Re: [xsl] Re: removing a specific namespace declaration - 11/8/2009 8:17:00 PM</title>
<description><![CDATA[<pre>At 2009-11-08 11:41 -0800, tom a wrote:
&gt;The foo namespace usage is an unused artifact, so I just wanted to 
&gt;clean up the output.

Fine ... but just remember an unused namespace is supposed to be 
benign to XML-based applications.

&gt;It's still a little unclear to me why this approach requires a 
&gt;namespace declaration in the element 
&gt;(namespace=&quot;{namespace-uri(.)}&quot;), as I would have thought the 
&gt;explicit copying of namespace nodes would have taken care of it,

What you say would be fine if every element in your data is prefixed, 
but that would not be true in the general case when you don't know 
what your users are doing with their data with respect to using or 
not using the default namespace. Nor is it the case in your test data:

At 2009-11-07 16:42 -0800, you wrote:
&gt;I'm trying to remove what I believe to be an unused namespace 
&gt;declaration from the output. 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;

Note that your document element &quot;svg&quot; is in the default namespace.

Creating the result element with the name &quot;svg&quot; without 
namespace=&quot;{namespace-uri(.)}&quot; would have created a result element 
&lt;svg&gt; in no namespace, not in the SVG namespace.

So it really is absolutely required.

&gt;but the namespace fog is gradually starting to clear.

I tell my students to just think of XML as a labeled hierarchy of 
your information and that namespaces are used to make globally unique 
labels.  I see it as that simple.  Without making the labels unique 
then processing applications can get confused, so adding a namespace 
to the label makes the label distinctive from other labels of the 
same local name.

A metaphor I use in class is that the namespace URI identifies the 
dictionary in which the local name is found, as what one would use to 
look up the definition of a word.  Consider the word &quot;chair&quot;:  in 
French it is the word for &quot;flesh&quot; while in English it is a piece of 
furniture.  Without knowing what dictionary to look in for the word 
&quot;chair&quot; to know what you need to do to process the word, you don't 
know the meaning of the word.  Similarly without knowing which of the 
vocabularies SVG or MathML you are working with you don't know how to 
handle the element named &lt;set&gt;.

Hopefully the fog will clear soon for you.

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/msg1000306317.html</link>
</item><item>
<title>[xsl] Re: removing a specific namespace declaration - 11/8/2009 7:42:00 PM</title>
<description><![CDATA[<pre>That's extremely helpful Ken. Using copy-of against the namespace axis was the key insight for me. Thanks very much.

The foo namespace usage is an unused artifact, so I just wanted to clean up the output.

It's still a little unclear to me why this approach requires a namespace declaration in the element (namespace=&quot;{namespace-uri(.)}&quot;), as I would have thought the explicit copying of namespace nodes would have taken care of it, but the namespace fog is gradually starting to clear.

Thanks again for the tip, Ken!

Tom


      

--~------------------------------------------------------------------
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/msg1000306313.html</link>
</item><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