﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>XSL-LIST Mailing List</title><link>http://www.stylusstudio.com/blogs/xsllist/</link><description>XSL-List is an open and unmediated discussion forum on the Extensible Stylesheet Language (XSL), covering topics including the XSL specification, XSL processor implementations, and user questions. Its goal is to increase the global level of XSL knowledge and usage. XSL-List is a service by Mulberry Technologies, please observe their official guidelines when posting to the list.</description><copyright>Copyright 2004-2006 Progress Software Corporation. All Rights Reserved.</copyright><ttl>5</ttl><item><title>Re:  XSLT 3.0 features in Saxon 9.5</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On Wed, 24 Apr 2013, Michael Kay wrote:</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>I thought that some of you who like to stay close to the bleeding edge might like to try out some of the new XSLT 3.0 features implemented in Saxon 9.5.
</tt></blockquote><tt>[...]
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>* xsl:map and xsl:map-entry so you can now construct maps at the XSLT level, not only at the XPath level
</tt></blockquote><tt><br>I don't see documentation of the syntax for these instructions either at 
saxonica.com or in the current working draft for XSLT 3.0 ...?</tt><br>
<br>
<pre style="margin: 0em;">--
David Sewell, Editorial and Technical Manager
ROTUNDA, The University of Virginia Press
PO Box 400314, Charlottesville, VA 22904-4314 USA
Email: dsewell@xxxxxxxxxxxx   Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201305/post40000.html</link><pubDate>Mon, 06 May 2013 22:33:36 GMT</pubDate></item><item><title>Re:  XSLT 3.0 features in Saxon 9.5</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On Wed, 24 Apr 2013, Michael Kay wrote:</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>I thought that some of you who like to stay close to the bleeding edge might like to try out some of the new XSLT 3.0 features implemented in Saxon 9.5.
</tt></blockquote><tt>[...]
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>* xsl:map and xsl:map-entry so you can now construct maps at the XSLT level, not only at the XPath level
</tt></blockquote><tt><br>I don't see documentation of the syntax for these instructions either at 
saxonica.com or in the current working draft for XSLT 3.0 ...?</tt><br>
<br>
<pre style="margin: 0em;">--
David Sewell, Editorial and Technical Manager
ROTUNDA, The University of Virginia Press
PO Box 400314, Charlottesville, VA 22904-4314 USA
Email: dsewell@xxxxxxxxxxxx   Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201305/post40000.html?utm_source=feedly</link><pubDate>Mon, 06 May 2013 22:33:36 GMT</pubDate></item><item><title> XSLT 3.0 Relax NG Schema</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Dear XSLT Fans,

For people eager to start playing with bleeding edge XSLT 3.0

Relax NG
http://www.sharexml.com/x/get?k=NDGu7yBYGAUC

Relax NG Compact
http://www.sharexml.com/x/get?k=gfC5oPhTcGjx

Best regards,

Xmlizer

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201305/post30000.html</link><pubDate>Sat, 04 May 2013 22:23:01 GMT</pubDate></item><item><title> [ann] A series of 3 webinars on XSLT development with </title><description><![CDATA[<!--X-Body-of-Message-->
<tt>Hi all,</tt><br>
<br>
<tt>I would like to invite you to attend our &quot;XSLT development with oXygen 
XML Editor&quot; webinars.<br>
XSLT is the best supported technology in oXygen and we will try to cover 
all aspects of XSLT development in 3 webinars.</tt><br>
<br>
<tt>The first webinar is scheduled for May 8th from 11:00 AM to 12:00 PM EDT 
and it will cover editing, validation, transformations, generating 
documentation for your XSLT stylesheets (Javadoc-like documentation), 
XPath content completion, etc. See more details and register at<br>
http://www.oxygenxml.com/events/2013/webinar_xslt_development_with_oXygen_Part1.html </tt><br>
<br>
<tt><br>In our second webinar we will introduce refactoring actions, XSLT-aware 
search, hierarchy and dependencies views as well as how you can work 
with XSLT modules. This is scheduled for June 5th at the same time, from 
11:00 AM to 12:00 PM EDT. See more details and register for part 2 at<br>
http://www.oxygenxml.com/events/2013/webinar_xslt_development_with_oXygen_Part2.html </tt><br>
<br>
<tt><br>The third webinar will be on July 3rd between 11:00 AM and 12:00 PM EDT 
and it will dive into the debugging and profiling support as well as 
into the integrated XSLT unit testing. Details and registration link are 
available at<br>
http://www.oxygenxml.com/events/2013/webinar_xslt_development_with_oXygen_Part3.html</tt><br>
<br>
<tt>All these events are free events but registration is required because 
there is a limit on the total number of attendees, so make sure you 
reserve your seat now!</tt><br>
<br>
<tt>I look forward to meeting you next Wednesday at our first XSLT webinar!</tt><br>
<br>
<pre style="margin: 0em;">Best Regards,
George
--
George Cristian Bina
&lt;oXygen/&gt; XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201305/post00000.html</link><pubDate>Wed, 01 May 2013 13:13:53 GMT</pubDate></item><item><title> XSL-List Guidelines</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>This information is posted to the XSL-List (and the XSL-List Digest)
at intervals under the subject line &quot;XSL-List guidelines&quot;.

INTRODUCTION TO XSL-LIST

XSL-List hosts discussion of XSL itself, XSL applications and implementation,
and XSL user questions. XSL-List is open to everyone, users and developers,
experts and novices alike. There is no restriction to what may be posted on
the XSL-List provided it is related to XSL, which is considered to include
XSLT (versions 1 and 2), XPath (versions 1 and 2) and XSL Formatting Objects
(FO).

XSL-List is not a W3C mailing list, and has no affiliation with W3C (or any
official standing with any standards organization). However, XSL-List was
established with the encouragement of members of the W3C XSL Working Group,
and members of the Working Group are among the subscribers to the list.

Only subscribers can post to XSL-List, but since the goal is to increase the
level of XSL knowledge, XSL-List is being archived for everybody to view. The
topics being discussed on the XSL-List change as new ideas arise or existing
problems are dealt with, but the archive contains all of the ideas and
solutions that have been discussed on the list.

XSL-List is provided by Mulberry Technologies, Inc., as a service to the XSL
user community. Mulberry is an XML and SGML consultancy specializing in
applications that have a text design, processing, interchange, or display
component. For more information about Mulberry Technologies, Inc. see
http://www.mulberrytech.com


SUBSCRIBING TO THE XSL-LIST

To subscribe to the list, fill out the form at
http://www.mulberrytech.com/xsl/xsl-list/subscribe-unsubscribe.html.


DAILY DIGEST

Daily digests -- copies of a whole days XSL-List messages sent as one email
message -- are available. Not only is it a single email message containing all
of that day's XSL-List messages, it is also half the size, on average, of the
individual messages since it doesn't include the overhead of the mail headers
from each message.

To unsubscribe from the list and subscribe to the digest, use the form at
http://www.mulberrytech.com/xsl/xsl-list/subscribe-unsubscribe.html.


POSTING GUIDELINES

Only subscribers can post to XSL-List, and only from the exact address they
used when they subscribed.

There is no restriction on what may be posted to the XSL-List provided it is
related to XSL. Items concerning XML but without a direct connection to XSL
should be posted to a XML-related list instead of to the XSL-List. Items
related to DSSSL should be posted to the DSSSList.

Do not begin your subject line with &quot;help&quot; or &quot;subscribe&quot; since the list
software will bounce the message because it looks like is an administrative
request.

It is best to start a new message for a new thread. Do not start a new thread
by replying to an unrelated message and just changing the subject line, since
the header of your message will contain references to the previous message and
your new message will appear in the archive as one of the replies to the
original message.

Both subscribers to the full list (xsl-list@xxxxxxxxxxxxxxxxxxxxxx) and
subscribers to the digest (xsl-list-digest@xxxxxxxxxxxxxxxxxxxxxx) should post
their messages to xsl- list@xxxxxxxxxxxxxxxxxxxxxx; the messages will be
received by both subscribers to the list and subscribers to the digest.


BEFORE YOU POST ... DO YOUR HOMEWORK
- Check that your question isn't already answered in the XSL FAQ at
http://www.dpawson.co.uk/.
- Check that your question isn't already answered in the XSL-List archives at
http://www.biglist.com/lists/xsl-list/archives/.
- If you are asking for help with XSL code, determine which version of the
language you are using (plus extensions, if any), and confirm that your XSL
processor supports that version and/or extension. (If you are unsure of your
processor, this can be determined by using the stylesheet at
http://www.mulberrytech.com/xsl/xsl-list/processor-version.xsl on any input,
including the stylesheet itself: see
http://www.mulberrytech.com/xsl/xsl-list/processor-version.html for more
information.) An XSLT 1.0 engine will not process stylesheets written in XSLT
2.0!


IN YOUR POSTING ...

Name the XSL processor, processor version, and version of the language you are
using. This information is frequently necessary to diagnose a problem exactly,
and always helps respondents give good advice.

If you are replying to a post, trim the quoted message to just the parts to
which you are replying.

In addition to following simple rules of net etiquette and common sense, you
will improve the chances that you will receive prompt and helpful responses
by:
- Asking questions specific enough that answers are possible. Describe what
you are trying to do, how you approached it, what happened, and why you don't
like the result you got. Don't simply say &quot;it gave me an error&quot;: paste in the
error message (someone else can probably make sense of it).
-  Illustrating your question with a demonstration of the problem.
Well-composed questions frequently include a small XML sample, an XSLT
stylesheet, the results received, and the result that was desired - all in
miniature, to make it comprehensible to readers new to your problem. (It is
also not uncommon to discover what a problem actually is in the process of
reducing it to an illustrative version.)


USE INFORMATIVE SUBJECT LINES

When posting to the XSL-List, do not use uninformative subject lines like
&quot;Urgent&quot;, &quot;Question&quot;, or &quot;Newbie HELP!!!&quot;, which don't say anything about what
your problem is. Instead, use a meaningful subject line that will make sense
to the people whose help you are trying to get. It may even get a response
from people who normally shy away from &quot;beginner&quot; questions.

Informative subject lines make the XSL-List archive more useful since people
with the same problem will more easily find the relevant threads.


DO NOT CROSS-POST

Cross-posting to the XSL-List and to another list, even XML-Dev or the
DSSSList, is generally counter-productive. No list's archive will contain the
complete thread; cross-posts from non-subscribers continuing the thread will
bounce; and XSL-List subscribers who are not also on the other list will only
see half the thread, as will those on the other list who are not also reading
XSL- List. Subscribers to both lists may see two copies of the message,
annoying them as well.


REPLIES GO TO THE LIST

The reply address of XSL-List messages (and of digests) is
xsl-list@xxxxxxxxxxxxxxxxxxxxxx so REPLIES GO TO THE LIST BY DEFAULT. If you
want to reply to just the author of a post, you should change the &quot;To:&quot; field
in your reply.


USE SHORT QUOTES OF PREVIOUS MESSAGES IN REPLIES

Please do not quote entire messages just to add a few lines at the beginning
or end. Instead, quote the parts to which you are directly replying or quote
enough to establish the context.

Everybody on the list has already received the message that you are quoting,
and anyone searching the archive will find your message and the previous
message listed under the same thread.

Subscribers to the XSL-List will just ignore most of the quoted messages and
move to the next post, but subscribers to the XSL-List Digest will mostly have
to page past the quoted messages to reach the next material in which they are
interested in reading.


POSTINGS MUST BE IN PLAIN TEXT ONLY

Postings to XSL-List must be in plain text only. The XSL-List does not allow
HTML postings because many users cannot display them appropriately, and
because
they are unnecessarily large.


POSTINGS MAY NOT BE IN BASE 64

Postings to XSL-List may not be in Base 64 because it makes a mess of both the
digest and the archive.


ATTACHMENTS ARE BANNED

Since Mulberry's mailing lists have in the past been unwittingly used for
spreading viruses in e-mail attachments, all e-mail attachments are banned
from the XSL-List.

XSL stylesheets are XML files, and XML files are text files, so this does not
affect the majority of posts to the list since you can include the files' text
in the body of your message. If you need to refer to a binary file such as a
PDF file, you should put the file on a Web site or FTP site and include the
file's URL in your XSL-List post.

If you do include an attachment in your XSL-List post -- even a HTML
attachment -- your message will bounce.


YOUR POST WILL BE PERMANENTLY ARCHIVED

Because it is a public resource created by and for the entire XSL
community, we do not edit XSL-List. Therefore, it is responsibility of
list subscribers not to post anything to the list that they do not want
publicly available, possibly for a very long time.

Postings in the list archives will be complete, including: all contents,
examples, sample data, code or code fragments, and email header and footer
contents. An automated process will obscure the domain portion of email
addresses (the part after the @ sign).in the headers and footers of postings,
but no guarnantee is made that this process will be completely successfull.
Other than this, all postings will be archived in public as received.

Further, we at Mulberry could not, even if we wanted to, edit all of the
archives of XSL-List. Several third-parties have created unofficial archives
of
XSL-List, often without asking, or even informing, Mulberry. Postings to
XSL-List
will be included in an unknown and ever-changing variety of web publications.
If
you don't want your questions/comments/answers in public view don't post them
to
XSL-List.


THIRD-PARTY ARCHIVES OF XSL-LIST

Third parties are welcome to create searchable or reference archives of
XSL-List
provided they adhere to the following guidelines:
- the material is clearly labelled as being from XSL-List, with
 an acknowledgement of Mulberry's role as provider of XSL-List
- there is a navigable pointer to the official list page at
 http://www.mulberrytech.com/xsl/xsl-list/ either on every posting
 or associated with the user interface such that it is visible with
 the postings
- list postings are unedited
- either the entire archive of the list is provided or there is a
 clearly stated method for selecting the subset of the list that is provided

Mulberry does not provide these third parties with help to create these
archives, does not endorse particular third party archives, and has no control
over the ways in which they present the material in their systems.

People or organizations that publish the contents of XSL-List without
following
the guidelines above are being very antisocial. Please bookmark either
the official XSL-List archive or one provided by a service that plays nicely
in the community and shun those who do not give credit where credit it due.


UNSUBSCRIBING FROM THE XSL-LIST

To unsubscribe from XSL-List, use the form at
http://www.mulberrytech.com/xsl/xsl-list/subscribe-unsubscribe.html. If you
have difficulties unsubscribing from the list:
 - make sure you are unsubscribing EXACTLY the email address that is
   subscribed
 - if you receive only one message a day from the list be sure to
   check the box marked &quot;Select for the Digest version of the list&quot;
   (if you subscribe to the digest and don't check this box the system
   will try to unsubscribe you from the regular list and fail; it will
   only unsubscribe you from the digest if you check this box.)

UNSUBSCRIBING FROM THE XSL-LIST DIGEST

To unsubscribe from the XSL-List digest, use the form at
http://www.mulberrytech.com/xsl/xsl-list/subscribe-unsubscribe.html and
check the box marked &quot;Select for the Digest version of the list&quot;.


IF YOU STOP GETTING XSL-LIST MESSAGES

If you stop receiving XSL-List message, you may have been removed because mail
to you was bouncing. You are not being picked on, and you can just rejoin the
list.


ARCHIVE

XSL-List messages are archived at
http://www.biglist.com/lists/xsl-list/archives/.


REPORTING BUGS IN SOFTWARE

Bugs in software should firstly be reported to its author rather than to the
XSL List. Questions regarding how to work around bugs are welcome, but the
list does not function as a bug-tracking system for any software.


XSL FAQ AND OTHER INFORMATION ON XSL

Dave Pawson's XSL FAQ is at http://www.dpawson.co.uk/xsl/index.html.

The W3C information on XSL is at http://www.w3.org/Style/XSL.

Mulberry's Quick References are at http://www.mulberrytech.com/quickref/ and
cover XSLT, XPath, and XQuery.


DSSSLIST -- THE DSSSL USERS' MAILING LIST

Mulberry Technologies, Inc., also provides the DSSSList -- the DSSSL Users'
Mailing List. For subscription information and the DSSSList archive, see
http://www.mulberrytech.com/dsssl/dssslist.


CONTACT

If you have any questions or problems, please contact
xsl-list-owner@xxxxxxxxxxxxxxxxxxxxxxx


ADMINISTRATIVE COMMUNICATIONS

The list administrator will reply to emailed questions relating to the
mechanics and administration of XSL-List and to help new users learn to use
the list. However, the administrator will not take the time to navigate mazes
of any sort in order to do so. If the list owner's messages are rejected by a
user's anti-spam system the list owner will not pursue the matter. Similarly,
if list-related notices to a subscriber are rejected as spam the subscriber
will be unsubscribed.



CHANGE History

==============
December 26, 2011 - btu.

11. Clarified instructions on unsubscribing from the digest version
    of the list.

==============
May 5, 2009 - btu.

10. Added paragraph clarifying that all content will be archived in
    public, including text, examples, code, and email headers and
    footers including names.

==============
February 1, 2008 - btu.

9. Policy on third-party archives added.

8. Policy banning attachments and postings in Base 64 clarified.

==============
September 1, 2007 - btu.

7. Administrative communication policy clarified.


==============
October 1, 2005 - btu.

6. Mulberry Technologies' relationship to XSL-List clarified. We
   do the work. We pay the bills. Organizations who post unauthorized
   copies of the archive without acknowledging Mulberry's contribution
   are not playing nicely in the community.

==============
March 2, 2005 - btu.

4. Users are asked to identify the version of XSLT and XPath
   they are using for questions that are specific to one version

5. Clarifying the policy on editing the list archive (we don't edit
   it).

==============
March 30, 2004 - btu.

1. All references to subscribing and unsubscribing have been
   updated to reflect changes in the list management system.

2. Pointers to the XSL and XPath specification were removed. There
   are now so many specifications and draft specifications relevant
   to XSL that it is more practical to simply point to W3C's XSL
   page.

3. A few typographical errors were corrected.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201305/post20000.html</link><pubDate>Wed, 01 May 2013 09:58:31 GMT</pubDate></item><item><title> XSL-List Guidelines</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>This information is posted to the XSL-List (and the XSL-List Digest)
at intervals under the subject line &quot;XSL-List guidelines&quot;.

INTRODUCTION TO XSL-LIST

XSL-List hosts discussion of XSL itself, XSL applications and implementation,
and XSL user questions. XSL-List is open to everyone, users and developers,
experts and novices alike. There is no restriction to what may be posted on
the XSL-List provided it is related to XSL, which is considered to include
XSLT (versions 1 and 2), XPath (versions 1 and 2) and XSL Formatting Objects
(FO).

XSL-List is not a W3C mailing list, and has no affiliation with W3C (or any
official standing with any standards organization). However, XSL-List was
established with the encouragement of members of the W3C XSL Working Group,
and members of the Working Group are among the subscribers to the list.

Only subscribers can post to XSL-List, but since the goal is to increase the
level of XSL knowledge, XSL-List is being archived for everybody to view. The
topics being discussed on the XSL-List change as new ideas arise or existing
problems are dealt with, but the archive contains all of the ideas and
solutions that have been discussed on the list.

XSL-List is provided by Mulberry Technologies, Inc., as a service to the XSL
user community. Mulberry is an XML and SGML consultancy specializing in
applications that have a text design, processing, interchange, or display
component. For more information about Mulberry Technologies, Inc. see
http://www.mulberrytech.com


SUBSCRIBING TO THE XSL-LIST

To subscribe to the list, fill out the form at
http://www.mulberrytech.com/xsl/xsl-list/subscribe-unsubscribe.html.


DAILY DIGEST

Daily digests -- copies of a whole days XSL-List messages sent as one email
message -- are available. Not only is it a single email message containing all
of that day's XSL-List messages, it is also half the size, on average, of the
individual messages since it doesn't include the overhead of the mail headers
from each message.

To unsubscribe from the list and subscribe to the digest, use the form at
http://www.mulberrytech.com/xsl/xsl-list/subscribe-unsubscribe.html.


POSTING GUIDELINES

Only subscribers can post to XSL-List, and only from the exact address they
used when they subscribed.

There is no restriction on what may be posted to the XSL-List provided it is
related to XSL. Items concerning XML but without a direct connection to XSL
should be posted to a XML-related list instead of to the XSL-List. Items
related to DSSSL should be posted to the DSSSList.

Do not begin your subject line with &quot;help&quot; or &quot;subscribe&quot; since the list
software will bounce the message because it looks like is an administrative
request.

It is best to start a new message for a new thread. Do not start a new thread
by replying to an unrelated message and just changing the subject line, since
the header of your message will contain references to the previous message and
your new message will appear in the archive as one of the replies to the
original message.

Both subscribers to the full list (xsl-list@xxxxxxxxxxxxxxxxxxxxxx) and
subscribers to the digest (xsl-list-digest@xxxxxxxxxxxxxxxxxxxxxx) should post
their messages to xsl- list@xxxxxxxxxxxxxxxxxxxxxx; the messages will be
received by both subscribers to the list and subscribers to the digest.


BEFORE YOU POST ... DO YOUR HOMEWORK
- Check that your question isn't already answered in the XSL FAQ at
http://www.dpawson.co.uk/.
- Check that your question isn't already answered in the XSL-List archives at
http://www.biglist.com/lists/xsl-list/archives/.
- If you are asking for help with XSL code, determine which version of the
language you are using (plus extensions, if any), and confirm that your XSL
processor supports that version and/or extension. (If you are unsure of your
processor, this can be determined by using the stylesheet at
http://www.mulberrytech.com/xsl/xsl-list/processor-version.xsl on any input,
including the stylesheet itself: see
http://www.mulberrytech.com/xsl/xsl-list/processor-version.html for more
information.) An XSLT 1.0 engine will not process stylesheets written in XSLT
2.0!


IN YOUR POSTING ...

Name the XSL processor, processor version, and version of the language you are
using. This information is frequently necessary to diagnose a problem exactly,
and always helps respondents give good advice.

If you are replying to a post, trim the quoted message to just the parts to
which you are replying.

In addition to following simple rules of net etiquette and common sense, you
will improve the chances that you will receive prompt and helpful responses
by:
- Asking questions specific enough that answers are possible. Describe what
you are trying to do, how you approached it, what happened, and why you don't
like the result you got. Don't simply say &quot;it gave me an error&quot;: paste in the
error message (someone else can probably make sense of it).
-  Illustrating your question with a demonstration of the problem.
Well-composed questions frequently include a small XML sample, an XSLT
stylesheet, the results received, and the result that was desired - all in
miniature, to make it comprehensible to readers new to your problem. (It is
also not uncommon to discover what a problem actually is in the process of
reducing it to an illustrative version.)


USE INFORMATIVE SUBJECT LINES

When posting to the XSL-List, do not use uninformative subject lines like
&quot;Urgent&quot;, &quot;Question&quot;, or &quot;Newbie HELP!!!&quot;, which don't say anything about what
your problem is. Instead, use a meaningful subject line that will make sense
to the people whose help you are trying to get. It may even get a response
from people who normally shy away from &quot;beginner&quot; questions.

Informative subject lines make the XSL-List archive more useful since people
with the same problem will more easily find the relevant threads.


DO NOT CROSS-POST

Cross-posting to the XSL-List and to another list, even XML-Dev or the
DSSSList, is generally counter-productive. No list's archive will contain the
complete thread; cross-posts from non-subscribers continuing the thread will
bounce; and XSL-List subscribers who are not also on the other list will only
see half the thread, as will those on the other list who are not also reading
XSL- List. Subscribers to both lists may see two copies of the message,
annoying them as well.


REPLIES GO TO THE LIST

The reply address of XSL-List messages (and of digests) is
xsl-list@xxxxxxxxxxxxxxxxxxxxxx so REPLIES GO TO THE LIST BY DEFAULT. If you
want to reply to just the author of a post, you should change the &quot;To:&quot; field
in your reply.


USE SHORT QUOTES OF PREVIOUS MESSAGES IN REPLIES

Please do not quote entire messages just to add a few lines at the beginning
or end. Instead, quote the parts to which you are directly replying or quote
enough to establish the context.

Everybody on the list has already received the message that you are quoting,
and anyone searching the archive will find your message and the previous
message listed under the same thread.

Subscribers to the XSL-List will just ignore most of the quoted messages and
move to the next post, but subscribers to the XSL-List Digest will mostly have
to page past the quoted messages to reach the next material in which they are
interested in reading.


POSTINGS MUST BE IN PLAIN TEXT ONLY

Postings to XSL-List must be in plain text only. The XSL-List does not allow
HTML postings because many users cannot display them appropriately, and
because
they are unnecessarily large.


POSTINGS MAY NOT BE IN BASE 64

Postings to XSL-List may not be in Base 64 because it makes a mess of both the
digest and the archive.


ATTACHMENTS ARE BANNED

Since Mulberry's mailing lists have in the past been unwittingly used for
spreading viruses in e-mail attachments, all e-mail attachments are banned
from the XSL-List.

XSL stylesheets are XML files, and XML files are text files, so this does not
affect the majority of posts to the list since you can include the files' text
in the body of your message. If you need to refer to a binary file such as a
PDF file, you should put the file on a Web site or FTP site and include the
file's URL in your XSL-List post.

If you do include an attachment in your XSL-List post -- even a HTML
attachment -- your message will bounce.


YOUR POST WILL BE PERMANENTLY ARCHIVED

Because it is a public resource created by and for the entire XSL
community, we do not edit XSL-List. Therefore, it is responsibility of
list subscribers not to post anything to the list that they do not want
publicly available, possibly for a very long time.

Postings in the list archives will be complete, including: all contents,
examples, sample data, code or code fragments, and email header and footer
contents. An automated process will obscure the domain portion of email
addresses (the part after the @ sign).in the headers and footers of postings,
but no guarnantee is made that this process will be completely successfull.
Other than this, all postings will be archived in public as received.

Further, we at Mulberry could not, even if we wanted to, edit all of the
archives of XSL-List. Several third-parties have created unofficial archives
of
XSL-List, often without asking, or even informing, Mulberry. Postings to
XSL-List
will be included in an unknown and ever-changing variety of web publications.
If
you don't want your questions/comments/answers in public view don't post them
to
XSL-List.


THIRD-PARTY ARCHIVES OF XSL-LIST

Third parties are welcome to create searchable or reference archives of
XSL-List
provided they adhere to the following guidelines:
- the material is clearly labelled as being from XSL-List, with
 an acknowledgement of Mulberry's role as provider of XSL-List
- there is a navigable pointer to the official list page at
 http://www.mulberrytech.com/xsl/xsl-list/ either on every posting
 or associated with the user interface such that it is visible with
 the postings
- list postings are unedited
- either the entire archive of the list is provided or there is a
 clearly stated method for selecting the subset of the list that is provided

Mulberry does not provide these third parties with help to create these
archives, does not endorse particular third party archives, and has no control
over the ways in which they present the material in their systems.

People or organizations that publish the contents of XSL-List without
following
the guidelines above are being very antisocial. Please bookmark either
the official XSL-List archive or one provided by a service that plays nicely
in the community and shun those who do not give credit where credit it due.


UNSUBSCRIBING FROM THE XSL-LIST

To unsubscribe from XSL-List, use the form at
http://www.mulberrytech.com/xsl/xsl-list/subscribe-unsubscribe.html. If you
have difficulties unsubscribing from the list:
 - make sure you are unsubscribing EXACTLY the email address that is
   subscribed
 - if you receive only one message a day from the list be sure to
   check the box marked &quot;Select for the Digest version of the list&quot;
   (if you subscribe to the digest and don't check this box the system
   will try to unsubscribe you from the regular list and fail; it will
   only unsubscribe you from the digest if you check this box.)

UNSUBSCRIBING FROM THE XSL-LIST DIGEST

To unsubscribe from the XSL-List digest, use the form at
http://www.mulberrytech.com/xsl/xsl-list/subscribe-unsubscribe.html and
check the box marked &quot;Select for the Digest version of the list&quot;.


IF YOU STOP GETTING XSL-LIST MESSAGES

If you stop receiving XSL-List message, you may have been removed because mail
to you was bouncing. You are not being picked on, and you can just rejoin the
list.


ARCHIVE

XSL-List messages are archived at
http://www.biglist.com/lists/xsl-list/archives/.


REPORTING BUGS IN SOFTWARE

Bugs in software should firstly be reported to its author rather than to the
XSL List. Questions regarding how to work around bugs are welcome, but the
list does not function as a bug-tracking system for any software.


XSL FAQ AND OTHER INFORMATION ON XSL

Dave Pawson's XSL FAQ is at http://www.dpawson.co.uk/xsl/index.html.

The W3C information on XSL is at http://www.w3.org/Style/XSL.

Mulberry's Quick References are at http://www.mulberrytech.com/quickref/ and
cover XSLT, XPath, and XQuery.


DSSSLIST -- THE DSSSL USERS' MAILING LIST

Mulberry Technologies, Inc., also provides the DSSSList -- the DSSSL Users'
Mailing List. For subscription information and the DSSSList archive, see
http://www.mulberrytech.com/dsssl/dssslist.


CONTACT

If you have any questions or problems, please contact
xsl-list-owner@xxxxxxxxxxxxxxxxxxxxxxx


ADMINISTRATIVE COMMUNICATIONS

The list administrator will reply to emailed questions relating to the
mechanics and administration of XSL-List and to help new users learn to use
the list. However, the administrator will not take the time to navigate mazes
of any sort in order to do so. If the list owner's messages are rejected by a
user's anti-spam system the list owner will not pursue the matter. Similarly,
if list-related notices to a subscriber are rejected as spam the subscriber
will be unsubscribed.



CHANGE History

==============
December 26, 2011 - btu.

11. Clarified instructions on unsubscribing from the digest version
    of the list.

==============
May 5, 2009 - btu.

10. Added paragraph clarifying that all content will be archived in
    public, including text, examples, code, and email headers and
    footers including names.

==============
February 1, 2008 - btu.

9. Policy on third-party archives added.

8. Policy banning attachments and postings in Base 64 clarified.

==============
September 1, 2007 - btu.

7. Administrative communication policy clarified.


==============
October 1, 2005 - btu.

6. Mulberry Technologies' relationship to XSL-List clarified. We
   do the work. We pay the bills. Organizations who post unauthorized
   copies of the archive without acknowledging Mulberry's contribution
   are not playing nicely in the community.

==============
March 2, 2005 - btu.

4. Users are asked to identify the version of XSLT and XPath
   they are using for questions that are specific to one version

5. Clarifying the policy on editing the list archive (we don't edit
   it).

==============
March 30, 2004 - btu.

1. All references to subscribing and unsubscribing have been
   updated to reflect changes in the list management system.

2. Pointers to the XSL and XPath specification were removed. There
   are now so many specifications and draft specifications relevant
   to XSL that it is more practical to simply point to W3C's XSL
   page.

3. A few typographical errors were corrected.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201305/post10000.html</link><pubDate>Wed, 01 May 2013 09:58:26 GMT</pubDate></item><item><title>Re:  how to include nodes inside CData tags</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>It's a very confused question. &quot;tags&quot; exist in lexical (angle-bracket) XML,
&quot;nodes&quot; exist in the tree representation of XML, and the two things are quite
distinct, so nodes can't appear within tags.

More particularly, element markup can't appear within CDATA tags. The whole
purpose of CDATA is to say &quot;stuff in here that looks like markup is not markup
at all, it is ordinary characters&quot;.

So the answer is, generate characters that look like markup.

Using disable-output-escaping is completely wrong: d-o-e stops markup
characters being treated as plain text, whereas you want plain text to be
treated as markup characters.

Michael Kay
Saxonica


On 30 Apr 2013, at 14:16, Terry Ofner wrote:

&gt; I need to generate the following format:
&gt;
&gt; &lt;question&gt;
&gt; &lt;![CDATA[The city council passed the new &lt;strong&gt;regulation&lt;/strong&gt;.]]&gt;
&gt; &lt;/question&gt;
&gt;
&gt; from this input:
&gt;
&gt; &lt;question&gt;The city council passed the new
&lt;strong&gt;regulation&lt;/strong&gt;.&gt;&lt;/question&gt;
&gt;
&gt; when I add cdata-section-elements=&quot;question&quot; to my xsl:output statement, I
get this results:
&gt;
&gt; &lt;question&gt;&lt;![CDATA[6. The city council passed the new
]]&gt;&lt;strong&gt;regulation&lt;/strong&gt;&lt;![CDATA[.]]&gt;&lt;/question&gt;
&gt;
&gt;
&gt; Is there a way to include the &lt;strong&gt; element in the CDATA?
&gt;
&gt; I have tried to convert the &lt;strong&gt; tag to text:
&gt;
&gt; &lt;xsl:text
disable-output-escaping=&quot;yes&quot;&gt;&amp;amp;#x003C;strong&amp;amp;#x003E;&lt;/xsl:text&gt;
&gt;        &lt;xsl:apply-templates/&gt;
&gt; &lt;xsl:text
disable-output-escaping=&quot;yes&quot;&gt;&amp;amp;#x003C;/strong&amp;amp;#x003E;&lt;/xsl:text&gt;
&gt;
&gt; but to no avail.
&gt;
&gt; I am using xslt 2.0
&gt;
&gt; Any help would be appreciated.
&gt;
&gt; Terry

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post50080.html</link><pubDate>Tue, 30 Apr 2013 14:44:10 GMT</pubDate></item><item><title>Re:  how to include nodes inside CData tags</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>It's a very confused question. &quot;tags&quot; exist in lexical (angle-bracket) XML,
&quot;nodes&quot; exist in the tree representation of XML, and the two things are quite
distinct, so nodes can't appear within tags.

More particularly, element markup can't appear within CDATA tags. The whole
purpose of CDATA is to say &quot;stuff in here that looks like markup is not markup
at all, it is ordinary characters&quot;.

So the answer is, generate characters that look like markup.

Using disable-output-escaping is completely wrong: d-o-e stops markup
characters being treated as plain text, whereas you want plain text to be
treated as markup characters.

Michael Kay
Saxonica


On 30 Apr 2013, at 14:16, Terry Ofner wrote:

&gt; I need to generate the following format:
&gt;
&gt; &lt;question&gt;
&gt; &lt;![CDATA[The city council passed the new &lt;strong&gt;regulation&lt;/strong&gt;.]]&gt;
&gt; &lt;/question&gt;
&gt;
&gt; from this input:
&gt;
&gt; &lt;question&gt;The city council passed the new
&lt;strong&gt;regulation&lt;/strong&gt;.&gt;&lt;/question&gt;
&gt;
&gt; when I add cdata-section-elements=&quot;question&quot; to my xsl:output statement, I
get this results:
&gt;
&gt; &lt;question&gt;&lt;![CDATA[6. The city council passed the new
]]&gt;&lt;strong&gt;regulation&lt;/strong&gt;&lt;![CDATA[.]]&gt;&lt;/question&gt;
&gt;
&gt;
&gt; Is there a way to include the &lt;strong&gt; element in the CDATA?
&gt;
&gt; I have tried to convert the &lt;strong&gt; tag to text:
&gt;
&gt; &lt;xsl:text
disable-output-escaping=&quot;yes&quot;&gt;&amp;amp;#x003C;strong&amp;amp;#x003E;&lt;/xsl:text&gt;
&gt;        &lt;xsl:apply-templates/&gt;
&gt; &lt;xsl:text
disable-output-escaping=&quot;yes&quot;&gt;&amp;amp;#x003C;/strong&amp;amp;#x003E;&lt;/xsl:text&gt;
&gt;
&gt; but to no avail.
&gt;
&gt; I am using xslt 2.0
&gt;
&gt; Any help would be appreciated.
&gt;
&gt; Terry

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post50080.html?utm_source=feedly</link><pubDate>Tue, 30 Apr 2013 14:44:10 GMT</pubDate></item><item><title>Re:  how to include nodes inside CData tags</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>On 30 April 2013 14:16, Terry Ofner &lt;tdofner@xxxxxxxxx&gt; wrote:
&gt; I need to generate the following format:
&gt;
&gt; &lt;question&gt;
&gt; &lt;![CDATA[The city council passed the new &lt;strong&gt;regulation&lt;/strong&gt;.]]&gt;
&gt; &lt;/question&gt;
&gt;
&gt; from this input:
&gt;
&gt; &lt;question&gt;The city council passed the new &lt;strong&gt;regulation&lt;/strong&gt;.&gt;&lt;/question&gt;
&gt;
&gt; when I add cdata-section-elements=&quot;question&quot; to my xsl:output statement, I get this results:
&gt;
&gt; &lt;question&gt;&lt;![CDATA[6. The city council passed the new ]]&gt;&lt;strong&gt;regulation&lt;/strong&gt;&lt;![CDATA[.]]&gt;&lt;/question&gt;
&gt;
&gt;
&gt; Is there a way to include the &lt;strong&gt; element in the CDATA?

You will need use the serialize() function in XSLT 3.0 on the
&lt;question&gt; contents, or the equivalent extension in 2.0.


-- 
Andrew Welch
http://andrewjwelch.com

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post40080.html</link><pubDate>Tue, 30 Apr 2013 14:21:53 GMT</pubDate></item><item><title> how to include nodes inside CData tags</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>I need to generate the following format:

&lt;question&gt;
&lt;![CDATA[The city council passed the new &lt;strong&gt;regulation&lt;/strong&gt;.]]&gt;
&lt;/question&gt;

from this input:

&lt;question&gt;The city council passed the new
&lt;strong&gt;regulation&lt;/strong&gt;.&gt;&lt;/question&gt;

when I add cdata-section-elements=&quot;question&quot; to my xsl:output statement, I get
this results:

&lt;question&gt;&lt;![CDATA[6. The city council passed the new
]]&gt;&lt;strong&gt;regulation&lt;/strong&gt;&lt;![CDATA[.]]&gt;&lt;/question&gt;


Is there a way to include the &lt;strong&gt; element in the CDATA?

I have tried to convert the &lt;strong&gt; tag to text:

&lt;xsl:text
disable-output-escaping=&quot;yes&quot;&gt;&amp;amp;#x003C;strong&amp;amp;#x003E;&lt;/xsl:text&gt;
        &lt;xsl:apply-templates/&gt;
&lt;xsl:text
disable-output-escaping=&quot;yes&quot;&gt;&amp;amp;#x003C;/strong&amp;amp;#x003E;&lt;/xsl:text&gt;

but to no avail.

I am using xslt 2.0

Any help would be appreciated.

Terry

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post30080.html</link><pubDate>Tue, 30 Apr 2013 09:16:05 GMT</pubDate></item><item><title>Re:  how to include nodes inside CData tags</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>In XSLT 3.0 (XPath 3.0) one can use the parse-xml-fragment() function:

 &lt;xsl:sequence select=&quot;parse-xml-fragment(question) /node()&quot;/&gt;
Cheers,
Dimitre

On Tue, Apr 30, 2013 at 6:16 AM, Terry Ofner &lt;tdofner@xxxxxxxxx&gt; wrote:
&gt; I need to generate the following format:
&gt;
&gt; &lt;question&gt;
&gt; &lt;![CDATA[The city council passed the new &lt;strong&gt;regulation&lt;/strong&gt;.]]&gt;
&gt; &lt;/question&gt;
&gt;
&gt; from this input:
&gt;
&gt; &lt;question&gt;The city council passed the new &lt;strong&gt;regulation&lt;/strong&gt;.&gt;&lt;/question&gt;
&gt;
&gt; when I add cdata-section-elements=&quot;question&quot; to my xsl:output statement, I get this results:
&gt;
&gt; &lt;question&gt;&lt;![CDATA[6. The city council passed the new ]]&gt;&lt;strong&gt;regulation&lt;/strong&gt;&lt;![CDATA[.]]&gt;&lt;/question&gt;
&gt;
&gt;
&gt; Is there a way to include the &lt;strong&gt; element in the CDATA?
&gt;
&gt; I have tried to convert the &lt;strong&gt; tag to text:
&gt;
&gt; &lt;xsl:text disable-output-escaping=&quot;yes&quot;&gt;&amp;amp;#x003C;strong&amp;amp;#x003E;&lt;/xsl:text&gt;
&gt;         &lt;xsl:apply-templates/&gt;
&gt; &lt;xsl:text disable-output-escaping=&quot;yes&quot;&gt;&amp;amp;#x003C;/strong&amp;amp;#x003E;&lt;/xsl:text&gt;
&gt;
&gt; but to no avail.
&gt;
&gt; I am using xslt 2.0
&gt;
&gt; Any help would be appreciated.
&gt;
&gt; Terry
&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
-------------------------------------
To avoid situations in which you might make mistakes may be the
biggest mistake of all
------------------------------------
Quality means doing it right when no one is looking.
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play
-------------------------------------
Facts do not cease to exist because they are ignored.
-------------------------------------
Typing monkeys will write all Shakespeare's works in 200yrs.Will they
write all patents, too? :)
-------------------------------------
I finally figured out the only reason to be alive is to enjoy it.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post60080.html</link><pubDate>Tue, 30 Apr 2013 08:48:13 GMT</pubDate></item><item><title> XSL-List Guidelines</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>This information is posted to the XSL-List (and the XSL-List Digest)
at intervals under the subject line &quot;XSL-List guidelines&quot;.

INTRODUCTION TO XSL-LIST

XSL-List hosts discussion of XSL itself, XSL applications and implementation,
and XSL user questions. XSL-List is open to everyone, users and developers,
experts and novices alike. There is no restriction to what may be posted on
the XSL-List provided it is related to XSL, which is considered to include
XSLT (versions 1 and 2), XPath (versions 1 and 2) and XSL Formatting Objects
(FO).

XSL-List is not a W3C mailing list, and has no affiliation with W3C (or any
official standing with any standards organization). However, XSL-List was
established with the encouragement of members of the W3C XSL Working Group,
and members of the Working Group are among the subscribers to the list.

Only subscribers can post to XSL-List, but since the goal is to increase the
level of XSL knowledge, XSL-List is being archived for everybody to view. The
topics being discussed on the XSL-List change as new ideas arise or existing
problems are dealt with, but the archive contains all of the ideas and
solutions that have been discussed on the list.

XSL-List is provided by Mulberry Technologies, Inc., as a service to the XSL
user community. Mulberry is an XML and SGML consultancy specializing in
applications that have a text design, processing, interchange, or display
component. For more information about Mulberry Technologies, Inc. see
http://www.mulberrytech.com


SUBSCRIBING TO THE XSL-LIST

To subscribe to the list, fill out the form at
http://www.mulberrytech.com/xsl/xsl-list/subscribe-unsubscribe.html.


DAILY DIGEST

Daily digests -- copies of a whole days XSL-List messages sent as one email
message -- are available. Not only is it a single email message containing all
of that day's XSL-List messages, it is also half the size, on average, of the
individual messages since it doesn't include the overhead of the mail headers
from each message.

To unsubscribe from the list and subscribe to the digest, use the form at
http://www.mulberrytech.com/xsl/xsl-list/subscribe-unsubscribe.html.


POSTING GUIDELINES

Only subscribers can post to XSL-List, and only from the exact address they
used when they subscribed.

There is no restriction on what may be posted to the XSL-List provided it is
related to XSL. Items concerning XML but without a direct connection to XSL
should be posted to a XML-related list instead of to the XSL-List. Items
related to DSSSL should be posted to the DSSSList.

Do not begin your subject line with &quot;help&quot; or &quot;subscribe&quot; since the list
software will bounce the message because it looks like is an administrative
request.

It is best to start a new message for a new thread. Do not start a new thread
by replying to an unrelated message and just changing the subject line, since
the header of your message will contain references to the previous message and
your new message will appear in the archive as one of the replies to the
original message.

Both subscribers to the full list (xsl-list@xxxxxxxxxxxxxxxxxxxxxx) and
subscribers to the digest (xsl-list-digest@xxxxxxxxxxxxxxxxxxxxxx) should post
their messages to xsl- list@xxxxxxxxxxxxxxxxxxxxxx; the messages will be
received by both subscribers to the list and subscribers to the digest.


BEFORE YOU POST ... DO YOUR HOMEWORK
- Check that your question isn't already answered in the XSL FAQ at
http://www.dpawson.co.uk/.
- Check that your question isn't already answered in the XSL-List archives at
http://www.biglist.com/lists/xsl-list/archives/.
- If you are asking for help with XSL code, determine which version of the
language you are using (plus extensions, if any), and confirm that your XSL
processor supports that version and/or extension. (If you are unsure of your
processor, this can be determined by using the stylesheet at
http://www.mulberrytech.com/xsl/xsl-list/processor-version.xsl on any input,
including the stylesheet itself: see
http://www.mulberrytech.com/xsl/xsl-list/processor-version.html for more
information.) An XSLT 1.0 engine will not process stylesheets written in XSLT
2.0!


IN YOUR POSTING ...

Name the XSL processor, processor version, and version of the language you are
using. This information is frequently necessary to diagnose a problem exactly,
and always helps respondents give good advice.

If you are replying to a post, trim the quoted message to just the parts to
which you are replying.

In addition to following simple rules of net etiquette and common sense, you
will improve the chances that you will receive prompt and helpful responses
by:
- Asking questions specific enough that answers are possible. Describe what
you are trying to do, how you approached it, what happened, and why you don't
like the result you got. Don't simply say &quot;it gave me an error&quot;: paste in the
error message (someone else can probably make sense of it).
-  Illustrating your question with a demonstration of the problem.
Well-composed questions frequently include a small XML sample, an XSLT
stylesheet, the results received, and the result that was desired - all in
miniature, to make it comprehensible to readers new to your problem. (It is
also not uncommon to discover what a problem actually is in the process of
reducing it to an illustrative version.)


USE INFORMATIVE SUBJECT LINES

When posting to the XSL-List, do not use uninformative subject lines like
&quot;Urgent&quot;, &quot;Question&quot;, or &quot;Newbie HELP!!!&quot;, which don't say anything about what
your problem is. Instead, use a meaningful subject line that will make sense
to the people whose help you are trying to get. It may even get a response
from people who normally shy away from &quot;beginner&quot; questions.

Informative subject lines make the XSL-List archive more useful since people
with the same problem will more easily find the relevant threads.


DO NOT CROSS-POST

Cross-posting to the XSL-List and to another list, even XML-Dev or the
DSSSList, is generally counter-productive. No list's archive will contain the
complete thread; cross-posts from non-subscribers continuing the thread will
bounce; and XSL-List subscribers who are not also on the other list will only
see half the thread, as will those on the other list who are not also reading
XSL- List. Subscribers to both lists may see two copies of the message,
annoying them as well.


REPLIES GO TO THE LIST

The reply address of XSL-List messages (and of digests) is
xsl-list@xxxxxxxxxxxxxxxxxxxxxx so REPLIES GO TO THE LIST BY DEFAULT. If you
want to reply to just the author of a post, you should change the &quot;To:&quot; field
in your reply.


USE SHORT QUOTES OF PREVIOUS MESSAGES IN REPLIES

Please do not quote entire messages just to add a few lines at the beginning
or end. Instead, quote the parts to which you are directly replying or quote
enough to establish the context.

Everybody on the list has already received the message that you are quoting,
and anyone searching the archive will find your message and the previous
message listed under the same thread.

Subscribers to the XSL-List will just ignore most of the quoted messages and
move to the next post, but subscribers to the XSL-List Digest will mostly have
to page past the quoted messages to reach the next material in which they are
interested in reading.


POSTINGS MUST BE IN PLAIN TEXT ONLY

Postings to XSL-List must be in plain text only. The XSL-List does not allow
HTML postings because many users cannot display them appropriately, and
because
they are unnecessarily large.


POSTINGS MAY NOT BE IN BASE 64

Postings to XSL-List may not be in Base 64 because it makes a mess of both the
digest and the archive.


ATTACHMENTS ARE BANNED

Since Mulberry's mailing lists have in the past been unwittingly used for
spreading viruses in e-mail attachments, all e-mail attachments are banned
from the XSL-List.

XSL stylesheets are XML files, and XML files are text files, so this does not
affect the majority of posts to the list since you can include the files' text
in the body of your message. If you need to refer to a binary file such as a
PDF file, you should put the file on a Web site or FTP site and include the
file's URL in your XSL-List post.

If you do include an attachment in your XSL-List post -- even a HTML
attachment -- your message will bounce.


YOUR POST WILL BE PERMANENTLY ARCHIVED

Because it is a public resource created by and for the entire XSL
community, we do not edit XSL-List. Therefore, it is responsibility of
list subscribers not to post anything to the list that they do not want
publicly available, possibly for a very long time.

Postings in the list archives will be complete, including: all contents,
examples, sample data, code or code fragments, and email header and footer
contents. An automated process will obscure the domain portion of email
addresses (the part after the @ sign).in the headers and footers of postings,
but no guarnantee is made that this process will be completely successfull.
Other than this, all postings will be archived in public as received.

Further, we at Mulberry could not, even if we wanted to, edit all of the
archives of XSL-List. Several third-parties have created unofficial archives
of
XSL-List, often without asking, or even informing, Mulberry. Postings to
XSL-List
will be included in an unknown and ever-changing variety of web publications.
If
you don't want your questions/comments/answers in public view don't post them
to
XSL-List.


THIRD-PARTY ARCHIVES OF XSL-LIST

Third parties are welcome to create searchable or reference archives of
XSL-List
provided they adhere to the following guidelines:
- the material is clearly labelled as being from XSL-List, with
 an acknowledgement of Mulberry's role as provider of XSL-List
- there is a navigable pointer to the official list page at
 http://www.mulberrytech.com/xsl/xsl-list/ either on every posting
 or associated with the user interface such that it is visible with
 the postings
- list postings are unedited
- either the entire archive of the list is provided or there is a
 clearly stated method for selecting the subset of the list that is provided

Mulberry does not provide these third parties with help to create these
archives, does not endorse particular third party archives, and has no control
over the ways in which they present the material in their systems.

People or organizations that publish the contents of XSL-List without
following
the guidelines above are being very antisocial. Please bookmark either
the official XSL-List archive or one provided by a service that plays nicely
in the community and shun those who do not give credit where credit it due.


UNSUBSCRIBING FROM THE XSL-LIST

To unsubscribe from XSL-List, use the form at
http://www.mulberrytech.com/xsl/xsl-list/subscribe-unsubscribe.html. If you
have difficulties unsubscribing from the list:
 - make sure you are unsubscribing EXACTLY the email address that is
   subscribed
 - if you receive only one message a day from the list be sure to
   check the box marked &quot;Select for the Digest version of the list&quot;
   (if you subscribe to the digest and don't check this box the system
   will try to unsubscribe you from the regular list and fail; it will
   only unsubscribe you from the digest if you check this box.)

UNSUBSCRIBING FROM THE XSL-LIST DIGEST

To unsubscribe from the XSL-List digest, use the form at
http://www.mulberrytech.com/xsl/xsl-list/subscribe-unsubscribe.html and
check the box marked &quot;Select for the Digest version of the list&quot;.


IF YOU STOP GETTING XSL-LIST MESSAGES

If you stop receiving XSL-List message, you may have been removed because mail
to you was bouncing. You are not being picked on, and you can just rejoin the
list.


ARCHIVE

XSL-List messages are archived at
http://www.biglist.com/lists/xsl-list/archives/.


REPORTING BUGS IN SOFTWARE

Bugs in software should firstly be reported to its author rather than to the
XSL List. Questions regarding how to work around bugs are welcome, but the
list does not function as a bug-tracking system for any software.


XSL FAQ AND OTHER INFORMATION ON XSL

Dave Pawson's XSL FAQ is at http://www.dpawson.co.uk/xsl/index.html.

The W3C information on XSL is at http://www.w3.org/Style/XSL.

Mulberry's Quick References are at http://www.mulberrytech.com/quickref/ and
cover XSLT, XPath, and XQuery.


DSSSLIST -- THE DSSSL USERS' MAILING LIST

Mulberry Technologies, Inc., also provides the DSSSList -- the DSSSL Users'
Mailing List. For subscription information and the DSSSList archive, see
http://www.mulberrytech.com/dsssl/dssslist.


CONTACT

If you have any questions or problems, please contact
xsl-list-owner@xxxxxxxxxxxxxxxxxxxxxxx


ADMINISTRATIVE COMMUNICATIONS

The list administrator will reply to emailed questions relating to the
mechanics and administration of XSL-List and to help new users learn to use
the list. However, the administrator will not take the time to navigate mazes
of any sort in order to do so. If the list owner's messages are rejected by a
user's anti-spam system the list owner will not pursue the matter. Similarly,
if list-related notices to a subscriber are rejected as spam the subscriber
will be unsubscribed.



CHANGE History

==============
December 26, 2011 - btu.

11. Clarified instructions on unsubscribing from the digest version
    of the list.

==============
May 5, 2009 - btu.

10. Added paragraph clarifying that all content will be archived in
    public, including text, examples, code, and email headers and
    footers including names.

==============
February 1, 2008 - btu.

9. Policy on third-party archives added.

8. Policy banning attachments and postings in Base 64 clarified.

==============
September 1, 2007 - btu.

7. Administrative communication policy clarified.


==============
October 1, 2005 - btu.

6. Mulberry Technologies' relationship to XSL-List clarified. We
   do the work. We pay the bills. Organizations who post unauthorized
   copies of the archive without acknowledging Mulberry's contribution
   are not playing nicely in the community.

==============
March 2, 2005 - btu.

4. Users are asked to identify the version of XSLT and XPath
   they are using for questions that are specific to one version

5. Clarifying the policy on editing the list archive (we don't edit
   it).

==============
March 30, 2004 - btu.

1. All references to subscribing and unsubscribing have been
   updated to reflect changes in the list management system.

2. Pointers to the XSL and XPath specification were removed. There
   are now so many specifications and draft specifications relevant
   to XSL that it is more practical to simply point to W3C's XSL
   page.

3. A few typographical errors were corrected.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post20080.html</link><pubDate>Mon, 29 Apr 2013 16:45:37 GMT</pubDate></item><item><title> XSL-List Guidelines</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>This information is posted to the XSL-List (and the XSL-List Digest)
at intervals under the subject line &quot;XSL-List guidelines&quot;.

INTRODUCTION TO XSL-LIST

XSL-List hosts discussion of XSL itself, XSL applications and implementation,
and XSL user questions. XSL-List is open to everyone, users and developers,
experts and novices alike. There is no restriction to what may be posted on
the XSL-List provided it is related to XSL, which is considered to include
XSLT (versions 1 and 2), XPath (versions 1 and 2) and XSL Formatting Objects
(FO).

XSL-List is not a W3C mailing list, and has no affiliation with W3C (or any
official standing with any standards organization). However, XSL-List was
established with the encouragement of members of the W3C XSL Working Group,
and members of the Working Group are among the subscribers to the list.

Only subscribers can post to XSL-List, but since the goal is to increase the
level of XSL knowledge, XSL-List is being archived for everybody to view. The
topics being discussed on the XSL-List change as new ideas arise or existing
problems are dealt with, but the archive contains all of the ideas and
solutions that have been discussed on the list.

XSL-List is provided by Mulberry Technologies, Inc., as a service to the XSL
user community. Mulberry is an XML and SGML consultancy specializing in
applications that have a text design, processing, interchange, or display
component. For more information about Mulberry Technologies, Inc. see
http://www.mulberrytech.com


SUBSCRIBING TO THE XSL-LIST

To subscribe to the list, fill out the form at
http://www.mulberrytech.com/xsl/xsl-list/subscribe-unsubscribe.html.


DAILY DIGEST

Daily digests -- copies of a whole days XSL-List messages sent as one email
message -- are available. Not only is it a single email message containing all
of that day's XSL-List messages, it is also half the size, on average, of the
individual messages since it doesn't include the overhead of the mail headers
from each message.

To unsubscribe from the list and subscribe to the digest, use the form at
http://www.mulberrytech.com/xsl/xsl-list/subscribe-unsubscribe.html.


POSTING GUIDELINES

Only subscribers can post to XSL-List, and only from the exact address they
used when they subscribed.

There is no restriction on what may be posted to the XSL-List provided it is
related to XSL. Items concerning XML but without a direct connection to XSL
should be posted to a XML-related list instead of to the XSL-List. Items
related to DSSSL should be posted to the DSSSList.

Do not begin your subject line with &quot;help&quot; or &quot;subscribe&quot; since the list
software will bounce the message because it looks like is an administrative
request.

It is best to start a new message for a new thread. Do not start a new thread
by replying to an unrelated message and just changing the subject line, since
the header of your message will contain references to the previous message and
your new message will appear in the archive as one of the replies to the
original message.

Both subscribers to the full list (xsl-list@xxxxxxxxxxxxxxxxxxxxxx) and
subscribers to the digest (xsl-list-digest@xxxxxxxxxxxxxxxxxxxxxx) should post
their messages to xsl- list@xxxxxxxxxxxxxxxxxxxxxx; the messages will be
received by both subscribers to the list and subscribers to the digest.


BEFORE YOU POST ... DO YOUR HOMEWORK
- Check that your question isn't already answered in the XSL FAQ at
http://www.dpawson.co.uk/.
- Check that your question isn't already answered in the XSL-List archives at
http://www.biglist.com/lists/xsl-list/archives/.
- If you are asking for help with XSL code, determine which version of the
language you are using (plus extensions, if any), and confirm that your XSL
processor supports that version and/or extension. (If you are unsure of your
processor, this can be determined by using the stylesheet at
http://www.mulberrytech.com/xsl/xsl-list/processor-version.xsl on any input,
including the stylesheet itself: see
http://www.mulberrytech.com/xsl/xsl-list/processor-version.html for more
information.) An XSLT 1.0 engine will not process stylesheets written in XSLT
2.0!


IN YOUR POSTING ...

Name the XSL processor, processor version, and version of the language you are
using. This information is frequently necessary to diagnose a problem exactly,
and always helps respondents give good advice.

If you are replying to a post, trim the quoted message to just the parts to
which you are replying.

In addition to following simple rules of net etiquette and common sense, you
will improve the chances that you will receive prompt and helpful responses
by:
- Asking questions specific enough that answers are possible. Describe what
you are trying to do, how you approached it, what happened, and why you don't
like the result you got. Don't simply say &quot;it gave me an error&quot;: paste in the
error message (someone else can probably make sense of it).
-  Illustrating your question with a demonstration of the problem.
Well-composed questions frequently include a small XML sample, an XSLT
stylesheet, the results received, and the result that was desired - all in
miniature, to make it comprehensible to readers new to your problem. (It is
also not uncommon to discover what a problem actually is in the process of
reducing it to an illustrative version.)


USE INFORMATIVE SUBJECT LINES

When posting to the XSL-List, do not use uninformative subject lines like
&quot;Urgent&quot;, &quot;Question&quot;, or &quot;Newbie HELP!!!&quot;, which don't say anything about what
your problem is. Instead, use a meaningful subject line that will make sense
to the people whose help you are trying to get. It may even get a response
from people who normally shy away from &quot;beginner&quot; questions.

Informative subject lines make the XSL-List archive more useful since people
with the same problem will more easily find the relevant threads.


DO NOT CROSS-POST

Cross-posting to the XSL-List and to another list, even XML-Dev or the
DSSSList, is generally counter-productive. No list's archive will contain the
complete thread; cross-posts from non-subscribers continuing the thread will
bounce; and XSL-List subscribers who are not also on the other list will only
see half the thread, as will those on the other list who are not also reading
XSL- List. Subscribers to both lists may see two copies of the message,
annoying them as well.


REPLIES GO TO THE LIST

The reply address of XSL-List messages (and of digests) is
xsl-list@xxxxxxxxxxxxxxxxxxxxxx so REPLIES GO TO THE LIST BY DEFAULT. If you
want to reply to just the author of a post, you should change the &quot;To:&quot; field
in your reply.


USE SHORT QUOTES OF PREVIOUS MESSAGES IN REPLIES

Please do not quote entire messages just to add a few lines at the beginning
or end. Instead, quote the parts to which you are directly replying or quote
enough to establish the context.

Everybody on the list has already received the message that you are quoting,
and anyone searching the archive will find your message and the previous
message listed under the same thread.

Subscribers to the XSL-List will just ignore most of the quoted messages and
move to the next post, but subscribers to the XSL-List Digest will mostly have
to page past the quoted messages to reach the next material in which they are
interested in reading.


POSTINGS MUST BE IN PLAIN TEXT ONLY

Postings to XSL-List must be in plain text only. The XSL-List does not allow
HTML postings because many users cannot display them appropriately, and
because
they are unnecessarily large.


POSTINGS MAY NOT BE IN BASE 64

Postings to XSL-List may not be in Base 64 because it makes a mess of both the
digest and the archive.


ATTACHMENTS ARE BANNED

Since Mulberry's mailing lists have in the past been unwittingly used for
spreading viruses in e-mail attachments, all e-mail attachments are banned
from the XSL-List.

XSL stylesheets are XML files, and XML files are text files, so this does not
affect the majority of posts to the list since you can include the files' text
in the body of your message. If you need to refer to a binary file such as a
PDF file, you should put the file on a Web site or FTP site and include the
file's URL in your XSL-List post.

If you do include an attachment in your XSL-List post -- even a HTML
attachment -- your message will bounce.


YOUR POST WILL BE PERMANENTLY ARCHIVED

Because it is a public resource created by and for the entire XSL
community, we do not edit XSL-List. Therefore, it is responsibility of
list subscribers not to post anything to the list that they do not want
publicly available, possibly for a very long time.

Postings in the list archives will be complete, including: all contents,
examples, sample data, code or code fragments, and email header and footer
contents. An automated process will obscure the domain portion of email
addresses (the part after the @ sign).in the headers and footers of postings,
but no guarnantee is made that this process will be completely successfull.
Other than this, all postings will be archived in public as received.

Further, we at Mulberry could not, even if we wanted to, edit all of the
archives of XSL-List. Several third-parties have created unofficial archives
of
XSL-List, often without asking, or even informing, Mulberry. Postings to
XSL-List
will be included in an unknown and ever-changing variety of web publications.
If
you don't want your questions/comments/answers in public view don't post them
to
XSL-List.


THIRD-PARTY ARCHIVES OF XSL-LIST

Third parties are welcome to create searchable or reference archives of
XSL-List
provided they adhere to the following guidelines:
- the material is clearly labelled as being from XSL-List, with
 an acknowledgement of Mulberry's role as provider of XSL-List
- there is a navigable pointer to the official list page at
 http://www.mulberrytech.com/xsl/xsl-list/ either on every posting
 or associated with the user interface such that it is visible with
 the postings
- list postings are unedited
- either the entire archive of the list is provided or there is a
 clearly stated method for selecting the subset of the list that is provided

Mulberry does not provide these third parties with help to create these
archives, does not endorse particular third party archives, and has no control
over the ways in which they present the material in their systems.

People or organizations that publish the contents of XSL-List without
following
the guidelines above are being very antisocial. Please bookmark either
the official XSL-List archive or one provided by a service that plays nicely
in the community and shun those who do not give credit where credit it due.


UNSUBSCRIBING FROM THE XSL-LIST

To unsubscribe from XSL-List, use the form at
http://www.mulberrytech.com/xsl/xsl-list/subscribe-unsubscribe.html. If you
have difficulties unsubscribing from the list:
 - make sure you are unsubscribing EXACTLY the email address that is
   subscribed
 - if you receive only one message a day from the list be sure to
   check the box marked &quot;Select for the Digest version of the list&quot;
   (if you subscribe to the digest and don't check this box the system
   will try to unsubscribe you from the regular list and fail; it will
   only unsubscribe you from the digest if you check this box.)

UNSUBSCRIBING FROM THE XSL-LIST DIGEST

To unsubscribe from the XSL-List digest, use the form at
http://www.mulberrytech.com/xsl/xsl-list/subscribe-unsubscribe.html and
check the box marked &quot;Select for the Digest version of the list&quot;.


IF YOU STOP GETTING XSL-LIST MESSAGES

If you stop receiving XSL-List message, you may have been removed because mail
to you was bouncing. You are not being picked on, and you can just rejoin the
list.


ARCHIVE

XSL-List messages are archived at
http://www.biglist.com/lists/xsl-list/archives/.


REPORTING BUGS IN SOFTWARE

Bugs in software should firstly be reported to its author rather than to the
XSL List. Questions regarding how to work around bugs are welcome, but the
list does not function as a bug-tracking system for any software.


XSL FAQ AND OTHER INFORMATION ON XSL

Dave Pawson's XSL FAQ is at http://www.dpawson.co.uk/xsl/index.html.

The W3C information on XSL is at http://www.w3.org/Style/XSL.

Mulberry's Quick References are at http://www.mulberrytech.com/quickref/ and
cover XSLT, XPath, and XQuery.


DSSSLIST -- THE DSSSL USERS' MAILING LIST

Mulberry Technologies, Inc., also provides the DSSSList -- the DSSSL Users'
Mailing List. For subscription information and the DSSSList archive, see
http://www.mulberrytech.com/dsssl/dssslist.


CONTACT

If you have any questions or problems, please contact
xsl-list-owner@xxxxxxxxxxxxxxxxxxxxxxx


ADMINISTRATIVE COMMUNICATIONS

The list administrator will reply to emailed questions relating to the
mechanics and administration of XSL-List and to help new users learn to use
the list. However, the administrator will not take the time to navigate mazes
of any sort in order to do so. If the list owner's messages are rejected by a
user's anti-spam system the list owner will not pursue the matter. Similarly,
if list-related notices to a subscriber are rejected as spam the subscriber
will be unsubscribed.



CHANGE History

==============
December 26, 2011 - btu.

11. Clarified instructions on unsubscribing from the digest version
    of the list.

==============
May 5, 2009 - btu.

10. Added paragraph clarifying that all content will be archived in
    public, including text, examples, code, and email headers and
    footers including names.

==============
February 1, 2008 - btu.

9. Policy on third-party archives added.

8. Policy banning attachments and postings in Base 64 clarified.

==============
September 1, 2007 - btu.

7. Administrative communication policy clarified.


==============
October 1, 2005 - btu.

6. Mulberry Technologies' relationship to XSL-List clarified. We
   do the work. We pay the bills. Organizations who post unauthorized
   copies of the archive without acknowledging Mulberry's contribution
   are not playing nicely in the community.

==============
March 2, 2005 - btu.

4. Users are asked to identify the version of XSLT and XPath
   they are using for questions that are specific to one version

5. Clarifying the policy on editing the list archive (we don't edit
   it).

==============
March 30, 2004 - btu.

1. All references to subscribing and unsubscribing have been
   updated to reflect changes in the list management system.

2. Pointers to the XSL and XPath specification were removed. There
   are now so many specifications and draft specifications relevant
   to XSL that it is more practical to simply point to W3C's XSL
   page.

3. A few typographical errors were corrected.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post20080.html?utm_source=feedly</link><pubDate>Mon, 29 Apr 2013 16:45:37 GMT</pubDate></item><item><title>Re:  How to make auto row-spanned table</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>Dear Mr. Holman,</tt><br>
<br>
<tt>Thank you for your detailed and excellent reply.<br>
I was very excited seeing your XSLT stylesheet. It is actually working!<br>
Because authoring tables without @morerows attribute and applying 
row-span after in XSLT stylesheet step is my idea to express some kind 
of information set in DITA.<br>
Many of DITA user does not adopt this method. Rather they choose to 
express this kind of information set by dl/dt,dd (definition lists) 
elements. But it is not acceptable for me.</tt><br>
<br>
<tt>I will propose to my DITA customer that this method is effective.</tt><br>
<br>
<tt>Best regards,</tt><br>
<br>
<tt>Toshihiko Makita</tt><br>
<br>
<tt>(2013/04/25 14:10), xsl-list-digest-help@xxxxxxxxxxxxxxxxxxxxxx wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>------------------------------ 
</tt></blockquote><tt>Date: Wed, 24 Apr 2013 13:56:29 -0400 To: XSL List 
&lt;xsl-list@xxxxxxxxxxxxxxxxxxxxxx&gt;<br>
From: &quot;G. Ken Holman&quot; &lt;gkholman@xxxxxxxxxxxxxxxxxxxx&gt;<br>
Subject: Re:  How to make auto row-spanned table<br>
Message-Id: &lt;7.0.1.0.2.20130424132039.0245b5a0@xxxxxxxxxxxxxxxxxxxx&gt; At 
2013-04-24 12:40 -0400, I wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>At 2013-04-25 01:29 +0900, Toshihiko Makita wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>I'm making a stylesheet that converts DITA documents to XSL-FO.
</tt></blockquote></blockquote><pre style="margin: 0em;">Actually, the answer is a *lot* simpler than I thought because I
misread your request to convert DITA to DITA and because you made
reference to a morerows attribute.  The principle is the same, but in
XSL-FO one can take advantage of the cell-based row-grouping
approach.  I even have an example of this as an exercise in my
training class in the module on sorting and grouping.  Most of my
students have never heard of filling an XSL-FO table with only cell
elements and not row elements, so the exercise is meant to help
remember the technique.</pre><br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">Usually a table is authored with entry/@morerows attribute. But
some table has no @morerows attribute.
</pre></blockquote></blockquote><pre style="margin: 0em;">In XSL-FO it is acceptable to say number-rows-spanned=&quot;1&quot; when there
is no spanning.  I don't know if it is allowed to say morerows=&quot;0&quot; in DITA.</pre><br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">It would help us help you to have the XML input data of your table
example.  You can post it as clear text in your message and we can
cut it out and create a file from it.
</pre></blockquote><pre style="margin: 0em;">I mocked up a test file that mimics your data and produces an
acceptable XSL-FO result using a simplified stylesheet.  Note the use
of the ends-row=&quot;true/false&quot; attribute and that there are no
&lt;table-row&gt; elements.  The output test.fo can be formatted with an
XSL-FO engine to produce a result with the rows you need.</pre><br>
<pre style="margin: 0em;">t:\ftemp&gt;type test.xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;table&gt;
    &lt;tgroup&gt;
      &lt;tbody&gt;
        &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;B&lt;/entry&gt;&lt;entry&gt;C&lt;/entry&gt;&lt;entry&gt;D&lt;/entry&gt;&lt;entry&gt;E&lt;/entry&gt;&lt;entry&gt;F&lt;/entry&gt;&lt;/row&gt;
        &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;G&lt;/entry&gt;&lt;entry&gt;H&lt;/entry&gt;&lt;entry&gt;I&lt;/entry&gt;&lt;entry&gt;J&lt;/entry&gt;&lt;entry&gt;K&lt;/entry&gt;&lt;/row&gt;
        &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;G&lt;/entry&gt;&lt;entry&gt;H&lt;/entry&gt;&lt;entry&gt;L&lt;/entry&gt;&lt;entry&gt;M&lt;/entry&gt;&lt;entry&gt;N&lt;/entry&gt;&lt;/row&gt;
        &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;G&lt;/entry&gt;&lt;entry&gt;O&lt;/entry&gt;&lt;entry&gt;P&lt;/entry&gt;&lt;entry&gt;M&lt;/entry&gt;&lt;entry&gt;Q&lt;/entry&gt;&lt;/row&gt;
        &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;G&lt;/entry&gt;&lt;entry&gt;R&lt;/entry&gt;&lt;entry&gt;S&lt;/entry&gt;&lt;entry&gt;T&lt;/entry&gt;&lt;entry&gt;Q&lt;/entry&gt;&lt;/row&gt;
        &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;G&lt;/entry&gt;&lt;entry&gt;V&lt;/entry&gt;&lt;entry&gt;S&lt;/entry&gt;&lt;entry&gt;W&lt;/entry&gt;&lt;entry&gt;X&lt;/entry&gt;&lt;/row&gt;
        &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;Y&lt;/entry&gt;&lt;entry&gt;Z&lt;/entry&gt;&lt;entry&gt;1&lt;/entry&gt;&lt;entry&gt;2&lt;/entry&gt;&lt;entry&gt;3&lt;/entry&gt;&lt;/row&gt;
        &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;Y&lt;/entry&gt;&lt;entry&gt;4&lt;/entry&gt;&lt;entry&gt;1&lt;/entry&gt;&lt;entry&gt;5&lt;/entry&gt;&lt;entry&gt;6&lt;/entry&gt;&lt;/row&gt;
        &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;Y&lt;/entry&gt;&lt;entry&gt;7&lt;/entry&gt;&lt;entry&gt;1&lt;/entry&gt;&lt;entry&gt;5&lt;/entry&gt;&lt;entry&gt;8&lt;/entry&gt;&lt;/row&gt;
      &lt;/tbody&gt;
    &lt;/tgroup&gt;
&lt;/table&gt;</pre><br>
<tt>t:\ftemp&gt;call xslt2 test.xml testfo.xsl test.fo</tt><br>
<br>
<pre style="margin: 0em;">t:\ftemp&gt;type testfo.xsl
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;root xmlns=&quot;http://www.w3.org/1999/XSL/Format&quot;
        font-family=&quot;Times&quot; font-size=&quot;20pt&quot;
        xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
        xsl:version=&quot;2.0&quot;&gt;</pre><br>
<pre style="margin: 0em;">    &lt;layout-master-set&gt;
      &lt;simple-page-master master-name=&quot;frame&quot;
                          page-height=&quot;11in&quot; page-width=&quot;8.5in&quot;
                          margin-top=&quot;.5in&quot; margin-bottom=&quot;.5in&quot;
                          margin-left=&quot;.5in&quot; margin-right=&quot;.5in&quot;&gt;
        &lt;region-body region-name=&quot;frame-body&quot;/&gt;
      &lt;/simple-page-master&gt;
    &lt;/layout-master-set&gt;</pre><br>
<pre style="margin: 0em;">    &lt;page-sequence master-reference=&quot;frame&quot;&gt;
      &lt;flow flow-name=&quot;frame-body&quot;&gt;
        &lt;block&gt;This is a test of spanning rows in XSL-FO&lt;/block&gt;</pre><br>
<pre style="margin: 0em;">&lt;table text-align=&quot;center&quot;&gt;
    &lt;table-body&gt;
      &lt;xsl:for-each select=&quot;table/tgroup/tbody&quot;&gt;
      &lt;!--create a stream of table cells, marking the end of each row--&gt;
        &lt;!--only the first three columns of the table are grouped--&gt;
        &lt;xsl:for-each-group select=&quot;row&quot; group-by=&quot;entry[1]&quot;&gt;
          &lt;table-cell number-rows-spanned=&quot;{count(current-group())[.&gt;1]}&quot;&gt;
            &lt;block&gt;
              &lt;xsl:apply-templates select=&quot;entry[1]/node()&quot;/&gt;
            &lt;/block&gt;
          &lt;/table-cell&gt;
          &lt;xsl:for-each-group select=&quot;current-group()&quot; group-by=&quot;entry[2]&quot;&gt;
            &lt;table-cell number-rows-spanned=&quot;{count(current-group())[.&gt;1]}&quot;&gt;
              &lt;block&gt;
                &lt;xsl:apply-templates select=&quot;entry[2]/node()&quot;/&gt;
              &lt;/block&gt;
            &lt;/table-cell&gt;
            &lt;xsl:for-each-group select=&quot;current-group()&quot; group-by=&quot;entry[3]&quot;&gt;
              &lt;table-cell number-rows-spanned=&quot;{count(current-group())[.&gt;1]}&quot;&gt;
                &lt;block&gt;
                  &lt;xsl:apply-templates select=&quot;entry[3]/node()&quot;/&gt;
                &lt;/block&gt;
              &lt;/table-cell&gt;
              &lt;!--the rest of the columns are not grouped--&gt;
              &lt;xsl:for-each select=&quot;current-group()&quot;&gt;
                &lt;xsl:for-each select=&quot;entry[position()&gt;3]&quot;&gt;
                  &lt;!--mark the last cell of each row as true, others as false--&gt;
                  &lt;table-cell ends-row=&quot;{position()=last()}&quot;&gt;
                   &lt;block&gt;
                     &lt;xsl:apply-templates/&gt;
                   &lt;/block&gt;
                  &lt;/table-cell&gt;
                &lt;/xsl:for-each&gt;
              &lt;/xsl:for-each&gt;
            &lt;/xsl:for-each-group&gt;
          &lt;/xsl:for-each-group&gt;
        &lt;/xsl:for-each-group&gt;
      &lt;/xsl:for-each&gt;
    &lt;/table-body&gt;
&lt;/table&gt;</pre><br>
<pre style="margin: 0em;">      &lt;/flow&gt;
    &lt;/page-sequence&gt;
&lt;/root&gt;</pre><br>
<tt>t:\ftemp&gt;rem Done!</tt><br>
<br>
<pre style="margin: 0em;">Since I had already written a DITA -&gt; DITA stylesheet adding
morerows= before discovering I misread your question, I've added
below a stylesheet that does that with the same input data:</pre><br>
<pre style="margin: 0em;">t:\ftemp&gt;type test.xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;table&gt;
    &lt;tgroup&gt;
      &lt;tbody&gt;
        &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;B&lt;/entry&gt;&lt;entry&gt;C&lt;/entry&gt;&lt;entry&gt;D&lt;/entry&gt;&lt;entry&gt;E&lt;/entry&gt;&lt;entry&gt;F&lt;/entry&gt;&lt;/row&gt;
        &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;G&lt;/entry&gt;&lt;entry&gt;H&lt;/entry&gt;&lt;entry&gt;I&lt;/entry&gt;&lt;entry&gt;J&lt;/entry&gt;&lt;entry&gt;K&lt;/entry&gt;&lt;/row&gt;
        &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;G&lt;/entry&gt;&lt;entry&gt;H&lt;/entry&gt;&lt;entry&gt;L&lt;/entry&gt;&lt;entry&gt;M&lt;/entry&gt;&lt;entry&gt;N&lt;/entry&gt;&lt;/row&gt;
        &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;G&lt;/entry&gt;&lt;entry&gt;O&lt;/entry&gt;&lt;entry&gt;P&lt;/entry&gt;&lt;entry&gt;M&lt;/entry&gt;&lt;entry&gt;Q&lt;/entry&gt;&lt;/row&gt;
        &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;G&lt;/entry&gt;&lt;entry&gt;R&lt;/entry&gt;&lt;entry&gt;S&lt;/entry&gt;&lt;entry&gt;T&lt;/entry&gt;&lt;entry&gt;Q&lt;/entry&gt;&lt;/row&gt;
        &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;G&lt;/entry&gt;&lt;entry&gt;V&lt;/entry&gt;&lt;entry&gt;S&lt;/entry&gt;&lt;entry&gt;W&lt;/entry&gt;&lt;entry&gt;X&lt;/entry&gt;&lt;/row&gt;
        &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;Y&lt;/entry&gt;&lt;entry&gt;Z&lt;/entry&gt;&lt;entry&gt;1&lt;/entry&gt;&lt;entry&gt;2&lt;/entry&gt;&lt;entry&gt;3&lt;/entry&gt;&lt;/row&gt;
        &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;Y&lt;/entry&gt;&lt;entry&gt;4&lt;/entry&gt;&lt;entry&gt;1&lt;/entry&gt;&lt;entry&gt;5&lt;/entry&gt;&lt;entry&gt;6&lt;/entry&gt;&lt;/row&gt;
        &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;Y&lt;/entry&gt;&lt;entry&gt;7&lt;/entry&gt;&lt;entry&gt;1&lt;/entry&gt;&lt;entry&gt;5&lt;/entry&gt;&lt;entry&gt;8&lt;/entry&gt;&lt;/row&gt;
      &lt;/tbody&gt;
    &lt;/tgroup&gt;
&lt;/table&gt;</pre><br>
<tt>t:\ftemp&gt;call xslt2 test.xml testdita.xsl test.out.xml</tt><br>
<br>
<pre style="margin: 0em;">t:\ftemp&gt;type test.out.xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;table&gt;
    &lt;tgroup&gt;
      &lt;tbody&gt;
&lt;row&gt;&lt;entry
morerows=&quot;8&quot;&gt;A&lt;/entry&gt;&lt;entry&gt;B&lt;/entry&gt;&lt;entry&gt;C&lt;/entry&gt;&lt;entry&gt;D&lt;/entry&gt;&lt;entry&gt;E&lt;/entry&gt;&lt;entry&gt;F&lt;/entry&gt;&lt;/row&gt;
&lt;row&gt;&lt;entry morerows=&quot;4&quot;&gt;G&lt;/entry&gt;&lt;entry
morerows=&quot;1&quot;&gt;H&lt;/entry&gt;&lt;entry&gt;I&lt;/entry&gt;&lt;entry&gt;J&lt;/entry&gt;&lt;entry&gt;K&lt;/entry&gt;&lt;/row&gt;
&lt;row&gt;&lt;entry&gt;L&lt;/entry&gt;&lt;entry&gt;M&lt;/entry&gt;&lt;entry&gt;N&lt;/entry&gt;&lt;/row&gt;
&lt;row&gt;&lt;entry&gt;O&lt;/entry&gt;&lt;entry&gt;P&lt;/entry&gt;&lt;entry&gt;M&lt;/entry&gt;&lt;entry&gt;Q&lt;/entry&gt;&lt;/row&gt;
&lt;row&gt;&lt;entry&gt;R&lt;/entry&gt;&lt;entry&gt;S&lt;/entry&gt;&lt;entry&gt;T&lt;/entry&gt;&lt;entry&gt;Q&lt;/entry&gt;&lt;/row&gt;
&lt;row&gt;&lt;entry&gt;V&lt;/entry&gt;&lt;entry&gt;S&lt;/entry&gt;&lt;entry&gt;W&lt;/entry&gt;&lt;entry&gt;X&lt;/entry&gt;&lt;/row&gt;
&lt;row&gt;&lt;entry
morerows=&quot;2&quot;&gt;Y&lt;/entry&gt;&lt;entry&gt;Z&lt;/entry&gt;&lt;entry&gt;1&lt;/entry&gt;&lt;entry&gt;2&lt;/entry&gt;&lt;entry&gt;3&lt;/entry&gt;&lt;/row&gt;
&lt;row&gt;&lt;entry&gt;4&lt;/entry&gt;&lt;entry&gt;1&lt;/entry&gt;&lt;entry&gt;5&lt;/entry&gt;&lt;entry&gt;6&lt;/entry&gt;&lt;/row&gt;
&lt;row&gt;&lt;entry&gt;7&lt;/entry&gt;&lt;entry&gt;1&lt;/entry&gt;&lt;entry&gt;5&lt;/entry&gt;&lt;entry&gt;8&lt;/entry&gt;&lt;/row&gt;&lt;/tbody&gt;
    &lt;/tgroup&gt;
&lt;/table&gt;
t:\ftemp&gt;type testdita.xsl
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
    version=&quot;2.0&quot;&gt;</pre><br>
<pre style="margin: 0em;">&lt;xsl:template match=&quot;tbody&quot;&gt;
    &lt;xsl:copy&gt;
      &lt;xsl:apply-templates select=&quot;@*&quot;/&gt;
      &lt;!--create a stream of entries, marking the end of each row--&gt;
      &lt;xsl:variable name=&quot;stream-entries&quot; as=&quot;element()*&quot;&gt;
        &lt;!--only the first three columns of the table are grouped--&gt;
        &lt;xsl:for-each-group select=&quot;row&quot; group-by=&quot;entry[1]&quot;&gt;
          &lt;entry&gt;
            &lt;xsl:copy-of select=&quot;entry[1]/@*&quot;/&gt;
            &lt;xsl:for-each select=&quot;count(current-group())[.&gt;1]&quot;&gt;
              &lt;xsl:attribute name=&quot;morerows&quot; select=&quot;.-1&quot;/&gt;
            &lt;/xsl:for-each&gt;
            &lt;xsl:copy-of select=&quot;entry[1]/node()&quot;/&gt;
          &lt;/entry&gt;
          &lt;xsl:for-each-group select=&quot;current-group()&quot; group-by=&quot;entry[2]&quot;&gt;
            &lt;entry&gt;
              &lt;xsl:copy-of select=&quot;entry[2]/@*&quot;/&gt;
              &lt;xsl:for-each select=&quot;count(current-group())[.&gt;1]&quot;&gt;
                &lt;xsl:attribute name=&quot;morerows&quot; select=&quot;.-1&quot;/&gt;
              &lt;/xsl:for-each&gt;
              &lt;xsl:copy-of select=&quot;entry[2]/node()&quot;/&gt;
            &lt;/entry&gt;
            &lt;xsl:for-each-group select=&quot;current-group()&quot; group-by=&quot;entry[3]&quot;&gt;
              &lt;entry&gt;
                &lt;xsl:copy-of select=&quot;entry[3]/@*&quot;/&gt;
                &lt;xsl:for-each select=&quot;count(current-group())[.&gt;1]&quot;&gt;
                  &lt;xsl:attribute name=&quot;morerows&quot; select=&quot;.-1&quot;/&gt;
                &lt;/xsl:for-each&gt;
                &lt;xsl:copy-of select=&quot;entry[3]/node()&quot;/&gt;
              &lt;/entry&gt;
              &lt;!--the rest of the columns are not grouped--&gt;
              &lt;xsl:for-each select=&quot;current-group()&quot;&gt;
                &lt;xsl:copy-of select=&quot;entry[position()&gt;3]&quot;/&gt;
                &lt;!--mark the end of each row for compartmentalization--&gt;
                &lt;row-ends-here/&gt;
              &lt;/xsl:for-each&gt;
            &lt;/xsl:for-each-group&gt;
          &lt;/xsl:for-each-group&gt;
        &lt;/xsl:for-each-group&gt;
      &lt;/xsl:variable&gt;
      &lt;!--reconstitute rows from the stream of entries by finding each
row end--&gt;
      &lt;xsl:for-each-group select=&quot;$stream-entries&quot;
                          group-ending-with=&quot;row-ends-here&quot;&gt;
        &lt;xsl:text&gt;&amp;#xa;&lt;/xsl:text&gt;
        &lt;row&gt;
          &lt;xsl:copy-of select=&quot;current-group()[position()&amp;lt;last()]&quot;/&gt;
        &lt;/row&gt;
      &lt;/xsl:for-each-group&gt;
    &lt;/xsl:copy&gt;
&lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">&lt;xsl:template match=&quot;@*|node()&quot;&gt;&lt;!--identity for all other nodes--&gt;
    &lt;xsl:copy&gt;
      &lt;xsl:apply-templates select=&quot;@*|node()&quot;/&gt;
    &lt;/xsl:copy&gt;
&lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">&lt;/xsl:stylesheet&gt;
t:\ftemp&gt;rem Done!</pre><br>
<tt>I hope these examples help.</tt><br>
<br>
<tt>. . . . . . . . . Ken</tt><br>
<br>
<pre style="margin: 0em;">--
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |</pre><br>
<tt>------------------------------
</tt></blockquote><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post70070.html</link><pubDate>Thu, 25 Apr 2013 23:27:16 GMT</pubDate></item><item><title>Re:  Chrome/blink developers discussing removing XSLT  </title><description><![CDATA[<!--X-Body-of-Message-->
<pre>On Thu, April 25, 2013 9:04 pm, Eric J. Bowman wrote:
&gt; Dimitre Novatchev wrote:
&gt;&gt;
&gt;&gt; Alas, I am not one of the browser vendors... but these people probably
&gt;&gt; can make logical conclusions?
&gt;
&gt; Yes, they've logically concluded that they can dictate which
&gt; technologies are &quot;inappropriate&quot; for use in browsers.  Can't imagine
&gt; this has anything to do with _improving_ XSLT performance, or updating
&gt; to 2.0 / Saxon CE, so much as their obvious agenda to kill XML on the
&gt; Web.

&quot;Logic is a systematic method of coming to the wrong conclusion with
confidence&quot; [1]

However, even yesterday, the thread at
https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/KZ0eaL-3vQY
was about measuring usage, not arbitrarily dropping XSLT, and that was
reiterated there after several posts in support of XSLT.

Several of the posts on that thread have pointed out what we could
consider to be obvious: poor support for XSLT in browsers has led to poor
usage of XSLT in browsers.  But because of that poor support, even a
well-intentioned usage statistics gathering will, I fear, be like a train
company considering going from an hourly service to a half-hourly that
then drops the idea after its survey shows people only gather at the train
station at hourly intervals.

Collectively, here, we mostly think it's a no-brainer to use XSLT in the
browser, and even XSLT 2.0 in the browser with Saxon-CE, though many would
not have heard of blink until yesterday, but collectively, on the blink
list, they'd mostly think you'd have no brains if you use XSLT in the
browser, and many would not have heard of Saxon-CE until yesterday. 
There's obviously more than a little distance between those two positions,
but how would you positively influence them towards our position?

Regards,


Tony Graham                                   tgraham@xxxxxxxxxx
Consultant                                 http://www.mentea.net
Mentea       13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
 --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
    XML, XSL-FO and XSLT consulting, training and programming


[1] http://www.netlingo.com/word/murphys-laws-on-technology.php
    and various other places.  I originally saw it on a poster
    of the same name, but most sites that quote all the maxims
    from the poster neglect to mention the original.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post00080.html</link><pubDate>Thu, 25 Apr 2013 22:13:38 GMT</pubDate></item><item><title>Re:  Chrome/blink developers discussing removing XSLT  </title><description><![CDATA[<!--X-Body-of-Message-->
<pre>&quot;Tony Graham&quot; wrote:
&gt;
&gt; There's obviously more than a little distance between those two
&gt; positions, but how would you positively influence them towards our
&gt; position?
&gt; 

After years of watching every issue I care about get decided the other
way by the browser vendors, I'd have to say I doubt positive influence
is possible on XSLT.  If XSLT survives as a Web technology, it'll be as
a plugin, a la Flash.

http://lists.w3.org/Archives/Public/www-tag/2013Feb/0060.html
http://lists.w3.org/Archives/Public/www-tag/2013Feb/0075.html
http://lists.w3.org/Archives/Public/www-tag/2013Feb/0077.html
http://lists.w3.org/Archives/Public/www-tag/2013Feb/0089.html
http://lists.w3.org/Archives/Public/www-tag/2013Feb/0104.html

That's called &quot;tilting at windmills,&quot; but props to anyone else who
wants to try.

-Eric

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post10080.html</link><pubDate>Thu, 25 Apr 2013 17:23:16 GMT</pubDate></item><item><title>Re:  XSLT 3.0 features in Saxon 9.5</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>On 25 Apr 2013, at 07:36, davep wrote:

&gt; On 24/04/13 18:29, Michael Kay wrote:
&gt;&gt; I thought that some of you who like to stay close to the bleeding edge
might like to try out some of the new XSLT 3.0 features implemented in Saxon
9.5.
&gt;&gt;
&gt;
&gt; Is 9.5 fully compliant to the spec now Mike? As it currently stands?

XPath 3.0 is now very stable, there's a very complete test suite, and Saxon is
100% conformant (well, it was last Thursday; there's always a trickle of spec
bugs and Saxon bugs that makes that figure oscillate between 99.99% and
100%).

XSLT 3.0 has not yet reached that level of stability. There are some parts
Saxon doesn't implement at all yet (notably the &quot;packaging&quot; features), there
are some parts where Saxon hasn't caught up with the latest changes, and there
some parts where Saxon implements features or changes to features that the WG
hasn't published yet. It's a work in progress.

Michael Kay
Saxonica

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post80070.html</link><pubDate>Thu, 25 Apr 2013 17:01:33 GMT</pubDate></item><item><title>Re:  Chrome/blink developers discussing removing XSLT  </title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Dimitre Novatchev wrote:
&gt; 
&gt; Alas, I am not one of the browser vendors... but these people probably
&gt; can make logical conclusions?
&gt; 

Yes, they've logically concluded that they can dictate which
technologies are &quot;inappropriate&quot; for use in browsers.  Can't imagine
this has anything to do with _improving_ XSLT performance, or updating
to 2.0 / Saxon CE, so much as their obvious agenda to kill XML on the
Web.

-Eric

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post90070.html</link><pubDate>Thu, 25 Apr 2013 14:04:06 GMT</pubDate></item><item><title>RE:  XSLT 3.0 features in Saxon 9.5</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Yes Mike, awaiting to implement it here!

Regards,

Arulselvan R Pallavarayar
Senior Software Engineer | MPS Limited
RR Tower -4 | Super-A, 16 &amp;17 4th floor| TVK industrial Estate | Guindy |
Chennai | 600032 | INDIA

Direct: +91 (0)44 4916 2259 | Ext 259
Mobile: +91 (0)9710416093
Email: arul.selvan@xxxxxxxxxxx
www.adi-mps.com
-----Original Message-----
From: davep [<a  href="mailto:davep@xxxxxxxxxxxxx">mailto:davep@xxxxxxxxxxxxx</a>]
Sent: Thursday, April 25, 2013 12:07 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  XSLT 3.0 features in Saxon 9.5

On 24/04/13 18:29, Michael Kay wrote:
&gt; I thought that some of you who like to stay close to the bleeding edge
might like to try out some of the new XSLT 3.0 features implemented in Saxon
9.5.
&gt;

Is 9.5 fully compliant to the spec now Mike? As it currently stands?
I know you do a lot of testing.




regards

--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk

This e-mail and/or attachments are confidential and may also be legally
privileged. If you are not the intended recipient, any disclosure, copying,
distribution or action taken relying on the contents is strictly prohibited
and may be unlawful. If you have received this communication in error, please
notify the sender immediately by responding to this e-mail and deleting the
contents of the e-mail &amp; related attachments from your system. Though MPS
Limited has taken reasonable steps to ensure no viruses are present in this
e-mail, it cannot accept responsibility for any loss or damage arising from
the use of this e-mail or attachments. No contracts may be concluded with MPS
through e-mail communication. Please consider the environment before printing
this e-mail.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post50070.html</link><pubDate>Thu, 25 Apr 2013 12:12:46 GMT</pubDate></item><item><title>Re:  XSLT 3.0 features in Saxon 9.5</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>On Thu, 2013-04-25 at 07:36 +0100, davep wrote:
&gt; On 24/04/13 18:29, Michael Kay wrote:
&gt; &gt; I thought that some of you who like to stay close to the bleeding edge might like to try out some of the new XSLT 3.0 features implemented in Saxon 9.5.
&gt; &gt;
&gt; 
&gt; Is 9.5 fully compliant to the spec now Mike? As it currently stands?
&gt; I know you do a lot of testing.

I know you were asking Mike, but I'll point out that XSLT 3 is a working
draft and very much subject to change. I think this is the meaning of
the &quot;bleeding-edge&quot; part of the announcement...

Nor is it really sane to ask whether it's bug-free :)

Saxon does have one of the most complete and careful implementations of
XQuery 1 and XSLT 2 on the planet as far as I can tell.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post60070.html</link><pubDate>Thu, 25 Apr 2013 10:14:12 GMT</pubDate></item><item><title>Re:  XSLT 3.0 features in Saxon 9.5</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 24/04/13 18:29, Michael Kay wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>I thought that some of you who like to stay close to the bleeding edge might like to try out some of the new XSLT 3.0 features implemented in Saxon 9.5.</tt><br>
<br>
</blockquote><pre style="margin: 0em;"><br>Is 9.5 fully compliant to the spec now Mike? As it currently stands?
I know you do a lot of testing.</pre><br>
<tt></tt><br>
<br>
<tt><br>regards</tt><br>
<br>
<pre style="margin: 0em;">--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post40070.html</link><pubDate>Thu, 25 Apr 2013 07:36:47 GMT</pubDate></item><item><title> How to make auto row-spanned table</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>Hi list,</tt><br>
<br>
<tt>I'm making a stylesheet that converts DITA documents to XSL-FO. Usually 
a table is authored with entry/@morerows attribute. But some table has 
no @morerows attribute. My challenge is to generate row-spanned table 
from this table automatically by stylesheet.</tt><br>
<br>
<tt>For your reference I uploaded sample PDF to Yahoo! Box.</tt><br>
<br>
<tt>http://yahoo.jp/box/B71Fo9</tt><br>
<br>
<tt>(To download the PDF, click &quot;cc&amp;c3c-c&lt;c	&quot; button.)</tt><br>
<br>
<tt>The first table is input table. It has no @morerows attribute. The 
second result table is desired output. The first column and second 
column and third column has row spans.</tt><br>
<br>
<tt>Can someone give me an advice about how to implement this?</tt><br>
<br>
<tt>Regards,</tt><br>
<br>
<tt>Toshihiko Makita</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post00070.html</link><pubDate>Thu, 25 Apr 2013 01:29:50 GMT</pubDate></item><item><title> XSLT 3.0 features in Saxon 9.5</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>I thought that some of you who like to stay close to the bleeding edge might
like to try out some of the new XSLT 3.0 features implemented in Saxon 9.5.

These include:

* composite grouping keys

for example &lt;xsl:for-each-group group-by=&quot;first, last&quot; composite=&quot;yes&quot;&gt;

* accumulators (a big subject that deserves a tutorial)

* xsl:number start-at=&quot;5&quot; to start numbering from something other than 1.

* xsl:assert

* xsl:map and xsl:map-entry so you can now construct maps at the XSLT level,
not only at the XPath level

* content value templates, for example

&lt;title&gt;Chapter {$number}&lt;/title&gt;

- needs to be enabled with expand-text=&quot;yes&quot; for compatibility reasons

- unlike XQuery, the expansion always yields a string, not elements or
attributes.



Accumulators, like xsl:iterate and some other XSLT 3.0 features, were
introduced primarily for streaming use cases, but I think they might well
prove handy even where streaming isn't a requirement. They basically give you
the ability to compute a value during a tree-walk of a document, passing the
accumulated value both up and down the tree; in FP terms, a sort of tree-fold
operation. If we didn't already have xsl:key, for example, you could use an
accumulator to construct an index for a document in the form of a map. I'm
sure there are people on this list who will come up with creative applications
for them...

Saxon releases don't coincide exactly with W3C working drafts so some of the
features implemented in 9.5 won't actually be published until the next WD, and
in some cases there may have been spec changes between the last public WD and
the Saxon implementation. I did say it was bleeding edge.

Michael Kay
Saxonica

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post20070.html</link><pubDate>Wed, 24 Apr 2013 18:29:03 GMT</pubDate></item><item><title>Re:  How to make auto row-spanned table</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>At 2013-04-24 12:40 -0400, I wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>At 2013-04-25 01:29 +0900, Toshihiko Makita wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>I'm making a stylesheet that converts DITA documents to XSL-FO.
</tt></blockquote></blockquote><tt><br>Actually, the answer is a *lot* simpler than I thought because I 
misread your request to convert DITA to DITA and because you made 
reference to a morerows attribute.  The principle is the same, but in 
XSL-FO one can take advantage of the cell-based row-grouping 
approach.  I even have an example of this as an exercise in my 
training class in the module on sorting and grouping.  Most of my 
students have never heard of filling an XSL-FO table with only cell 
elements and not row elements, so the exercise is meant to help 
remember the technique.</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>Usually a table is authored with entry/@morerows attribute. But 
some table has no @morerows attribute.
</tt></blockquote></blockquote><tt><br>In XSL-FO it is acceptable to say number-rows-spanned=&quot;1&quot; when there 
is no spanning.  I don't know if it is allowed to say morerows=&quot;0&quot; in DITA.</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>It would help us help you to have the XML input data of your table 
example.  You can post it as clear text in your message and we can 
cut it out and create a file from it.
</tt></blockquote><tt><br>I mocked up a test file that mimics your data and produces an 
acceptable XSL-FO result using a simplified stylesheet.  Note the use 
of the ends-row=&quot;true/false&quot; attribute and that there are no 
&lt;table-row&gt; elements.  The output test.fo can be formatted with an 
XSL-FO engine to produce a result with the rows you need.</tt><br>
<br>
<pre style="margin: 0em;"><br>t:\ftemp&gt;type test.xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;table&gt;
  &lt;tgroup&gt;
    &lt;tbody&gt;
      &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;B&lt;/entry&gt;&lt;entry&gt;C&lt;/entry&gt;&lt;entry&gt;D&lt;/entry&gt;&lt;entry&gt;E&lt;/entry&gt;&lt;entry&gt;F&lt;/entry&gt;&lt;/row&gt;
      &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;G&lt;/entry&gt;&lt;entry&gt;H&lt;/entry&gt;&lt;entry&gt;I&lt;/entry&gt;&lt;entry&gt;J&lt;/entry&gt;&lt;entry&gt;K&lt;/entry&gt;&lt;/row&gt;
      &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;G&lt;/entry&gt;&lt;entry&gt;H&lt;/entry&gt;&lt;entry&gt;L&lt;/entry&gt;&lt;entry&gt;M&lt;/entry&gt;&lt;entry&gt;N&lt;/entry&gt;&lt;/row&gt;
      &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;G&lt;/entry&gt;&lt;entry&gt;O&lt;/entry&gt;&lt;entry&gt;P&lt;/entry&gt;&lt;entry&gt;M&lt;/entry&gt;&lt;entry&gt;Q&lt;/entry&gt;&lt;/row&gt;
      &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;G&lt;/entry&gt;&lt;entry&gt;R&lt;/entry&gt;&lt;entry&gt;S&lt;/entry&gt;&lt;entry&gt;T&lt;/entry&gt;&lt;entry&gt;Q&lt;/entry&gt;&lt;/row&gt;
      &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;G&lt;/entry&gt;&lt;entry&gt;V&lt;/entry&gt;&lt;entry&gt;S&lt;/entry&gt;&lt;entry&gt;W&lt;/entry&gt;&lt;entry&gt;X&lt;/entry&gt;&lt;/row&gt;
      &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;Y&lt;/entry&gt;&lt;entry&gt;Z&lt;/entry&gt;&lt;entry&gt;1&lt;/entry&gt;&lt;entry&gt;2&lt;/entry&gt;&lt;entry&gt;3&lt;/entry&gt;&lt;/row&gt;
      &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;Y&lt;/entry&gt;&lt;entry&gt;4&lt;/entry&gt;&lt;entry&gt;1&lt;/entry&gt;&lt;entry&gt;5&lt;/entry&gt;&lt;entry&gt;6&lt;/entry&gt;&lt;/row&gt;
      &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;Y&lt;/entry&gt;&lt;entry&gt;7&lt;/entry&gt;&lt;entry&gt;1&lt;/entry&gt;&lt;entry&gt;5&lt;/entry&gt;&lt;entry&gt;8&lt;/entry&gt;&lt;/row&gt;
    &lt;/tbody&gt;
  &lt;/tgroup&gt;
&lt;/table&gt;</pre><br>
<tt>t:\ftemp&gt;call xslt2 test.xml testfo.xsl test.fo</tt><br>
<br>
<pre style="margin: 0em;">t:\ftemp&gt;type testfo.xsl
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;root xmlns=&quot;http://www.w3.org/1999/XSL/Format&quot;
      font-family=&quot;Times&quot; font-size=&quot;20pt&quot;
      xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
      xsl:version=&quot;2.0&quot;&gt;</pre><br>
<pre style="margin: 0em;">  &lt;layout-master-set&gt;
    &lt;simple-page-master master-name=&quot;frame&quot;
                        page-height=&quot;11in&quot; page-width=&quot;8.5in&quot;
                        margin-top=&quot;.5in&quot; margin-bottom=&quot;.5in&quot;
                        margin-left=&quot;.5in&quot; margin-right=&quot;.5in&quot;&gt;
      &lt;region-body region-name=&quot;frame-body&quot;/&gt;
    &lt;/simple-page-master&gt;
  &lt;/layout-master-set&gt;</pre><br>
<pre style="margin: 0em;">  &lt;page-sequence master-reference=&quot;frame&quot;&gt;
    &lt;flow flow-name=&quot;frame-body&quot;&gt;
      &lt;block&gt;This is a test of spanning rows in XSL-FO&lt;/block&gt;</pre><br>
<pre style="margin: 0em;">&lt;table text-align=&quot;center&quot;&gt;
  &lt;table-body&gt;
    &lt;xsl:for-each select=&quot;table/tgroup/tbody&quot;&gt;
    &lt;!--create a stream of table cells, marking the end of each row--&gt;
      &lt;!--only the first three columns of the table are grouped--&gt;
      &lt;xsl:for-each-group select=&quot;row&quot; group-by=&quot;entry[1]&quot;&gt;
        &lt;table-cell number-rows-spanned=&quot;{count(current-group())[.&gt;1]}&quot;&gt;
          &lt;block&gt;
            &lt;xsl:apply-templates select=&quot;entry[1]/node()&quot;/&gt;
          &lt;/block&gt;
        &lt;/table-cell&gt;
        &lt;xsl:for-each-group select=&quot;current-group()&quot; group-by=&quot;entry[2]&quot;&gt;
          &lt;table-cell number-rows-spanned=&quot;{count(current-group())[.&gt;1]}&quot;&gt;
            &lt;block&gt;
              &lt;xsl:apply-templates select=&quot;entry[2]/node()&quot;/&gt;
            &lt;/block&gt;
          &lt;/table-cell&gt;
          &lt;xsl:for-each-group select=&quot;current-group()&quot; group-by=&quot;entry[3]&quot;&gt;
            &lt;table-cell number-rows-spanned=&quot;{count(current-group())[.&gt;1]}&quot;&gt;
              &lt;block&gt;
                &lt;xsl:apply-templates select=&quot;entry[3]/node()&quot;/&gt;
              &lt;/block&gt;
            &lt;/table-cell&gt;
            &lt;!--the rest of the columns are not grouped--&gt;
            &lt;xsl:for-each select=&quot;current-group()&quot;&gt;
              &lt;xsl:for-each select=&quot;entry[position()&gt;3]&quot;&gt;
                &lt;!--mark the last cell of each row as true, others as false--&gt;
                &lt;table-cell ends-row=&quot;{position()=last()}&quot;&gt;
                 &lt;block&gt;
                   &lt;xsl:apply-templates/&gt;
                 &lt;/block&gt;
                &lt;/table-cell&gt;
              &lt;/xsl:for-each&gt;
            &lt;/xsl:for-each&gt;
          &lt;/xsl:for-each-group&gt;
        &lt;/xsl:for-each-group&gt;
      &lt;/xsl:for-each-group&gt;
    &lt;/xsl:for-each&gt;
  &lt;/table-body&gt;
&lt;/table&gt;</pre><br>
<pre style="margin: 0em;">    &lt;/flow&gt;
  &lt;/page-sequence&gt;
&lt;/root&gt;</pre><br>
<tt>t:\ftemp&gt;rem Done!</tt><br>
<br>
<tt></tt><br>
<br>
<tt>Since I had already written a DITA -&gt; DITA stylesheet adding 
morerows= before discovering I misread your question, I've added 
below a stylesheet that does that with the same input data:</tt><br>
<br>
<pre style="margin: 0em;"><br>t:\ftemp&gt;type test.xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;table&gt;
  &lt;tgroup&gt;
    &lt;tbody&gt;
      &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;B&lt;/entry&gt;&lt;entry&gt;C&lt;/entry&gt;&lt;entry&gt;D&lt;/entry&gt;&lt;entry&gt;E&lt;/entry&gt;&lt;entry&gt;F&lt;/entry&gt;&lt;/row&gt;
      &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;G&lt;/entry&gt;&lt;entry&gt;H&lt;/entry&gt;&lt;entry&gt;I&lt;/entry&gt;&lt;entry&gt;J&lt;/entry&gt;&lt;entry&gt;K&lt;/entry&gt;&lt;/row&gt;
      &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;G&lt;/entry&gt;&lt;entry&gt;H&lt;/entry&gt;&lt;entry&gt;L&lt;/entry&gt;&lt;entry&gt;M&lt;/entry&gt;&lt;entry&gt;N&lt;/entry&gt;&lt;/row&gt;
      &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;G&lt;/entry&gt;&lt;entry&gt;O&lt;/entry&gt;&lt;entry&gt;P&lt;/entry&gt;&lt;entry&gt;M&lt;/entry&gt;&lt;entry&gt;Q&lt;/entry&gt;&lt;/row&gt;
      &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;G&lt;/entry&gt;&lt;entry&gt;R&lt;/entry&gt;&lt;entry&gt;S&lt;/entry&gt;&lt;entry&gt;T&lt;/entry&gt;&lt;entry&gt;Q&lt;/entry&gt;&lt;/row&gt;
      &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;G&lt;/entry&gt;&lt;entry&gt;V&lt;/entry&gt;&lt;entry&gt;S&lt;/entry&gt;&lt;entry&gt;W&lt;/entry&gt;&lt;entry&gt;X&lt;/entry&gt;&lt;/row&gt;
      &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;Y&lt;/entry&gt;&lt;entry&gt;Z&lt;/entry&gt;&lt;entry&gt;1&lt;/entry&gt;&lt;entry&gt;2&lt;/entry&gt;&lt;entry&gt;3&lt;/entry&gt;&lt;/row&gt;
      &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;Y&lt;/entry&gt;&lt;entry&gt;4&lt;/entry&gt;&lt;entry&gt;1&lt;/entry&gt;&lt;entry&gt;5&lt;/entry&gt;&lt;entry&gt;6&lt;/entry&gt;&lt;/row&gt;
      &lt;row&gt;&lt;entry&gt;A&lt;/entry&gt;&lt;entry&gt;Y&lt;/entry&gt;&lt;entry&gt;7&lt;/entry&gt;&lt;entry&gt;1&lt;/entry&gt;&lt;entry&gt;5&lt;/entry&gt;&lt;entry&gt;8&lt;/entry&gt;&lt;/row&gt;
    &lt;/tbody&gt;
  &lt;/tgroup&gt;
&lt;/table&gt;</pre><br>
<tt>t:\ftemp&gt;call xslt2 test.xml testdita.xsl test.out.xml</tt><br>
<br>
<tt>t:\ftemp&gt;type test.out.xml<br>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;table&gt;<br>
  &lt;tgroup&gt;<br>
    &lt;tbody&gt;<br>
&lt;row&gt;&lt;entry 
morerows=&quot;8&quot;&gt;A&lt;/entry&gt;&lt;entry&gt;B&lt;/entry&gt;&lt;entry&gt;C&lt;/entry&gt;&lt;entry&gt;D&lt;/entry&gt;&lt;entry&gt;E&lt;/entry&gt;&lt;entry&gt;F&lt;/entry&gt;&lt;/row&gt;<br>
&lt;row&gt;&lt;entry morerows=&quot;4&quot;&gt;G&lt;/entry&gt;&lt;entry 
morerows=&quot;1&quot;&gt;H&lt;/entry&gt;&lt;entry&gt;I&lt;/entry&gt;&lt;entry&gt;J&lt;/entry&gt;&lt;entry&gt;K&lt;/entry&gt;&lt;/row&gt;<br>
&lt;row&gt;&lt;entry&gt;L&lt;/entry&gt;&lt;entry&gt;M&lt;/entry&gt;&lt;entry&gt;N&lt;/entry&gt;&lt;/row&gt;<br>
&lt;row&gt;&lt;entry&gt;O&lt;/entry&gt;&lt;entry&gt;P&lt;/entry&gt;&lt;entry&gt;M&lt;/entry&gt;&lt;entry&gt;Q&lt;/entry&gt;&lt;/row&gt;<br>
&lt;row&gt;&lt;entry&gt;R&lt;/entry&gt;&lt;entry&gt;S&lt;/entry&gt;&lt;entry&gt;T&lt;/entry&gt;&lt;entry&gt;Q&lt;/entry&gt;&lt;/row&gt;<br>
&lt;row&gt;&lt;entry&gt;V&lt;/entry&gt;&lt;entry&gt;S&lt;/entry&gt;&lt;entry&gt;W&lt;/entry&gt;&lt;entry&gt;X&lt;/entry&gt;&lt;/row&gt;<br>
&lt;row&gt;&lt;entry 
morerows=&quot;2&quot;&gt;Y&lt;/entry&gt;&lt;entry&gt;Z&lt;/entry&gt;&lt;entry&gt;1&lt;/entry&gt;&lt;entry&gt;2&lt;/entry&gt;&lt;entry&gt;3&lt;/entry&gt;&lt;/row&gt;<br>
&lt;row&gt;&lt;entry&gt;4&lt;/entry&gt;&lt;entry&gt;1&lt;/entry&gt;&lt;entry&gt;5&lt;/entry&gt;&lt;entry&gt;6&lt;/entry&gt;&lt;/row&gt;<br>
&lt;row&gt;&lt;entry&gt;7&lt;/entry&gt;&lt;entry&gt;1&lt;/entry&gt;&lt;entry&gt;5&lt;/entry&gt;&lt;entry&gt;8&lt;/entry&gt;&lt;/row&gt;&lt;/tbody&gt;<br>
  &lt;/tgroup&gt;<br>
&lt;/table&gt;<br>
t:\ftemp&gt;type testdita.xsl<br>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>
&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;<br>
  version=&quot;2.0&quot;&gt;</tt><br>
<br>
<tt>&lt;xsl:template match=&quot;tbody&quot;&gt;<br>
  &lt;xsl:copy&gt;<br>
    &lt;xsl:apply-templates select=&quot;@*&quot;/&gt;<br>
    &lt;!--create a stream of entries, marking the end of each row--&gt;<br>
    &lt;xsl:variable name=&quot;stream-entries&quot; as=&quot;element()*&quot;&gt;<br>
      &lt;!--only the first three columns of the table are grouped--&gt;<br>
      &lt;xsl:for-each-group select=&quot;row&quot; group-by=&quot;entry[1]&quot;&gt;<br>
        &lt;entry&gt;<br>
          &lt;xsl:copy-of select=&quot;entry[1]/@*&quot;/&gt;<br>
          &lt;xsl:for-each select=&quot;count(current-group())[.&gt;1]&quot;&gt;<br>
            &lt;xsl:attribute name=&quot;morerows&quot; select=&quot;.-1&quot;/&gt;<br>
          &lt;/xsl:for-each&gt;<br>
          &lt;xsl:copy-of select=&quot;entry[1]/node()&quot;/&gt;<br>
        &lt;/entry&gt;<br>
        &lt;xsl:for-each-group select=&quot;current-group()&quot; group-by=&quot;entry[2]&quot;&gt;<br>
          &lt;entry&gt;<br>
            &lt;xsl:copy-of select=&quot;entry[2]/@*&quot;/&gt;<br>
            &lt;xsl:for-each select=&quot;count(current-group())[.&gt;1]&quot;&gt;<br>
              &lt;xsl:attribute name=&quot;morerows&quot; select=&quot;.-1&quot;/&gt;<br>
            &lt;/xsl:for-each&gt;<br>
            &lt;xsl:copy-of select=&quot;entry[2]/node()&quot;/&gt;<br>
          &lt;/entry&gt;<br>
          &lt;xsl:for-each-group select=&quot;current-group()&quot; group-by=&quot;entry[3]&quot;&gt;<br>
            &lt;entry&gt;<br>
              &lt;xsl:copy-of select=&quot;entry[3]/@*&quot;/&gt;<br>
              &lt;xsl:for-each select=&quot;count(current-group())[.&gt;1]&quot;&gt;<br>
                &lt;xsl:attribute name=&quot;morerows&quot; select=&quot;.-1&quot;/&gt;<br>
              &lt;/xsl:for-each&gt;<br>
              &lt;xsl:copy-of select=&quot;entry[3]/node()&quot;/&gt;<br>
            &lt;/entry&gt;<br>
            &lt;!--the rest of the columns are not grouped--&gt;<br>
            &lt;xsl:for-each select=&quot;current-group()&quot;&gt;<br>
              &lt;xsl:copy-of select=&quot;entry[position()&gt;3]&quot;/&gt;<br>
              &lt;!--mark the end of each row for compartmentalization--&gt;<br>
              &lt;row-ends-here/&gt;<br>
            &lt;/xsl:for-each&gt;<br>
          &lt;/xsl:for-each-group&gt;<br>
        &lt;/xsl:for-each-group&gt;<br>
      &lt;/xsl:for-each-group&gt;<br>
    &lt;/xsl:variable&gt;<br>
    &lt;!--reconstitute rows from the stream of entries by finding each 
row end--&gt;<br>
    &lt;xsl:for-each-group select=&quot;$stream-entries&quot;<br>
                        group-ending-with=&quot;row-ends-here&quot;&gt;<br>
      &lt;xsl:text&gt;&amp;#xa;&lt;/xsl:text&gt;<br>
      &lt;row&gt;<br>
        &lt;xsl:copy-of select=&quot;current-group()[position()&amp;lt;last()]&quot;/&gt;<br>
      &lt;/row&gt;<br>
    &lt;/xsl:for-each-group&gt;<br>
  &lt;/xsl:copy&gt;<br>
&lt;/xsl:template&gt;</tt><br>
<br>
<pre style="margin: 0em;">&lt;xsl:template match=&quot;@*|node()&quot;&gt;&lt;!--identity for all other nodes--&gt;
  &lt;xsl:copy&gt;
    &lt;xsl:apply-templates select=&quot;@*|node()&quot;/&gt;
  &lt;/xsl:copy&gt;
&lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">&lt;/xsl:stylesheet&gt;
t:\ftemp&gt;rem Done!</pre><br>
<tt><br>I hope these examples help.</tt><br>
<br>
<tt>. . . . . . . . . Ken</tt><br>
<br>
<pre style="margin: 0em;"><br>--
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post30070.html</link><pubDate>Wed, 24 Apr 2013 13:56:29 GMT</pubDate></item><item><title>Re:  How to make auto row-spanned table</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>At 2013-04-25 01:29 +0900, Toshihiko Makita wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>Hi list,</tt><br>
<br>
<pre style="margin: 0em;">I'm making a stylesheet that converts DITA
documents to XSL-FO. Usually a table is authored
with entry/@morerows attribute. But some table
has no @morerows attribute. My challenge is to
generate row-spanned table from this table automatically by stylesheet.</pre><br>
<tt>For your reference I uploaded sample PDF to Yahoo! Box.</tt><br>
<br>
<tt>http://yahoo.jp/box/B71Fo9</tt><br>
<br>
<tt>(To download the PDF, click &quot;cc&amp;c3c-c&lt;c	&quot; button.)
</tt></blockquote><pre style="margin: 0em;"><br>It would help us help you to have the XML input
data of your table example.  You can post it as
clear text in your message and we can cut it out and create a file from it.</pre><br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">The first table is input table. It has no
@morerows attribute. The second result table is
desired output. The first column and second
column and third column has row spans.</pre><br>
<tt>Can someone give me an advice about how to implement this?
</tt></blockquote><pre style="margin: 0em;"><br>A brute force approach would be by counting the
number of rows that follow until the cell value
changes.  I suspect this can be done with a
straightforward XPath 2.0 expression, but I'm not
about to take the time to recreate the input data to test it.</pre><br>
<pre style="margin: 0em;">Alternatively, one might be able to use nested
grouping for a more elegant approach.  Actually,
thinking about this, this might even be preferred.</pre><br>
<tt>. . . . . . . . Ken</tt><br>
<br>
<pre style="margin: 0em;"><br>--
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post10070.html</link><pubDate>Wed, 24 Apr 2013 12:40:58 GMT</pubDate></item><item><title>Re:  How to make auto row-spanned table</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>At 2013-04-25 01:29 +0900, Toshihiko Makita wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>Hi list,</tt><br>
<br>
<pre style="margin: 0em;">I'm making a stylesheet that converts DITA
documents to XSL-FO. Usually a table is authored
with entry/@morerows attribute. But some table
has no @morerows attribute. My challenge is to
generate row-spanned table from this table automatically by stylesheet.</pre><br>
<tt>For your reference I uploaded sample PDF to Yahoo! Box.</tt><br>
<br>
<tt>http://yahoo.jp/box/B71Fo9</tt><br>
<br>
<tt>(To download the PDF, click &quot;cc&amp;c3c-c&lt;c	&quot; button.)
</tt></blockquote><pre style="margin: 0em;"><br>It would help us help you to have the XML input
data of your table example.  You can post it as
clear text in your message and we can cut it out and create a file from it.</pre><br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">The first table is input table. It has no
@morerows attribute. The second result table is
desired output. The first column and second
column and third column has row spans.</pre><br>
<tt>Can someone give me an advice about how to implement this?
</tt></blockquote><pre style="margin: 0em;"><br>A brute force approach would be by counting the
number of rows that follow until the cell value
changes.  I suspect this can be done with a
straightforward XPath 2.0 expression, but I'm not
about to take the time to recreate the input data to test it.</pre><br>
<pre style="margin: 0em;">Alternatively, one might be able to use nested
grouping for a more elegant approach.  Actually,
thinking about this, this might even be preferred.</pre><br>
<tt>. . . . . . . . Ken</tt><br>
<br>
<pre style="margin: 0em;"><br>--
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post10070.html?utm_source=feedly</link><pubDate>Wed, 24 Apr 2013 12:40:58 GMT</pubDate></item><item><title> Chrome/blink developers discussing removing XSLT suppo</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>A friend of mine just sent this out this morning, and I thought it
might be of interest to some people on this group.

----
This thread within the &quot;blink-dev&quot; discussion for Chrome's new
rendering engine ... examines the possibility of removing support for
XSLT from the browser. If so, Blink would be the first major browser
to remove support:
(https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/KZ0eaL-3vQY)

There is some discussion of usage on the web at large, but note Eric
Seidel's (of the Chrome team) comment from 4/23:

&quot;My suspicion is that neither can be removed from the platform at this
time. But both are probably good opportunities for later removal or
replacement with JS-based polyfills. I expect removing the need to
ship libxslt as part of Chrome to be a small (but non-trivial) binary
size win.&quot;
(https://groups.google.com/a/chromium.org/d/msg/blink-dev/KZ0eaL-3vQY/6Yh4qSidA6AJ)
----

Perhaps if some people here know some resources to determine usage of
XSLT on the client, and/or compelling reasons to keep this
functionality, they could weigh in.

Chris Maloney

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post70060.html</link><pubDate>Wed, 24 Apr 2013 10:12:50 GMT</pubDate></item><item><title>RE:  Chrome/blink developers discussing removing XSLT  </title><description><![CDATA[<!--X-Body-of-Message-->
<pre>This isn't the first time I've seen this sort of thinking from browser developers, and it makes me mad and sad. Any time there's even a slight bump in the road for client-side XSLT support, the first thought that comes to mind is that they should simply dump support altogether. After all, if THEY'VE never used it, they can't imagine why anybody would... ugh.

~ Scott


-----Original Message-----
From: Chris Maloney [<a  href="mailto:voldrani@xxxxxxxxx">mailto:voldrani@xxxxxxxxx</a>] 
Sent: Wednesday, April 24, 2013 9:13 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Chrome/blink developers discussing removing XSLT support

A friend of mine just sent this out this morning, and I thought it might be of interest to some people on this group.

----
This thread within the &quot;blink-dev&quot; discussion for Chrome's new rendering engine ... examines the possibility of removing support for XSLT from the browser. If so, Blink would be the first major browser to remove support:
(https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/KZ0eaL-3vQY)

There is some discussion of usage on the web at large, but note Eric Seidel's (of the Chrome team) comment from 4/23:

&quot;My suspicion is that neither can be removed from the platform at this time. But both are probably good opportunities for later removal or replacement with JS-based polyfills. I expect removing the need to ship libxslt as part of Chrome to be a small (but non-trivial) binary size win.&quot;
(https://groups.google.com/a/chromium.org/d/msg/blink-dev/KZ0eaL-3vQY/6Yh4qSidA6AJ)
----

Perhaps if some people here know some resources to determine usage of XSLT on the client, and/or compelling reasons to keep this functionality, they could weigh in.

Chris Maloney

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post80060.html</link><pubDate>Wed, 24 Apr 2013 09:54:04 GMT</pubDate></item><item><title>Re:  Namespace for reconstituted HTML</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 24/04/2013 07:36, Ihe Onwuka wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">I am downloading loading webpages and munging the markup.  I strip
off the HTML namespace as part of the munging process but now I have
a requirement to reconstitute the HTML.</pre><br>
<pre style="margin: 0em;">Can I leave the html unnamespaced or is it ok or  necessary to just
stick in an xmlns=&quot;http://www.w3.org/1999/xhtml&quot; (or some other)
declaration</pre><br>
</blockquote><pre style="margin: 0em;"><br>That appears to be an html question not an xslt one, so this is a _very_
marginal question for this list.</pre><br>
<tt>HTML does not have namespaces.</tt><br>
<br>
<pre style="margin: 0em;">If you are generating HTML 4 or earlier any xmlns attribute is invalid.
If you are generating HTML5 or later
xmlns=&quot;http://www.w3.org/1999/xhtml&quot; is valid but ignored.</pre><br>
<tt>David</tt><br>
<br>
<tt></tt><br>
<br>
<pre style="margin: 0em;">________________________________________________________________________
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.</pre><br>
<tt>This e-mail has been scanned for all viruses by Star. The service is<br>
powered by MessageLabs. 
________________________________________________________________________</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post60060.html</link><pubDate>Wed, 24 Apr 2013 09:23:55 GMT</pubDate></item><item><title>Re:  Namespace for reconstituted HTML</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 24/04/2013 07:36, Ihe Onwuka wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">I am downloading loading webpages and munging the markup.  I strip
off the HTML namespace as part of the munging process but now I have
a requirement to reconstitute the HTML.</pre><br>
<pre style="margin: 0em;">Can I leave the html unnamespaced or is it ok or  necessary to just
stick in an xmlns=&quot;http://www.w3.org/1999/xhtml&quot; (or some other)
declaration</pre><br>
</blockquote><pre style="margin: 0em;"><br>That appears to be an html question not an xslt one, so this is a _very_
marginal question for this list.</pre><br>
<tt>HTML does not have namespaces.</tt><br>
<br>
<pre style="margin: 0em;">If you are generating HTML 4 or earlier any xmlns attribute is invalid.
If you are generating HTML5 or later
xmlns=&quot;http://www.w3.org/1999/xhtml&quot; is valid but ignored.</pre><br>
<tt>David</tt><br>
<br>
<tt></tt><br>
<br>
<pre style="margin: 0em;">________________________________________________________________________
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.</pre><br>
<tt>This e-mail has been scanned for all viruses by Star. The service is<br>
powered by MessageLabs. 
________________________________________________________________________</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post60060.html?utm_source=feedly</link><pubDate>Wed, 24 Apr 2013 09:23:55 GMT</pubDate></item><item><title>Re:  Chrome/blink developers discussing removing XSLT  </title><description><![CDATA[<!--X-Body-of-Message-->
<pre> Well, no browser has its own support for XSLT 2.0 and theirs simply
can't compete with Saxon CE.

A logical conclusion for a browser vendor is to incorporate Saxon CE
in their product -- this will give them some cutting edge advantage
over the competition  while at the same time significantly enhancing
the functionality and usefulness of their browser.

Alas, I am not one of the browser vendors... but these people probably
can make logical conclusions?


On Wed, Apr 24, 2013 at 7:54 AM, Scott Trenda &lt;Scott.Trenda@xxxxxxxx&gt; wrote:
&gt; This isn't the first time I've seen this sort of thinking from browser
developers, and it makes me mad and sad. Any time there's even a slight bump
in the road for client-side XSLT support, the first thought that comes to mind
is that they should simply dump support altogether. After all, if THEY'VE
never used it, they can't imagine why anybody would... ugh.
&gt;
&gt; ~ Scott
&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
-------------------------------------
To avoid situations in which you might make mistakes may be the
biggest mistake of all
------------------------------------
Quality means doing it right when no one is looking.
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play
-------------------------------------
Facts do not cease to exist because they are ignored.
-------------------------------------
Typing monkeys will write all Shakespeare's works in 200yrs.Will they
write all patents, too? :)
-------------------------------------
I finally figured out the only reason to be alive is to enjoy it.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post90060.html</link><pubDate>Wed, 24 Apr 2013 09:05:54 GMT</pubDate></item><item><title> Namespace for reconstituted HTML</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>I am downloading loading webpages and munging the markup.  I strip off
the HTML namespace as part of the munging process but now I have a
requirement to reconstitute the HTML.

Can I leave the html unnamespaced or is it ok or  necessary to just
stick in an xmlns=&quot;http://www.w3.org/1999/xhtml&quot; (or some other)
declaration

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post50060.html</link><pubDate>Wed, 24 Apr 2013 07:36:49 GMT</pubDate></item><item><title> Namespace for reconstituted HTML</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>I am downloading loading webpages and munging the markup.  I strip off
the HTML namespace as part of the munging process but now I have a
requirement to reconstitute the HTML.

Can I leave the html unnamespaced or is it ok or  necessary to just
stick in an xmlns=&quot;http://www.w3.org/1999/xhtml&quot; (or some other)
declaration

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post50060.html?utm_source=feedly</link><pubDate>Wed, 24 Apr 2013 07:36:49 GMT</pubDate></item><item><title>RE:  accumulators</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Yes, the example I sent does not make any sense after reading the spec
properly.

-----Original Message-----
From: Michael Kay [<a  href="mailto:mike@xxxxxxxxxxxx">mailto:mike@xxxxxxxxxxxx</a>]
Sent: Saturday, April 20, 2013 6:41 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  accumulators

Like xsl:key, accumulators apply to every document, but when you evaluate
the accumulator function, you get the value applicable to the context node.
In all your calls of the accumulator function, the context node is the root
of the principal source document.

Accumulators are strictly functional: the value is a function of the context
node. If you call the function twice and the context node is the same for
both calls, you will get the same answer.

Michael Kay
Saxonica


On 19 Apr 2013, at 22:04, Jakub Mal} wrote:

&gt; Hi,
&gt; I am fiddling with XSLT accumulators in the new version of Saxon.
&gt; I first looked at the examples in the spec and thought that this might
&gt; work (and output 01210), but it doesn't:
&gt;
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt;
&gt; &lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
&gt; 	xmlns:f=&quot;myf&quot;	version=&quot;3.0&quot;&gt;
&gt;
&gt; 	&lt;xsl:accumulator name=&quot;f:my-var&quot; as=&quot;xs:integer&quot; initial-value=&quot;0&quot; &gt;
&gt; 		&lt;xsl:accumulator-rule match=&quot;f:inc&quot; new-value=&quot;$value + 1&quot;/&gt;
&gt; 		&lt;xsl:accumulator-rule match=&quot;f:dec&quot; new-value=&quot;$value - 1&quot;/&gt;
&gt; 	&lt;/xsl:accumulator&gt;
&gt;
&gt; 	&lt;xsl:variable name=&quot;f:control-inc&quot; as=&quot;element()*&quot;&gt;
&gt; 		&lt;f:inc/&gt;
&gt; 	&lt;/xsl:variable&gt;
&gt; 	&lt;xsl:variable name=&quot;f:control-dec&quot; as=&quot;element()*&quot;&gt;
&gt; 		&lt;f:dec/&gt;
&gt; 	&lt;/xsl:variable&gt;
&gt;
&gt; 	&lt;xsl:template match=&quot;/&quot;&gt;
&gt; 		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
&gt; 		&lt;xsl:apply-templates select=&quot;$f:control-inc&quot;/&gt;
&gt; 		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
&gt; 		&lt;xsl:apply-templates select=&quot;$f:control-inc&quot;/&gt;
&gt; 		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
&gt; 		&lt;xsl:apply-templates select=&quot;$f:control-dec&quot;/&gt;
&gt; 		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
&gt; 		&lt;xsl:apply-templates select=&quot;$f:control-dec&quot;/&gt;
&gt; 		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
&gt; 	&lt;/xsl:template&gt;
&gt; &lt;/xsl:stylesheet&gt;
&gt;
&gt; So I read the spec and I guess I understand why.
&gt; Accumulator rule is not triggered by calling apply-templates, it does
&gt; not matter how many times the same node is processed, the value for
&gt; the accumulator will be the same.
&gt;
&gt; Do accumulators work only for the nodes from the source document or
&gt; also for nodes from documents loaded using doc() or document()?
&gt;
&gt; Jakub.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post40060.html</link><pubDate>Sat, 20 Apr 2013 20:06:56 GMT</pubDate></item><item><title>RE:  accumulators</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Yes, the example I sent does not make any sense after reading the spec
properly.

-----Original Message-----
From: Michael Kay [<a  href="mailto:mike@xxxxxxxxxxxx">mailto:mike@xxxxxxxxxxxx</a>]
Sent: Saturday, April 20, 2013 6:41 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  accumulators

Like xsl:key, accumulators apply to every document, but when you evaluate
the accumulator function, you get the value applicable to the context node.
In all your calls of the accumulator function, the context node is the root
of the principal source document.

Accumulators are strictly functional: the value is a function of the context
node. If you call the function twice and the context node is the same for
both calls, you will get the same answer.

Michael Kay
Saxonica


On 19 Apr 2013, at 22:04, Jakub Mal} wrote:

&gt; Hi,
&gt; I am fiddling with XSLT accumulators in the new version of Saxon.
&gt; I first looked at the examples in the spec and thought that this might
&gt; work (and output 01210), but it doesn't:
&gt;
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt;
&gt; &lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
&gt; 	xmlns:f=&quot;myf&quot;	version=&quot;3.0&quot;&gt;
&gt;
&gt; 	&lt;xsl:accumulator name=&quot;f:my-var&quot; as=&quot;xs:integer&quot; initial-value=&quot;0&quot; &gt;
&gt; 		&lt;xsl:accumulator-rule match=&quot;f:inc&quot; new-value=&quot;$value + 1&quot;/&gt;
&gt; 		&lt;xsl:accumulator-rule match=&quot;f:dec&quot; new-value=&quot;$value - 1&quot;/&gt;
&gt; 	&lt;/xsl:accumulator&gt;
&gt;
&gt; 	&lt;xsl:variable name=&quot;f:control-inc&quot; as=&quot;element()*&quot;&gt;
&gt; 		&lt;f:inc/&gt;
&gt; 	&lt;/xsl:variable&gt;
&gt; 	&lt;xsl:variable name=&quot;f:control-dec&quot; as=&quot;element()*&quot;&gt;
&gt; 		&lt;f:dec/&gt;
&gt; 	&lt;/xsl:variable&gt;
&gt;
&gt; 	&lt;xsl:template match=&quot;/&quot;&gt;
&gt; 		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
&gt; 		&lt;xsl:apply-templates select=&quot;$f:control-inc&quot;/&gt;
&gt; 		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
&gt; 		&lt;xsl:apply-templates select=&quot;$f:control-inc&quot;/&gt;
&gt; 		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
&gt; 		&lt;xsl:apply-templates select=&quot;$f:control-dec&quot;/&gt;
&gt; 		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
&gt; 		&lt;xsl:apply-templates select=&quot;$f:control-dec&quot;/&gt;
&gt; 		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
&gt; 	&lt;/xsl:template&gt;
&gt; &lt;/xsl:stylesheet&gt;
&gt;
&gt; So I read the spec and I guess I understand why.
&gt; Accumulator rule is not triggered by calling apply-templates, it does
&gt; not matter how many times the same node is processed, the value for
&gt; the accumulator will be the same.
&gt;
&gt; Do accumulators work only for the nodes from the source document or
&gt; also for nodes from documents loaded using doc() or document()?
&gt;
&gt; Jakub.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post40060.html?utm_source=feedly</link><pubDate>Sat, 20 Apr 2013 20:06:56 GMT</pubDate></item><item><title>Re:  accumulators</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Like xsl:key, accumulators apply to every document, but when you evaluate the
accumulator function, you get the value applicable to the context node. In all
your calls of the accumulator function, the context node is the root of the
principal source document.

Accumulators are strictly functional: the value is a function of the context
node. If you call the function twice and the context node is the same for both
calls, you will get the same answer.

Michael Kay
Saxonica


On 19 Apr 2013, at 22:04, Jakub Mal} wrote:

&gt; Hi,
&gt; I am fiddling with XSLT accumulators in the new version of Saxon.
&gt; I first looked at the examples in the spec and thought that this might work
&gt; (and output 01210), but it doesn't:
&gt;
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt;
&gt; &lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
&gt; 	xmlns:f=&quot;myf&quot;	version=&quot;3.0&quot;&gt;
&gt;
&gt; 	&lt;xsl:accumulator name=&quot;f:my-var&quot; as=&quot;xs:integer&quot; initial-value=&quot;0&quot; &gt;
&gt; 		&lt;xsl:accumulator-rule match=&quot;f:inc&quot; new-value=&quot;$value + 1&quot;/&gt;
&gt; 		&lt;xsl:accumulator-rule match=&quot;f:dec&quot; new-value=&quot;$value - 1&quot;/&gt;
&gt; 	&lt;/xsl:accumulator&gt;
&gt;
&gt; 	&lt;xsl:variable name=&quot;f:control-inc&quot; as=&quot;element()*&quot;&gt;
&gt; 		&lt;f:inc/&gt;
&gt; 	&lt;/xsl:variable&gt;
&gt; 	&lt;xsl:variable name=&quot;f:control-dec&quot; as=&quot;element()*&quot;&gt;
&gt; 		&lt;f:dec/&gt;
&gt; 	&lt;/xsl:variable&gt;
&gt;
&gt; 	&lt;xsl:template match=&quot;/&quot;&gt;
&gt; 		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
&gt; 		&lt;xsl:apply-templates select=&quot;$f:control-inc&quot;/&gt;
&gt; 		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
&gt; 		&lt;xsl:apply-templates select=&quot;$f:control-inc&quot;/&gt;
&gt; 		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
&gt; 		&lt;xsl:apply-templates select=&quot;$f:control-dec&quot;/&gt;
&gt; 		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
&gt; 		&lt;xsl:apply-templates select=&quot;$f:control-dec&quot;/&gt;
&gt; 		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
&gt; 	&lt;/xsl:template&gt;
&gt; &lt;/xsl:stylesheet&gt;
&gt;
&gt; So I read the spec and I guess I understand why.
&gt; Accumulator rule is not triggered by calling apply-templates, it does not
&gt; matter how many times the same node is processed, the value for the
&gt; accumulator will be the same.
&gt;
&gt; Do accumulators work only for the nodes from the source document or also
for
&gt; nodes from documents loaded using doc() or document()?
&gt;
&gt; Jakub.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post30060.html</link><pubDate>Sat, 20 Apr 2013 17:41:09 GMT</pubDate></item><item><title> accumulators</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Hi, 
I am fiddling with XSLT accumulators in the new version of Saxon. 
I first looked at the examples in the spec and thought that this might work
(and output 01210), but it doesn't:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;

&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
	xmlns:f=&quot;myf&quot;	version=&quot;3.0&quot;&gt;

	&lt;xsl:accumulator name=&quot;f:my-var&quot; as=&quot;xs:integer&quot; initial-value=&quot;0&quot; &gt;
		&lt;xsl:accumulator-rule match=&quot;f:inc&quot; new-value=&quot;$value + 1&quot;/&gt;
		&lt;xsl:accumulator-rule match=&quot;f:dec&quot; new-value=&quot;$value - 1&quot;/&gt;
	&lt;/xsl:accumulator&gt;
	
	&lt;xsl:variable name=&quot;f:control-inc&quot; as=&quot;element()*&quot;&gt;
		&lt;f:inc/&gt;
	&lt;/xsl:variable&gt;
	&lt;xsl:variable name=&quot;f:control-dec&quot; as=&quot;element()*&quot;&gt;
		&lt;f:dec/&gt;
	&lt;/xsl:variable&gt;
	
	&lt;xsl:template match=&quot;/&quot;&gt;
		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
		&lt;xsl:apply-templates select=&quot;$f:control-inc&quot;/&gt;
		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
		&lt;xsl:apply-templates select=&quot;$f:control-inc&quot;/&gt;
		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
		&lt;xsl:apply-templates select=&quot;$f:control-dec&quot;/&gt;
		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
		&lt;xsl:apply-templates select=&quot;$f:control-dec&quot;/&gt;
		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
	&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;

So I read the spec and I guess I understand why. 
Accumulator rule is not triggered by calling apply-templates, it does not
matter how many times the same node is processed, the value for the
accumulator will be the same. 

Do accumulators work only for the nodes from the source document or also for
nodes from documents loaded using doc() or document()?  

Jakub.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post20060.html</link><pubDate>Fri, 19 Apr 2013 23:04:51 GMT</pubDate></item><item><title> accumulators</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Hi, 
I am fiddling with XSLT accumulators in the new version of Saxon. 
I first looked at the examples in the spec and thought that this might work
(and output 01210), but it doesn't:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;

&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
	xmlns:f=&quot;myf&quot;	version=&quot;3.0&quot;&gt;

	&lt;xsl:accumulator name=&quot;f:my-var&quot; as=&quot;xs:integer&quot; initial-value=&quot;0&quot; &gt;
		&lt;xsl:accumulator-rule match=&quot;f:inc&quot; new-value=&quot;$value + 1&quot;/&gt;
		&lt;xsl:accumulator-rule match=&quot;f:dec&quot; new-value=&quot;$value - 1&quot;/&gt;
	&lt;/xsl:accumulator&gt;
	
	&lt;xsl:variable name=&quot;f:control-inc&quot; as=&quot;element()*&quot;&gt;
		&lt;f:inc/&gt;
	&lt;/xsl:variable&gt;
	&lt;xsl:variable name=&quot;f:control-dec&quot; as=&quot;element()*&quot;&gt;
		&lt;f:dec/&gt;
	&lt;/xsl:variable&gt;
	
	&lt;xsl:template match=&quot;/&quot;&gt;
		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
		&lt;xsl:apply-templates select=&quot;$f:control-inc&quot;/&gt;
		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
		&lt;xsl:apply-templates select=&quot;$f:control-inc&quot;/&gt;
		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
		&lt;xsl:apply-templates select=&quot;$f:control-dec&quot;/&gt;
		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
		&lt;xsl:apply-templates select=&quot;$f:control-dec&quot;/&gt;
		&lt;xsl:value-of select=&quot;f:my-var()&quot; /&gt;
	&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;

So I read the spec and I guess I understand why. 
Accumulator rule is not triggered by calling apply-templates, it does not
matter how many times the same node is processed, the value for the
accumulator will be the same. 

Do accumulators work only for the nodes from the source document or also for
nodes from documents loaded using doc() or document()?  

Jakub.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post20060.html?utm_source=feedly</link><pubDate>Fri, 19 Apr 2013 23:04:51 GMT</pubDate></item><item><title>Re:  Using mode removes linebreaks/indents</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>At 2013-04-18 11:07 +0000, trond.huso@xxxxxx wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>For some reason when using mode the indentation and line breaks are 
all removed:
</tt></blockquote><tt><br>The specification states that white-space-only text nodes in the 
stylesheet are not included when stylesheet nodes are copied to the 
result tree.  This includes those nodes used for indentation in the stylesheet.</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">This is the initiater:
&lt;xsl:template match=&quot;/&quot; mode=&quot;run2&quot;&gt;</pre><br>
<tt>        &lt;nitf version=&quot;-//IPTC//DTD NITF 3.2//EN&quot; 
change.date=&quot;October 10, 2003&quot; change.time=&quot;19:30&quot;<br>
            baselang=&quot;no-NO&quot;&gt;<br>
            &lt;!-- Call template header --&gt;<br>
            &lt;xsl:call-template name=&quot;header&quot; /&gt;</tt><br>
<br>
<pre style="margin: 0em;">            &lt;body&gt;
                &lt;xsl:call-template name=&quot;body3&quot;/&gt;
            &lt;/body&gt;
        &lt;/nitf&gt;
    &lt;/xsl:template&gt;</pre><br>
<tt>Output:<br>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;nitf 
xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; 
xmlns:ckbk=&quot;http://my.safaribooksonline.com/book/xml/0596009747/dates-and-times/&quot; 
version=&quot;-//IPTC//DTD NITF 3.2//EN&quot; change.date=&quot;October 10, 2003&quot; 
change.time=&quot;19:30&quot; baselang=&quot;no-NO&quot;&gt;&lt;head&gt;&lt;title&gt;Langoddstips uke 
16&lt;/title&gt;&lt;meta name=&quot;timestamp&quot; content=&quot;2013.4.18 12:52:50&quot;/&gt;
</tt></blockquote><tt><br>That is showing the result with the text nodes of the stylesheet 
properly ignored.</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">I have this in the &quot;global&quot; area of xslt:
&lt;xsl:output method=&quot;xml&quot; indent=&quot;yes&quot; encoding=&quot;ISO-8859-1&quot; name=&quot;xml&quot; /&gt;
</pre></blockquote><tt><br>That *should* have added some white-space to your result, but the 
processor is allowed to ignore indent=&quot;yes&quot; and still be considered 
conformant.  If your processor is not supporting indenting the result 
serialization, you would have to go through elaborate means to 
preserve the white-space nodes in your stylesheet.</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>Any suggestions?
</tt></blockquote><tt><br>Which processor are you using?  Does that processor support indent=&quot;yes&quot;?</tt><br>
<br>
<tt>Sometimes keeping stylesheet template indentation is as simple as 
adding xml:space=&quot;preserve&quot; in the template rule, but often it isn't 
that simple.</tt><br>
<br>
<tt>Is there a reason why you want it preserved?  It usually isn't 
important to the downstream processor.  I advise my students that 
indent=&quot;yes&quot; may be useful in development but it should be 
indent=&quot;no&quot; in a production environment if you are unsure of what 
white-space is being added in all circumstances.  For example, having 
indent=&quot;yes&quot; has hurt me in production work with XSL-FO.</tt><br>
<br>
<tt>I hope this helps.</tt><br>
<br>
<tt>. . . . . . . . . Ken</tt><br>
<br>
<pre style="margin: 0em;">--
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post10060.html</link><pubDate>Fri, 19 Apr 2013 16:30:56 GMT</pubDate></item><item><title>Re:  Using mode removes linebreaks/indents</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>At 2013-04-18 11:07 +0000, trond.huso@xxxxxx wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>For some reason when using mode the indentation and line breaks are 
all removed:
</tt></blockquote><tt><br>The specification states that white-space-only text nodes in the 
stylesheet are not included when stylesheet nodes are copied to the 
result tree.  This includes those nodes used for indentation in the stylesheet.</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">This is the initiater:
&lt;xsl:template match=&quot;/&quot; mode=&quot;run2&quot;&gt;</pre><br>
<tt>        &lt;nitf version=&quot;-//IPTC//DTD NITF 3.2//EN&quot; 
change.date=&quot;October 10, 2003&quot; change.time=&quot;19:30&quot;<br>
            baselang=&quot;no-NO&quot;&gt;<br>
            &lt;!-- Call template header --&gt;<br>
            &lt;xsl:call-template name=&quot;header&quot; /&gt;</tt><br>
<br>
<pre style="margin: 0em;">            &lt;body&gt;
                &lt;xsl:call-template name=&quot;body3&quot;/&gt;
            &lt;/body&gt;
        &lt;/nitf&gt;
    &lt;/xsl:template&gt;</pre><br>
<tt>Output:<br>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;nitf 
xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; 
xmlns:ckbk=&quot;http://my.safaribooksonline.com/book/xml/0596009747/dates-and-times/&quot; 
version=&quot;-//IPTC//DTD NITF 3.2//EN&quot; change.date=&quot;October 10, 2003&quot; 
change.time=&quot;19:30&quot; baselang=&quot;no-NO&quot;&gt;&lt;head&gt;&lt;title&gt;Langoddstips uke 
16&lt;/title&gt;&lt;meta name=&quot;timestamp&quot; content=&quot;2013.4.18 12:52:50&quot;/&gt;
</tt></blockquote><tt><br>That is showing the result with the text nodes of the stylesheet 
properly ignored.</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">I have this in the &quot;global&quot; area of xslt:
&lt;xsl:output method=&quot;xml&quot; indent=&quot;yes&quot; encoding=&quot;ISO-8859-1&quot; name=&quot;xml&quot; /&gt;
</pre></blockquote><tt><br>That *should* have added some white-space to your result, but the 
processor is allowed to ignore indent=&quot;yes&quot; and still be considered 
conformant.  If your processor is not supporting indenting the result 
serialization, you would have to go through elaborate means to 
preserve the white-space nodes in your stylesheet.</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>Any suggestions?
</tt></blockquote><tt><br>Which processor are you using?  Does that processor support indent=&quot;yes&quot;?</tt><br>
<br>
<tt>Sometimes keeping stylesheet template indentation is as simple as 
adding xml:space=&quot;preserve&quot; in the template rule, but often it isn't 
that simple.</tt><br>
<br>
<tt>Is there a reason why you want it preserved?  It usually isn't 
important to the downstream processor.  I advise my students that 
indent=&quot;yes&quot; may be useful in development but it should be 
indent=&quot;no&quot; in a production environment if you are unsure of what 
white-space is being added in all circumstances.  For example, having 
indent=&quot;yes&quot; has hurt me in production work with XSL-FO.</tt><br>
<br>
<tt>I hope this helps.</tt><br>
<br>
<tt>. . . . . . . . . Ken</tt><br>
<br>
<pre style="margin: 0em;">--
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post10060.html?utm_source=feedly</link><pubDate>Fri, 19 Apr 2013 16:30:56 GMT</pubDate></item><item><title>Re:  replacing selective p tags with tags with attribut</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>At 2013-04-18 22:38 -0400, strip513 . wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>        Hey guys,</tt><br>
<br>
<tt>        I have an xml file with many p tags --</tt><br>
<br>
<pre style="margin: 0em;">        INPUT --
...
        I want all the p tags which are above inline img class to be
replaced by &lt;p channel=&quot;y.com&quot;&gt; and it will look like
...
        I dont want to replace any other normal p tags.So, in this
particular example find and replace will happen at two places.</pre><br>
<tt>        I used this code,but it is not working.Please advise.Thanks.
</tt></blockquote><tt><br>I advise you to look at XSLT differently, so I'm glad you 
posted.  You are treating XSLT imperatively, in a manner like Java or 
C or Python, and not taking advantage of what XSLT can do for 
you.  And you are trying to create angle brackets in your strings, 
which is entirely inappropriate for XSLT.</tt><br>
<br>
<tt>Consider the working solution below that does what you ask.  It is 
written declaratively and it looks at the input as a tree of nodes, 
not as a string of angle brackets.  I declare in my stylesheet what I 
want the output to look like for a given input element.  I've 
characterized what is special about &lt;p&gt; element nodes that need to be 
written out differently, otherwise, all element nodes are simply 
copied to the result tree as they are found in the input tree.</tt><br>
<br>
<tt>You need to approach solutions in a manner appropriate to the 
processing model (declarative) and data model (nodes) of XSLT.  Using 
purely imperative approaches and putting angle strings will not help 
you and will hinder your use of the language.</tt><br>
<br>
<tt>XSLT is built for XML and with XML, it is not a language that simply 
supports XML from function calls.</tt><br>
<br>
<tt>I hope you find this helpful.</tt><br>
<br>
<tt>. . . . . . . Ken</tt><br>
<br>
<pre style="margin: 0em;"><br>T:\ftemp&gt;type arkle.xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;test&gt;
  &lt;p&gt;
              &lt;inline-img class=&quot;full&quot;&gt;
                &lt;web-main-photo&gt;
                  &lt;photo src=&quot;http://yahoo.com/test.jpg&quot;/&gt;
                &lt;/web-main-photo&gt;
                &lt;data&gt;
                  &lt;br/&gt;
                  &lt;caption&gt;
                    &lt;p&gt; (Nick Wass/Associated Press)&lt;/p&gt;
                  &lt;/caption&gt;
                &lt;/data&gt;
              &lt;/inline-img&gt;
            &lt;/p&gt;
            &lt;p&gt;this is content &lt;/p&gt;
            &lt;p&gt;After missing the past three games with an injured left
leg, Martin Erat will return to the &lt;a href=&quot;/blog/&quot;&gt;Capitals&lt;/a&gt;'
lineup Saturday night at Verizon Center against the Tampa Bay
Lightning.&lt;/p&gt;
            &lt;p&gt;Erat, 31, suffered the injury on April 6 at Florida
when Panthers defenseman Erik Gudbranson delivered a late hit from
behind that sent the veteran winger awkwardly into the boards. He
avoided significant harm, though, and after five consecutive days of
skating Erat said he's prepared to get back to game action.&lt;/p&gt;
        &lt;p&gt;
              &lt;inline-img class=&quot;full&quot;&gt;
                &lt;web-main-photo&gt;
                  &lt;photo src=&quot;http://yahoo.com/test.jpg&quot;/&gt;
                &lt;/web-main-photo&gt;
                &lt;data&gt;
                  &lt;br/&gt;
                  &lt;caption&gt;
                    &lt;p&gt; (Nick Wass/Associated Press)&lt;/p&gt;
                  &lt;/caption&gt;
                &lt;/data&gt;
              &lt;/inline-img&gt;
            &lt;/p&gt;
            &lt;p&gt;&quot;Feeling good. Feels better every day, I'm pretty much
ready to go,&quot; Erat said, adding that while he would have much rather
been playing games with his new team the time to take part in practice
and watch the system work from above should help him make a smooth
transition.&lt;/p&gt;
&lt;/test&gt;</pre><br>
<pre style="margin: 0em;">T:\ftemp&gt;call xslt arkle.xml arkle.xsl
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;test&gt;
  &lt;p channel=&quot;y&quot;&gt;
              &lt;inline-img class=&quot;full&quot;&gt;
                &lt;web-main-photo&gt;
                  &lt;photo src=&quot;http://yahoo.com/test.jpg&quot;/&gt;
                &lt;/web-main-photo&gt;
                &lt;data&gt;
                  &lt;br/&gt;
                  &lt;caption&gt;
                    &lt;p&gt; (Nick Wass/Associated Press)&lt;/p&gt;
                  &lt;/caption&gt;
                &lt;/data&gt;
              &lt;/inline-img&gt;
            &lt;/p&gt;
            &lt;p&gt;this is content &lt;/p&gt;
            &lt;p&gt;After missing the past three games with an injured left
leg, Martin Erat will return to the &lt;a href=&quot;/blog/&quot;&gt;Capitals&lt;/a&gt;'
lineup Saturday night at Verizon Center against the Tampa Bay
Lightning.&lt;/p&gt;
            &lt;p&gt;Erat, 31, suffered the injury on April 6 at Florida
when Panthers defenseman Erik Gudbranson delivered a late hit from
behind that sent the veteran winger awkwardly into the boards. He
avoided significant harm, though, and after five consecutive days of
skating Erat said he's prepared to get back to game action.&lt;/p&gt;
        &lt;p channel=&quot;y&quot;&gt;
              &lt;inline-img class=&quot;full&quot;&gt;
                &lt;web-main-photo&gt;
                  &lt;photo src=&quot;http://yahoo.com/test.jpg&quot;/&gt;
                &lt;/web-main-photo&gt;
                &lt;data&gt;
                  &lt;br/&gt;
                  &lt;caption&gt;
                    &lt;p&gt; (Nick Wass/Associated Press)&lt;/p&gt;
                  &lt;/caption&gt;
                &lt;/data&gt;
              &lt;/inline-img&gt;
            &lt;/p&gt;
            &lt;p&gt;&quot;Feeling good. Feels better every day, I'm pretty much
ready to go,&quot; Erat said, adding that while he would have much rather
been playing games with his new team the time to take part in practice
and watch the system work from above should help him make a smooth
transition.&lt;/p&gt;
&lt;/test&gt;
T:\ftemp&gt;type arkle.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;</pre><br>
<pre style="margin: 0em;">&lt;xsl:template match=&quot;p[inline-img]&quot;&gt;
  &lt;p channel=&quot;y&quot;&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/p&gt;
&lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">&lt;xsl:template match=&quot;@*|node()&quot;&gt;&lt;!--identity for all other nodes--&gt;
  &lt;xsl:copy&gt;
    &lt;xsl:apply-templates select=&quot;@*|node()&quot;/&gt;
  &lt;/xsl:copy&gt;
&lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">&lt;/xsl:stylesheet&gt;
T:\ftemp&gt;rem Done!</pre><br>
<pre style="margin: 0em;"><br>--
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post80050.html</link><pubDate>Thu, 18 Apr 2013 23:02:45 GMT</pubDate></item><item><title> replacing selective p tags with tags with attributes</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>        Hey guys,

        I have an xml file with many p tags --

        INPUT --

        &lt;p&gt;
              &lt;inline-img class=&quot;full&quot;&gt;
                &lt;web-main-photo&gt;
                  &lt;photo src=&quot;http://yahoo.com/test.jpg&quot;/&gt;
                &lt;/web-main-photo&gt;
                &lt;data&gt;
                  &lt;br/&gt;
                  &lt;caption&gt;
                    &lt;p&gt; (Nick Wass/Associated Press)&lt;/p&gt;
                  &lt;/caption&gt;
                &lt;/data&gt;
              &lt;/inline-img&gt;
            &lt;/p&gt;
            &lt;p&gt;this is content &lt;/p&gt;
            &lt;p&gt;After missing the past three games with an injured left
leg, Martin Erat will return to the &lt;a href=&quot;/blog/&quot;&gt;Capitals&lt;/a&gt;'
lineup Saturday night at Verizon Center against the Tampa Bay
Lightning.&lt;/p&gt;
            &lt;p&gt;Erat, 31, suffered the injury on April 6 at Florida
when Panthers defenseman Erik Gudbranson delivered a late hit from
behind that sent the veteran winger awkwardly into the boards. He
avoided significant harm, though, and after five consecutive days of
skating Erat said he's prepared to get back to game action.&lt;/p&gt;
        &lt;p&gt;
              &lt;inline-img class=&quot;full&quot;&gt;
                &lt;web-main-photo&gt;
                  &lt;photo src=&quot;http://yahoo.com/test.jpg&quot;/&gt;
                &lt;/web-main-photo&gt;
                &lt;data&gt;
                  &lt;br/&gt;
                  &lt;caption&gt;
                    &lt;p&gt; (Nick Wass/Associated Press)&lt;/p&gt;
                  &lt;/caption&gt;
                &lt;/data&gt;
              &lt;/inline-img&gt;
            &lt;/p&gt;
            &lt;p&gt;&quot;Feeling good. Feels better every day, I'm pretty much
ready to go,&quot; Erat said, adding that while he would have much rather
been playing games with his new team the time to take part in practice
and watch the system work from above should help him make a smooth
transition.&lt;/p&gt;


        INPUT ENDS HERE

        I want all the p tags which are above inline img class to be
replaced by &lt;p channel=&quot;y.com&quot;&gt; and it will look like

        &lt;p channel=&quot;y.com&quot;&gt;
          &lt;inline-img class=&quot;full&quot;&gt;
                &lt;web-main-photo&gt;
                  &lt;photo src=&quot;http://yahoo.com/test.jpg&quot;/&gt;
                &lt;/web-main-photo&gt;
                &lt;data&gt;
                  &lt;br/&gt;
                  &lt;caption&gt;
                    &lt;p&gt; (Nick Wass/Associated Press)&lt;/p&gt;
                  &lt;/caption&gt;
                &lt;/data&gt;
              &lt;/inline-img&gt;
            &lt;/p&gt;

        I dont want to replace any other normal p tags.So, in this
particular example find and replace will happen at two places.

        I used this code,but it is not working.Please advise.Thanks.

        XSLT CODE using xslt 1.0




 &lt;?xml version=&quot;1.0&quot;?&gt;
        &lt;xsl:stylesheet version=&quot;1.0&quot;
xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt;
            &lt;xsl:template match=&quot;/&quot;&gt;
            &lt;component&gt;

                    &lt;p&gt;
                        &lt;xsl:call-template name=&quot;replace-text&quot;&gt;
                                &lt;xsl:with-param name=&quot;text&quot;
select=&quot;/item/content&quot; /&gt;
                                &lt;xsl:with-param name=&quot;replace&quot;
select=&quot;'&amp;lt;p&amp;gt;&amp;lt;inline-img class='&quot; /&gt;
                                &lt;xsl:with-param name=&quot;by&quot;
select=&quot;'&amp;lt;p channel=&quot;y.com&quot;&amp;gt;&amp;lt;inline-img class='&quot; /&gt;
                        &lt;/xsl:call-template&gt;
                    &lt;/p&gt;

            &lt;/component&gt;
        &lt;/xsl:template&gt;

        &lt;xsl:template name=&quot;replace-text&quot;&gt;
           &lt;xsl:param name=&quot;text&quot;/&gt;
           &lt;xsl:param name=&quot;replace&quot; /&gt;
           &lt;xsl:param name=&quot;by&quot; /&gt;

           &lt;xsl:choose&gt;
           &lt;xsl:when test=&quot;contains($text, $replace)&quot;&gt;
              &lt;xsl:value-of select=&quot;substring-before($text, $replace)&quot;/&gt;
              &lt;xsl:value-of select=&quot;$by&quot; disable-output-escaping=&quot;yes&quot;/&gt;
              &lt;xsl:call-template name=&quot;replace-text&quot;&gt;
                 &lt;xsl:with-param name=&quot;text&quot;
select=&quot;substring-after($text, $replace)&quot;/&gt;
                 &lt;xsl:with-param name=&quot;replace&quot; select=&quot;$replace&quot; /&gt;
                 &lt;xsl:with-param name=&quot;by&quot; select=&quot;$by&quot; /&gt;
              &lt;/xsl:call-template&gt;
           &lt;/xsl:when&gt;
           &lt;xsl:otherwise&gt;
              &lt;xsl:value-of select=&quot;$text&quot;/&gt;
           &lt;/xsl:otherwise&gt;
           &lt;/xsl:choose&gt;
        &lt;/xsl:template&gt;
        &lt;/xsl:stylesheet&gt;

    Thanks so much for your help.I really appreciate it.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post70050.html</link><pubDate>Thu, 18 Apr 2013 22:38:40 GMT</pubDate></item><item><title>Re:  replacing selective p tags with tags with attribut</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>strip513,

Did you know that cross-posting is evil?

See this answer to your identical question asked at SO:

http://stackoverflow.com/a/16096705/36305



On Thu, Apr 18, 2013 at 8:02 PM, G. Ken Holman
&lt;gkholman@xxxxxxxxxxxxxxxxxxxx&gt; wrote:
&gt; At 2013-04-18 22:38 -0400, strip513 . wrote:
&gt;&gt;
&gt;&gt;         Hey guys,
&gt;&gt;
&gt;&gt;         I have an xml file with many p tags --
&gt;&gt;
&gt;&gt;         INPUT --
&gt;&gt; ...
&gt;&gt;
&gt;&gt;         I want all the p tags which are above inline img class to be
&gt;&gt; replaced by &lt;p channel=&quot;y.com&quot;&gt; and it will look like
&gt;&gt; ...
&gt;&gt;
&gt;&gt;         I dont want to replace any other normal p tags.So, in this
&gt;&gt; particular example find and replace will happen at two places.
&gt;&gt;
&gt;&gt;         I used this code,but it is not working.Please advise.Thanks.
&gt;
&gt;
&gt; I advise you to look at XSLT differently, so I'm glad you posted.  You are
&gt; treating XSLT imperatively, in a manner like Java or C or Python, and not
&gt; taking advantage of what XSLT can do for you.  And you are trying to create
&gt; angle brackets in your strings, which is entirely inappropriate for XSLT.
&gt;
&gt; Consider the working solution below that does what you ask.  It is written
&gt; declaratively and it looks at the input as a tree of nodes, not as a string
&gt; of angle brackets.  I declare in my stylesheet what I want the output to
&gt; look like for a given input element.  I've characterized what is special
&gt; about &lt;p&gt; element nodes that need to be written out differently, otherwise,
&gt; all element nodes are simply copied to the result tree as they are found in
&gt; the input tree.
&gt;
&gt; You need to approach solutions in a manner appropriate to the processing
&gt; model (declarative) and data model (nodes) of XSLT.  Using purely imperative
&gt; approaches and putting angle strings will not help you and will hinder your
&gt; use of the language.
&gt;
&gt; XSLT is built for XML and with XML, it is not a language that simply
&gt; supports XML from function calls.
&gt;
&gt; I hope you find this helpful.
&gt;
&gt; . . . . . . . Ken
&gt;
&gt;
&gt; T:\ftemp&gt;type arkle.xml
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt; &lt;test&gt;
&gt;
&gt;   &lt;p&gt;
&gt;               &lt;inline-img class=&quot;full&quot;&gt;
&gt;                 &lt;web-main-photo&gt;
&gt;                   &lt;photo src=&quot;http://yahoo.com/test.jpg&quot;/&gt;
&gt;                 &lt;/web-main-photo&gt;
&gt;                 &lt;data&gt;
&gt;                   &lt;br/&gt;
&gt;                   &lt;caption&gt;
&gt;                     &lt;p&gt; (Nick Wass/Associated Press)&lt;/p&gt;
&gt;                   &lt;/caption&gt;
&gt;                 &lt;/data&gt;
&gt;               &lt;/inline-img&gt;
&gt;             &lt;/p&gt;
&gt;             &lt;p&gt;this is content &lt;/p&gt;
&gt;             &lt;p&gt;After missing the past three games with an injured left
&gt; leg, Martin Erat will return to the &lt;a href=&quot;/blog/&quot;&gt;Capitals&lt;/a&gt;'
&gt; lineup Saturday night at Verizon Center against the Tampa Bay
&gt; Lightning.&lt;/p&gt;
&gt;             &lt;p&gt;Erat, 31, suffered the injury on April 6 at Florida
&gt; when Panthers defenseman Erik Gudbranson delivered a late hit from
&gt; behind that sent the veteran winger awkwardly into the boards. He
&gt; avoided significant harm, though, and after five consecutive days of
&gt; skating Erat said he's prepared to get back to game action.&lt;/p&gt;
&gt;         &lt;p&gt;
&gt;               &lt;inline-img class=&quot;full&quot;&gt;
&gt;                 &lt;web-main-photo&gt;
&gt;                   &lt;photo src=&quot;http://yahoo.com/test.jpg&quot;/&gt;
&gt;                 &lt;/web-main-photo&gt;
&gt;                 &lt;data&gt;
&gt;                   &lt;br/&gt;
&gt;                   &lt;caption&gt;
&gt;                     &lt;p&gt; (Nick Wass/Associated Press)&lt;/p&gt;
&gt;                   &lt;/caption&gt;
&gt;                 &lt;/data&gt;
&gt;               &lt;/inline-img&gt;
&gt;             &lt;/p&gt;
&gt;             &lt;p&gt;&quot;Feeling good. Feels better every day, I'm pretty much
&gt; ready to go,&quot; Erat said, adding that while he would have much rather
&gt; been playing games with his new team the time to take part in practice
&gt; and watch the system work from above should help him make a smooth
&gt; transition.&lt;/p&gt;
&gt; &lt;/test&gt;
&gt;
&gt; T:\ftemp&gt;call xslt arkle.xml arkle.xsl
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;test&gt;
&gt;   &lt;p channel=&quot;y&quot;&gt;
&gt;
&gt;               &lt;inline-img class=&quot;full&quot;&gt;
&gt;                 &lt;web-main-photo&gt;
&gt;                   &lt;photo src=&quot;http://yahoo.com/test.jpg&quot;/&gt;
&gt;                 &lt;/web-main-photo&gt;
&gt;                 &lt;data&gt;
&gt;                   &lt;br/&gt;
&gt;                   &lt;caption&gt;
&gt;                     &lt;p&gt; (Nick Wass/Associated Press)&lt;/p&gt;
&gt;                   &lt;/caption&gt;
&gt;                 &lt;/data&gt;
&gt;               &lt;/inline-img&gt;
&gt;             &lt;/p&gt;
&gt;             &lt;p&gt;this is content &lt;/p&gt;
&gt;             &lt;p&gt;After missing the past three games with an injured left
&gt; leg, Martin Erat will return to the &lt;a href=&quot;/blog/&quot;&gt;Capitals&lt;/a&gt;'
&gt; lineup Saturday night at Verizon Center against the Tampa Bay
&gt; Lightning.&lt;/p&gt;
&gt;             &lt;p&gt;Erat, 31, suffered the injury on April 6 at Florida
&gt; when Panthers defenseman Erik Gudbranson delivered a late hit from
&gt; behind that sent the veteran winger awkwardly into the boards. He
&gt; avoided significant harm, though, and after five consecutive days of
&gt; skating Erat said he's prepared to get back to game action.&lt;/p&gt;
&gt;         &lt;p channel=&quot;y&quot;&gt;
&gt;
&gt;               &lt;inline-img class=&quot;full&quot;&gt;
&gt;                 &lt;web-main-photo&gt;
&gt;                   &lt;photo src=&quot;http://yahoo.com/test.jpg&quot;/&gt;
&gt;                 &lt;/web-main-photo&gt;
&gt;                 &lt;data&gt;
&gt;                   &lt;br/&gt;
&gt;                   &lt;caption&gt;
&gt;                     &lt;p&gt; (Nick Wass/Associated Press)&lt;/p&gt;
&gt;                   &lt;/caption&gt;
&gt;                 &lt;/data&gt;
&gt;               &lt;/inline-img&gt;
&gt;             &lt;/p&gt;
&gt;             &lt;p&gt;&quot;Feeling good. Feels better every day, I'm pretty much
&gt; ready to go,&quot; Erat said, adding that while he would have much rather
&gt; been playing games with his new team the time to take part in practice
&gt; and watch the system work from above should help him make a smooth
&gt; transition.&lt;/p&gt;
&gt; &lt;/test&gt;
&gt; T:\ftemp&gt;type arkle.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;                 version=&quot;1.0&quot;&gt;
&gt;
&gt; &lt;xsl:template match=&quot;p[inline-img]&quot;&gt;
&gt;   &lt;p channel=&quot;y&quot;&gt;
&gt;     &lt;xsl:apply-templates/&gt;
&gt;   &lt;/p&gt;
&gt; &lt;/xsl:template&gt;
&gt;
&gt; &lt;xsl:template match=&quot;@*|node()&quot;&gt;&lt;!--identity for all other nodes--&gt;
&gt;   &lt;xsl:copy&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:stylesheet&gt;
&gt; T:\ftemp&gt;rem Done!
&gt;
&gt;
&gt; --
&gt; Contact us for world-wide XML consulting and instructor-led training |
&gt; Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
&gt; Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
&gt; G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
&gt; Google+ profile: https://plus.google.com/116832879756988317389/about |
&gt; Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |
&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
-------------------------------------
To avoid situations in which you might make mistakes may be the
biggest mistake of all
------------------------------------
Quality means doing it right when no one is looking.
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play
-------------------------------------
Facts do not cease to exist because they are ignored.
-------------------------------------
Typing monkeys will write all Shakespeare's works in 200yrs.Will they
write all patents, too? :)
-------------------------------------
I finally figured out the only reason to be alive is to enjoy it.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post90050.html</link><pubDate>Thu, 18 Apr 2013 20:30:22 GMT</pubDate></item><item><title> Using mode removes linebreaks/indents</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Hi,

For some reason when using mode the indentation and line breaks are all
removed:
This is the initiater:
&lt;xsl:template match=&quot;/&quot; mode=&quot;run2&quot;&gt;

        &lt;nitf version=&quot;-//IPTC//DTD NITF 3.2//EN&quot; change.date=&quot;October 10,
2003&quot; change.time=&quot;19:30&quot;
            baselang=&quot;no-NO&quot;&gt;
            &lt;!-- Call template header --&gt;
            &lt;xsl:call-template name=&quot;header&quot; /&gt;

            &lt;body&gt;
                &lt;xsl:call-template name=&quot;body3&quot;/&gt;
            &lt;/body&gt;
        &lt;/nitf&gt;
    &lt;/xsl:template&gt;

Output:
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;nitf
xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;
xmlns:ckbk=&quot;http://my.safaribooksonline.com/book/xml/0596009747/dates-and-tim
es/&quot; version=&quot;-//IPTC//DTD NITF 3.2//EN&quot; change.date=&quot;October 10, 2003&quot;
change.time=&quot;19:30&quot; baselang=&quot;no-NO&quot;&gt;&lt;head&gt;&lt;title&gt;Langoddstips uke
16&lt;/title&gt;&lt;meta name=&quot;timestamp&quot; content=&quot;2013.4.18 12:52:50&quot;/&gt;

I have this in the &quot;global&quot; area of xslt:
&lt;xsl:output method=&quot;xml&quot; indent=&quot;yes&quot; encoding=&quot;ISO-8859-1&quot; name=&quot;xml&quot; /&gt;

Any suggestions?

Best regards,

Trond Husx

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post00060.html</link><pubDate>Thu, 18 Apr 2013 11:07:49 GMT</pubDate></item><item><title>Re:  xsl output defaults - html</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 18/04/2013 06:48, Ihe Onwuka wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">Just been burnt by the fact that XSLT defaults to html output and
therefore does not emit well formed xml (e.g does not close img tags
 even if you tell it to) upon seeing a root element of html - EVEN if
 that root element is not in the html/xhtml namespace.</pre><br>
</blockquote><pre style="margin: 0em;"><br>This rule has been in place since XSLT 1. Note you only get the html
output method if the top level element is in _no_ namespace. If it is in
the xhtml namespace then yiou get the xhtml method (or the xml method
if xslt 1 compatibility is in force).</pre><br>
<pre style="margin: 0em;">If producing html it is important not to use /&gt; when generating html as
(prior to HTML5)
&lt;meta.../&gt;
is a syntax error in html.</pre><br>
<tt>David</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post60050.html</link><pubDate>Thu, 18 Apr 2013 09:28:41 GMT</pubDate></item><item><title> xsl output defaults - html</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Just been burnt by the fact that XSLT defaults to html output and
therefore does not emit well formed xml (e.g does not close img tags
even if you tell it to) upon seeing a root element of html - EVEN if
that root element is not in the html/xhtml namespace.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post50050.html</link><pubDate>Thu, 18 Apr 2013 06:48:02 GMT</pubDate></item><item><title>Re:  .[predicate] vs self::node()[predicate]- Xalan 2.7</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 17.04.2013 11:27, Imsieke, Gerrit, le-tex wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">If the first hypothesis is correct, it will explain that
&quot;self::node()[starts-with(name,'tdown')]&quot; does not match while
&quot;child::node()[starts-with(name,'tdown')]&quot; or
&quot;*[starts-with(name,'tdown')]&quot; will probably match. All based on the
</pre></blockquote><tt><br>again, name b name()</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post30050.html</link><pubDate>Wed, 17 Apr 2013 11:28:48 GMT</pubDate></item><item><title>Re:  .[predicate] vs self::node()[predicate]- Xalan 2.7</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 17.04.2013 11:27, Imsieke, Gerrit, le-tex wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">If the first hypothesis is correct, it will explain that
&quot;self::node()[starts-with(name,'tdown')]&quot; does not match while
&quot;child::node()[starts-with(name,'tdown')]&quot; or
&quot;*[starts-with(name,'tdown')]&quot; will probably match. All based on the
</pre></blockquote><tt><br>again, name b name()</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post30050.html?utm_source=feedly</link><pubDate>Wed, 17 Apr 2013 11:28:48 GMT</pubDate></item><item><title>Re:  .[predicate] vs self::node()[predicate]- Xalan 2.7</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 17.04.2013 11:12, Raimund Kammering wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">XSL:
&lt;xsl:template match=&quot;entry/sum&quot;&gt;
   ...
   &lt;xsl:for-each select=&quot;.[starts-with(name,'tdown')]&quot;&gt;
   ...
   &lt;/xsl:for-each&gt;
   ...
&lt;/xsl:template&gt;
</pre></blockquote><tt><br>Given the structure of your XML document, it looks as if the processor 
interprets &quot;.[starts-with(name,'tdown')]&quot; as 
&quot;*[starts-with(name(),'tdown')]&quot;.<br>
Except that your original expression cannot match because there is no 
element called 'name'  you probably wanted to write 'name()'.</tt><br>
<br>
<tt>If the first hypothesis is correct, it will explain that 
&quot;self::node()[starts-with(name,'tdown')]&quot; does not match while 
&quot;child::node()[starts-with(name,'tdown')]&quot; or 
&quot;*[starts-with(name,'tdown')]&quot; will probably match. All based on the 
assumption that your XML structure actually looks like the example that 
you gave.</tt><br>
<br>
<tt>Gerrit</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post20050.html</link><pubDate>Wed, 17 Apr 2013 11:27:07 GMT</pubDate></item><item><title> .[predicate] vs self::node()[predicate]- Xalan 2.7</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Hello,

I have a stylesheet which works correct if I use:

.[predicate]

but I get an warning/error from the transformer saying:

'..[predicate]' or '.[predicate]' is illegal syntax.  Use
'self::node()[predicate]' instead.
And this spams the (tomcat) log files that way that they get unusable!
Therefore I would like to get rid of this
warning/error message. BUT if I do as recommended and use
'self::node()[predicate], the transformation results
in no match?!

The transformer I use is Xalan Java 2.7.0. Is there an easy way to suppress
the warning/error, or to change the
statement to be legal (while producing the same matches).

Code looks something like this:
XML:
&lt;sum&gt;
  &lt;tdownA&gt;0.7&lt;/tdownA&gt;
  &lt;tdownB&gt;0.1&lt;/tdownB&gt;
&lt;/sum&gt;

XSL:
&lt;xsl:template match=&quot;entry/sum&quot;&gt;
  ...
  &lt;xsl:for-each select=&quot;.[starts-with(name,'tdown')]&quot;&gt;
  ...
  &lt;/xsl:for-each&gt;
  ...
&lt;/xsl:template&gt;

(and YES I should/could change the template match condition to be
match=&quot;entry&quot; and the for-each to be
select=&quot;sum[starts-with(name,'tdown')]&quot;, but this would break a lot other
surrounding logic, which I don't want
to touch!)

Any help would be appreciated!

Cheers,
Raimund

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post10050.html</link><pubDate>Wed, 17 Apr 2013 11:12:37 GMT</pubDate></item><item><title>Re:  .[predicate] vs self::node()[predicate]- Xalan 2.7</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 17/04/2013 10:12, Raimund Kammering wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>Hello,</tt><br>
<br>
<tt>I have a stylesheet which works correct if I use:</tt><br>
<br>
<tt>.[predicate]</tt><br>
<br>
<tt>but I get an warning/error from the transformer saying:</tt><br>
<br>
</blockquote><tt><br>It's not a warning it is a syntax error, The processor could just stop 
and give no result at all.</tt><br>
<br>
<tt>It is legal syntax in XPath 2 but you are using an Xpath 1 system.</tt><br>
<br>
<tt>David</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post40050.html</link><pubDate>Wed, 17 Apr 2013 10:29:39 GMT</pubDate></item><item><title> XSLT and SPARQL</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>XSL Working Group,
Greetings. Previous research and projects into XSLT and SPARQL include Topia
(http://www.telin.nl/index.cfm?language=en&amp;project=Topia) from the research of
Jacco Van Ossenbruggen, Lynda Hardman and Lloyd Rutledge, RDF Twig
(http://norman.walsh.name/2004/projects/rdftwig) by Norman Walsh, and
XSLT+SPARQL (http://berrueta.net/research/xsltsparql) by Diego Berrueta, Jose
E. Labra, and Ivan Herman.
SPARQL 1.1 (http://www.w3.org/TR/sparql11-overview/) includes the query forms
of SELECT, CONSTRUCT, ASK and DESCRIBE and each query form would be useful to
have, in terms of XSLT expressiveness and logic, with regard to querying local
and remote data stores including for URI passed to XSLT templates as
parameters.
I was wondering whether there was any interest in discussing enhancing SPARQL
in XSLT or discussing the requirements of a specification standardizing an
extension to XSLT for SPARQL 1.1?
 Kind regards,
 Adam Sobieski

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post00050.html</link><pubDate>Tue, 16 Apr 2013 11:45:00 GMT</pubDate></item><item><title>Re:  Saxon-EE 9.4.0.6 can't adress comment nodes</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Now fixed.

https://saxonica.plan.io/issues/1731

Thanks Bjoern and Octavian.

Michael Kay
Saxonica

On 10 Apr 2013, at 14:57, Octavian Nadolu wrote:

&gt; Hello,
&gt;
&gt; The problem can be reproduced in oXygen 14.2 if schema-based validation
(-val) is enabled, the XML Schema version is set to 1.1 (-xsdversion) and the
'assertions can see comments' option is disabled.
&gt; To resolve the problem you can enable the 'assertions can see comments'
option from the oXygen preferences, 'XML / XML Parser / XML Schema' options
page or you can set the default XML Schema version to 1.0, from the same
options page.
&gt;
&gt; This behavior can be reproduced also by running the transformation with
Saxon from the command line, with the following parameters:
&gt; java -jar saxon9ee.jar test.xml -xsl:test.xsl -config:saxonCfg.xml
&gt;
&gt; ------- saxonCfg.xml--------------
&gt; &lt;configuration edition=&quot;EE&quot; xmlns=&quot;http://saxon.sf.net/ns/configuration&quot;&gt;
&gt;    &lt;xsd version=&quot;1.1&quot; assertionsCanSeeComments=&quot;false&quot;/&gt;
&gt;    &lt;global schemaValidation=&quot;lax&quot;/&gt;
&gt;    &lt;xslt schemaAware=&quot;true&quot;&gt;
&gt;        &lt;extensionElement/&gt;
&gt;    &lt;/xslt&gt;
&gt; &lt;/configuration&gt;
&gt; -------------------------------------------
&gt;
&gt; Regards,
&gt; Octavian
&gt; ---------------
&gt; Octavian Nadolu
&gt; &lt;oXygen/&gt; XML Editor
&gt; http://www.oxygenxml.com
&gt;
&gt; On 10.04.2013 14:42, Michael Kay wrote:
&gt;&gt; We've tried this out on oXygen 14.2 and we're unable to reproduce the
problem.
&gt;&gt;
&gt;&gt; We can try it again perhaps with a specific stylesheet, source document,
and schema.
&gt;&gt;
&gt;&gt; Michael Kay
&gt;&gt; Saxonica
&gt;&gt;
&gt;&gt;
&gt;&gt; On 10 Apr 2013, at 09:15, bjoern.duenckel@xxxxxxxxxxxxxxxxxxx wrote:
&gt;&gt;
&gt;&gt;&gt;&gt; I'm always a bit reticent about discussing product-specific issues on =
&gt;&gt;&gt;&gt; this list - I like to be helpful to users and I don't mind doing it in =
&gt;&gt;&gt;&gt; public, but I'm conscious that not everyone on the list is interested. =
&gt;&gt;&gt;&gt; There's a Saxon specific forum athttp://saxonica.plan.io  which you are
=
&gt;&gt;&gt;&gt; welcome to use.
&gt;&gt;&gt; Thanks for the advice!
&gt;&gt;&gt; I will use the forum for Saxon realted issues in the future.
&gt;&gt;&gt;
&gt;&gt;&gt;&gt; I can't see any obvious reason for this behaviour. Schema validation per
=
&gt;&gt;&gt;&gt; se shouldn't lose the comments, although it ignores them. How are you =
&gt;&gt;&gt;&gt; invoking the transformation?
&gt;&gt;&gt; I used an oXygen transformation scenario to invoke the transformation:
&gt;&gt;&gt;
&gt;&gt;&gt;   oXygen XML Editor 14.2, build 2013030817
&gt;&gt;&gt;   Transformer: Saxon-EE 9.4.0.6
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; Regards
&gt;&gt;&gt;
&gt;&gt;&gt; Bjvrn D|nckel.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post90040.html</link><pubDate>Wed, 10 Apr 2013 17:19:31 GMT</pubDate></item><item><title>Re:  Saxon-EE 9.4.0.6 can't adress comment nodes</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Now fixed.

https://saxonica.plan.io/issues/1731

Thanks Bjoern and Octavian.

Michael Kay
Saxonica

On 10 Apr 2013, at 14:57, Octavian Nadolu wrote:

&gt; Hello,
&gt;
&gt; The problem can be reproduced in oXygen 14.2 if schema-based validation
(-val) is enabled, the XML Schema version is set to 1.1 (-xsdversion) and the
'assertions can see comments' option is disabled.
&gt; To resolve the problem you can enable the 'assertions can see comments'
option from the oXygen preferences, 'XML / XML Parser / XML Schema' options
page or you can set the default XML Schema version to 1.0, from the same
options page.
&gt;
&gt; This behavior can be reproduced also by running the transformation with
Saxon from the command line, with the following parameters:
&gt; java -jar saxon9ee.jar test.xml -xsl:test.xsl -config:saxonCfg.xml
&gt;
&gt; ------- saxonCfg.xml--------------
&gt; &lt;configuration edition=&quot;EE&quot; xmlns=&quot;http://saxon.sf.net/ns/configuration&quot;&gt;
&gt;    &lt;xsd version=&quot;1.1&quot; assertionsCanSeeComments=&quot;false&quot;/&gt;
&gt;    &lt;global schemaValidation=&quot;lax&quot;/&gt;
&gt;    &lt;xslt schemaAware=&quot;true&quot;&gt;
&gt;        &lt;extensionElement/&gt;
&gt;    &lt;/xslt&gt;
&gt; &lt;/configuration&gt;
&gt; -------------------------------------------
&gt;
&gt; Regards,
&gt; Octavian
&gt; ---------------
&gt; Octavian Nadolu
&gt; &lt;oXygen/&gt; XML Editor
&gt; http://www.oxygenxml.com
&gt;
&gt; On 10.04.2013 14:42, Michael Kay wrote:
&gt;&gt; We've tried this out on oXygen 14.2 and we're unable to reproduce the
problem.
&gt;&gt;
&gt;&gt; We can try it again perhaps with a specific stylesheet, source document,
and schema.
&gt;&gt;
&gt;&gt; Michael Kay
&gt;&gt; Saxonica
&gt;&gt;
&gt;&gt;
&gt;&gt; On 10 Apr 2013, at 09:15, bjoern.duenckel@xxxxxxxxxxxxxxxxxxx wrote:
&gt;&gt;
&gt;&gt;&gt;&gt; I'm always a bit reticent about discussing product-specific issues on =
&gt;&gt;&gt;&gt; this list - I like to be helpful to users and I don't mind doing it in =
&gt;&gt;&gt;&gt; public, but I'm conscious that not everyone on the list is interested. =
&gt;&gt;&gt;&gt; There's a Saxon specific forum athttp://saxonica.plan.io  which you are
=
&gt;&gt;&gt;&gt; welcome to use.
&gt;&gt;&gt; Thanks for the advice!
&gt;&gt;&gt; I will use the forum for Saxon realted issues in the future.
&gt;&gt;&gt;
&gt;&gt;&gt;&gt; I can't see any obvious reason for this behaviour. Schema validation per
=
&gt;&gt;&gt;&gt; se shouldn't lose the comments, although it ignores them. How are you =
&gt;&gt;&gt;&gt; invoking the transformation?
&gt;&gt;&gt; I used an oXygen transformation scenario to invoke the transformation:
&gt;&gt;&gt;
&gt;&gt;&gt;   oXygen XML Editor 14.2, build 2013030817
&gt;&gt;&gt;   Transformer: Saxon-EE 9.4.0.6
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; Regards
&gt;&gt;&gt;
&gt;&gt;&gt; Bjvrn D|nckel.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post90040.html?utm_source=feedly</link><pubDate>Wed, 10 Apr 2013 17:19:31 GMT</pubDate></item><item><title>Re:  Saxon-EE 9.4.0.6 can't adress comment nodes</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>Hello,</tt><br>
<br>
<tt>The problem can be reproduced in oXygen 14.2 if schema-based validation 
(-val) is enabled, the XML Schema version is set to 1.1 (-xsdversion) 
and the 'assertions can see comments' option is disabled.<br>
To resolve the problem you can enable the 'assertions can see comments' 
option from the oXygen preferences, 'XML / XML Parser / XML Schema' 
options page or you can set the default XML Schema version to 1.0, from 
the same options page.</tt><br>
<br>
<tt>This behavior can be reproduced also by running the transformation with 
Saxon from the command line, with the following parameters:<br>
java -jar saxon9ee.jar test.xml -xsl:test.xsl -config:saxonCfg.xml</tt><br>
<br>
<pre style="margin: 0em;">------- saxonCfg.xml--------------
&lt;configuration edition=&quot;EE&quot; xmlns=&quot;http://saxon.sf.net/ns/configuration&quot;&gt;
    &lt;xsd version=&quot;1.1&quot; assertionsCanSeeComments=&quot;false&quot;/&gt;
    &lt;global schemaValidation=&quot;lax&quot;/&gt;
    &lt;xslt schemaAware=&quot;true&quot;&gt;
        &lt;extensionElement/&gt;
    &lt;/xslt&gt;
&lt;/configuration&gt;
-------------------------------------------</pre><br>
<pre style="margin: 0em;">Regards,
Octavian
---------------
Octavian Nadolu
&lt;oXygen/&gt; XML Editor
http://www.oxygenxml.com</pre><br>
<tt>On 10.04.2013 14:42, Michael Kay wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>We've tried this out on oXygen 14.2 and we're unable to reproduce the problem.</tt><br>
<br>
<tt>We can try it again perhaps with a specific stylesheet, source document, and schema.</tt><br>
<br>
<pre style="margin: 0em;">Michael Kay
Saxonica</pre><br>
<tt><br>On 10 Apr 2013, at 09:15, bjoern.duenckel@xxxxxxxxxxxxxxxxxxx wrote:</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">I'm always a bit reticent about discussing product-specific issues on =
this list - I like to be helpful to users and I don't mind doing it in =
public, but I'm conscious that not everyone on the list is interested. =
There's a Saxon specific forum athttp://saxonica.plan.io  which you are =
welcome to use.
</pre></blockquote><pre style="margin: 0em;">Thanks for the advice!
I will use the forum for Saxon realted issues in the future.</pre><br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">I can't see any obvious reason for this behaviour. Schema validation per =
se shouldn't lose the comments, although it ignores them. How are you =
invoking the transformation?
</pre></blockquote><tt>I used an oXygen transformation scenario to invoke the transformation:</tt><br>
<br>
<pre style="margin: 0em;">   oXygen XML Editor 14.2, build 2013030817
   Transformer: Saxon-EE 9.4.0.6</pre><br>
<tt><br>Regards</tt><br>
<br>
<tt>Bjvrn D|nckel.
</tt></blockquote></blockquote><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post70040.html</link><pubDate>Wed, 10 Apr 2013 16:57:43 GMT</pubDate></item><item><title>Re:  Saxon-EE 9.4.0.6 can't adress comment nodes</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>Hello,</tt><br>
<br>
<tt>The problem can be reproduced in oXygen 14.2 if schema-based validation 
(-val) is enabled, the XML Schema version is set to 1.1 (-xsdversion) 
and the 'assertions can see comments' option is disabled.<br>
To resolve the problem you can enable the 'assertions can see comments' 
option from the oXygen preferences, 'XML / XML Parser / XML Schema' 
options page or you can set the default XML Schema version to 1.0, from 
the same options page.</tt><br>
<br>
<tt>This behavior can be reproduced also by running the transformation with 
Saxon from the command line, with the following parameters:<br>
java -jar saxon9ee.jar test.xml -xsl:test.xsl -config:saxonCfg.xml</tt><br>
<br>
<pre style="margin: 0em;">------- saxonCfg.xml--------------
&lt;configuration edition=&quot;EE&quot; xmlns=&quot;http://saxon.sf.net/ns/configuration&quot;&gt;
    &lt;xsd version=&quot;1.1&quot; assertionsCanSeeComments=&quot;false&quot;/&gt;
    &lt;global schemaValidation=&quot;lax&quot;/&gt;
    &lt;xslt schemaAware=&quot;true&quot;&gt;
        &lt;extensionElement/&gt;
    &lt;/xslt&gt;
&lt;/configuration&gt;
-------------------------------------------</pre><br>
<pre style="margin: 0em;">Regards,
Octavian
---------------
Octavian Nadolu
&lt;oXygen/&gt; XML Editor
http://www.oxygenxml.com</pre><br>
<tt>On 10.04.2013 14:42, Michael Kay wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>We've tried this out on oXygen 14.2 and we're unable to reproduce the problem.</tt><br>
<br>
<tt>We can try it again perhaps with a specific stylesheet, source document, and schema.</tt><br>
<br>
<pre style="margin: 0em;">Michael Kay
Saxonica</pre><br>
<tt><br>On 10 Apr 2013, at 09:15, bjoern.duenckel@xxxxxxxxxxxxxxxxxxx wrote:</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">I'm always a bit reticent about discussing product-specific issues on =
this list - I like to be helpful to users and I don't mind doing it in =
public, but I'm conscious that not everyone on the list is interested. =
There's a Saxon specific forum athttp://saxonica.plan.io  which you are =
welcome to use.
</pre></blockquote><pre style="margin: 0em;">Thanks for the advice!
I will use the forum for Saxon realted issues in the future.</pre><br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">I can't see any obvious reason for this behaviour. Schema validation per =
se shouldn't lose the comments, although it ignores them. How are you =
invoking the transformation?
</pre></blockquote><tt>I used an oXygen transformation scenario to invoke the transformation:</tt><br>
<br>
<pre style="margin: 0em;">   oXygen XML Editor 14.2, build 2013030817
   Transformer: Saxon-EE 9.4.0.6</pre><br>
<tt><br>Regards</tt><br>
<br>
<tt>Bjvrn D|nckel.
</tt></blockquote></blockquote><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post70040.html?utm_source=feedly</link><pubDate>Wed, 10 Apr 2013 16:57:43 GMT</pubDate></item><item><title>Re:  Saxon-EE 9.4.0.6 can't adress comment nodes</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>OK, many thanks. It looks as if filtering out comments from the tree view that
is seen by assertions is having the unintended side-effect of filtering them
out from the validation output. We'll look into it.

Michael Kay
Saxonica


On 10 Apr 2013, at 14:57, Octavian Nadolu wrote:

&gt; Hello,
&gt;
&gt; The problem can be reproduced in oXygen 14.2 if schema-based validation
(-val) is enabled, the XML Schema version is set to 1.1 (-xsdversion) and the
'assertions can see comments' option is disabled.
&gt; To resolve the problem you can enable the 'assertions can see comments'
option from the oXygen preferences, 'XML / XML Parser / XML Schema' options
page or you can set the default XML Schema version to 1.0, from the same
options page.
&gt;
&gt; This behavior can be reproduced also by running the transformation with
Saxon from the command line, with the following parameters:
&gt; java -jar saxon9ee.jar test.xml -xsl:test.xsl -config:saxonCfg.xml
&gt;
&gt; ------- saxonCfg.xml--------------
&gt; &lt;configuration edition=&quot;EE&quot; xmlns=&quot;http://saxon.sf.net/ns/configuration&quot;&gt;
&gt;    &lt;xsd version=&quot;1.1&quot; assertionsCanSeeComments=&quot;false&quot;/&gt;
&gt;    &lt;global schemaValidation=&quot;lax&quot;/&gt;
&gt;    &lt;xslt schemaAware=&quot;true&quot;&gt;
&gt;        &lt;extensionElement/&gt;
&gt;    &lt;/xslt&gt;
&gt; &lt;/configuration&gt;
&gt; -------------------------------------------
&gt;
&gt; Regards,
&gt; Octavian
&gt; ---------------
&gt; Octavian Nadolu
&gt; &lt;oXygen/&gt; XML Editor
&gt; http://www.oxygenxml.com
&gt;
&gt; On 10.04.2013 14:42, Michael Kay wrote:
&gt;&gt; We've tried this out on oXygen 14.2 and we're unable to reproduce the
problem.
&gt;&gt;
&gt;&gt; We can try it again perhaps with a specific stylesheet, source document,
and schema.
&gt;&gt;
&gt;&gt; Michael Kay
&gt;&gt; Saxonica
&gt;&gt;
&gt;&gt;
&gt;&gt; On 10 Apr 2013, at 09:15, bjoern.duenckel@xxxxxxxxxxxxxxxxxxx wrote:
&gt;&gt;
&gt;&gt;&gt;&gt; I'm always a bit reticent about discussing product-specific issues on =
&gt;&gt;&gt;&gt; this list - I like to be helpful to users and I don't mind doing it in =
&gt;&gt;&gt;&gt; public, but I'm conscious that not everyone on the list is interested. =
&gt;&gt;&gt;&gt; There's a Saxon specific forum athttp://saxonica.plan.io  which you are
=
&gt;&gt;&gt;&gt; welcome to use.
&gt;&gt;&gt; Thanks for the advice!
&gt;&gt;&gt; I will use the forum for Saxon realted issues in the future.
&gt;&gt;&gt;
&gt;&gt;&gt;&gt; I can't see any obvious reason for this behaviour. Schema validation per
=
&gt;&gt;&gt;&gt; se shouldn't lose the comments, although it ignores them. How are you =
&gt;&gt;&gt;&gt; invoking the transformation?
&gt;&gt;&gt; I used an oXygen transformation scenario to invoke the transformation:
&gt;&gt;&gt;
&gt;&gt;&gt;   oXygen XML Editor 14.2, build 2013030817
&gt;&gt;&gt;   Transformer: Saxon-EE 9.4.0.6
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; Regards
&gt;&gt;&gt;
&gt;&gt;&gt; Bjvrn D|nckel.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post80040.html</link><pubDate>Wed, 10 Apr 2013 15:12:37 GMT</pubDate></item><item><title>Re:  Saxon-EE 9.4.0.6 can't adress comment nodes</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>We've tried this out on oXygen 14.2 and we're unable to reproduce the
problem.

We can try it again perhaps with a specific stylesheet, source document, and
schema.

Michael Kay
Saxonica


On 10 Apr 2013, at 09:15, bjoern.duenckel@xxxxxxxxxxxxxxxxxxx wrote:

&gt;&gt; I'm always a bit reticent about discussing product-specific issues on =
&gt;&gt; this list - I like to be helpful to users and I don't mind doing it in =
&gt;&gt; public, but I'm conscious that not everyone on the list is interested. =
&gt;&gt; There's a Saxon specific forum athttp://saxonica.plan.io  which you are =
&gt;&gt; welcome to use.
&gt; Thanks for the advice!
&gt; I will use the forum for Saxon realted issues in the future.
&gt;
&gt;&gt; I can't see any obvious reason for this behaviour. Schema validation per =
&gt;&gt; se shouldn't lose the comments, although it ignores them. How are you =
&gt;&gt; invoking the transformation?
&gt; I used an oXygen transformation scenario to invoke the transformation:
&gt;
&gt;   oXygen XML Editor 14.2, build 2013030817
&gt;   Transformer: Saxon-EE 9.4.0.6
&gt;
&gt;
&gt; Regards
&gt;
&gt; Bjvrn D|nckel.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post60040.html</link><pubDate>Wed, 10 Apr 2013 12:42:13 GMT</pubDate></item><item><title>Re:  Saxon-EE 9.4.0.6 can't adress comment nodes</title><description><![CDATA[<!--X-Body-of-Message-->
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">I'm always a bit reticent about discussing product-specific issues on =
this list - I like to be helpful to users and I don't mind doing it in =
public, but I'm conscious that not everyone on the list is interested. =
There's a Saxon specific forum athttp://saxonica.plan.io  which you are =
welcome to use.
</pre></blockquote><pre style="margin: 0em;">Thanks for the advice!
I will use the forum for Saxon realted issues in the future.</pre><br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">I can't see any obvious reason for this behaviour. Schema validation per =
se shouldn't lose the comments, although it ignores them. How are you =
invoking the transformation?
</pre></blockquote><tt>I used an oXygen transformation scenario to invoke the transformation:</tt><br>
<br>
<pre style="margin: 0em;">   oXygen XML Editor 14.2, build 2013030817
   Transformer: Saxon-EE 9.4.0.6</pre><br>
<tt><br>Regards</tt><br>
<br>
<tt>Bjvrn D|nckel.</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post50040.html</link><pubDate>Wed, 10 Apr 2013 10:15:02 GMT</pubDate></item><item><title>Re:  Saxon-EE 9.4.0.6 can't adress comment nodes</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>I'm always a bit reticent about discussing product-specific issues on this
list - I like to be helpful to users and I don't mind doing it in public, but
I'm conscious that not everyone on the list is interested. There's a Saxon
specific forum at http://saxonica.plan.io which you are welcome to use.

I can't see any obvious reason for this behaviour. Schema validation per se
shouldn't lose the comments, although it ignores them. How are you invoking
the transformation?

Michael Kay
Saxonica

On 9 Apr 2013, at 16:44, bjoern.duenckel@xxxxxxxxxxxxxxxxxxx wrote:

&gt; With Saxon-EE 9.4.0.6 I can't adress comment nodes.
&gt;
&gt;   Source
&gt;   -----------------------------------------------
&gt;   &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt;   &lt;r&gt;
&gt;        &lt;!-- This is a comment. --&gt;
&gt;   &lt;/r&gt;
&gt;   -----------------------------------------------
&gt;
&gt;   Stylesheet
&gt;   -----------------------------------------------
&gt;   &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt;   &lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
&gt;   version=&quot;2.0&quot;&gt;
&gt;        &lt;xsl:output method=&quot;text&quot;/&gt;
&gt;        &lt;xsl:template match=&quot;/&quot;&gt;
&gt;            &lt;xsl:value-of select=&quot;count(//comment())&quot;/&gt;
&gt;        &lt;/xsl:template&gt;
&gt;   &lt;/xsl:stylesheet&gt;
&gt;   -----------------------------------------------
&gt;
&gt;   Output with Saxon-EE 9.4.0.6
&gt;   -----------------------------------------------
&gt;   0
&gt;   -----------------------------------------------
&gt;
&gt;   Output with Saxon-PE 9.4.0.6 (and any other Transformer I tried)
&gt;   -----------------------------------------------
&gt;   1
&gt;   -----------------------------------------------
&gt;
&gt;
&gt; Do you agree, that this is a saxon bug?
&gt; Or am I missing something about schema-awareness that would explain this
behavior?
&gt;
&gt; Regards
&gt;
&gt; Bjvrn D|nckel

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post40040.html</link><pubDate>Tue, 09 Apr 2013 18:51:51 GMT</pubDate></item><item><title> Saxon-EE 9.4.0.6 can't adress comment nodes</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>With Saxon-EE 9.4.0.6 I can't adress comment nodes.</tt><br>
<br>
<pre style="margin: 0em;">   Source
   -----------------------------------------------
   &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
   &lt;r&gt;
        &lt;!-- This is a comment. --&gt;
   &lt;/r&gt;
   -----------------------------------------------</pre><br>
<pre style="margin: 0em;">   Stylesheet
   -----------------------------------------------
   &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&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;count(//comment())&quot;/&gt;
        &lt;/xsl:template&gt;
   &lt;/xsl:stylesheet&gt;
   -----------------------------------------------</pre><br>
<pre style="margin: 0em;">   Output with Saxon-EE 9.4.0.6
   -----------------------------------------------
   0
   -----------------------------------------------</pre><br>
<pre style="margin: 0em;">   Output with Saxon-PE 9.4.0.6 (and any other Transformer I tried)
   -----------------------------------------------
   1
   -----------------------------------------------</pre><br>
<tt><br>Do you agree, that this is a saxon bug?<br>
Or am I missing something about schema-awareness that would explain this 
behavior?</tt><br>
<br>
<tt>Regards</tt><br>
<br>
<tt>Bjvrn D|nckel</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post30040.html</link><pubDate>Tue, 09 Apr 2013 17:44:16 GMT</pubDate></item><item><title>Re:  Priorities of unionised patterns</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>I asked because  I know more from getting an answer than I would have
if I hadn't asked or if I had just experimented.

It looks like I had multiple submissions..... sorry about that ....
problems with gmail formatting.

On Tue, Apr 9, 2013 at 2:22 PM, Michael Kay &lt;mike@xxxxxxxxxxxx&gt; wrote:
&gt; You're asking as if we had a choice. But the semantics have been well
defined since 1999, so why raise the question now?
&gt;
&gt; And the approach you are proposing is very paternalistic. Disallowing things
because the user might not understand what they are doing is not generally a
good design principle, especially when it breaks orthogonality. (Treating the
separate parts of a union pattern differently was already a serious breach of
orthogonality, but that's a different question.)
&gt;
&gt; Michael Kay
&gt; Saxonica
&gt;
&gt; On 9 Apr 2013, at 12:37, Ihe Onwuka wrote:
&gt;
&gt;&gt; Given that the sub parts of a unionized pattern retain their individual
&gt;&gt; priorities
&gt;&gt;
&gt;&gt; &lt;xsl:template match=&quot;A|B[*] ......
&gt;&gt;
&gt;&gt; What should be the semantic if you were to now specify a priority
attribute.
&gt;&gt; The instinctive reaction would be they should all get the same priority
but
&gt;&gt; there not a case for saying that it should not be allowed.
&gt;&gt;
&gt;&gt; The rationale would be to highlight that the subparts may have had
&gt;&gt; different priorities in the first place so making their priorities
&gt;&gt; homogenous might actually be the source of what would be a hard to find
bug.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post20040.html</link><pubDate>Tue, 09 Apr 2013 14:32:22 GMT</pubDate></item><item><title>Re:  Priorities of unionised patterns</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>You're asking as if we had a choice. But the semantics have been well defined
since 1999, so why raise the question now?

And the approach you are proposing is very paternalistic. Disallowing things
because the user might not understand what they are doing is not generally a
good design principle, especially when it breaks orthogonality. (Treating the
separate parts of a union pattern differently was already a serious breach of
orthogonality, but that's a different question.)

Michael Kay
Saxonica

On 9 Apr 2013, at 12:37, Ihe Onwuka wrote:

&gt; Given that the sub parts of a unionized pattern retain their individual
&gt; priorities
&gt;
&gt; &lt;xsl:template match=&quot;A|B[*] ......
&gt;
&gt; What should be the semantic if you were to now specify a priority
attribute.
&gt; The instinctive reaction would be they should all get the same priority but
&gt; there not a case for saying that it should not be allowed.
&gt;
&gt; The rationale would be to highlight that the subparts may have had
&gt; different priorities in the first place so making their priorities
&gt; homogenous might actually be the source of what would be a hard to find
bug.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post10040.html</link><pubDate>Tue, 09 Apr 2013 14:22:21 GMT</pubDate></item><item><title>Re:  XPath 3.0: Is it possible to do recursion in an  a</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>It may have made for  better conversation  to translate an/your
implementation of the Y-combinator into the target language and
highlight where and if it breaks down.

On Sat, Oct 13, 2012 at 8:03 PM, Costello, Roger L. &lt;costello@xxxxxxxxx&gt; wrote:
&gt; Hi Folks,
&gt;
&gt; Is it possible to do recursion in an anonymous function?

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post00040.html</link><pubDate>Tue, 09 Apr 2013 12:43:18 GMT</pubDate></item><item><title> Priorities of unionised patterns</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Given that the sub parts of a unionized pattern retain their individual
priorities

&lt;xsl:template match=&quot;A|B[*] ......

What should be the semantic if you were to now specify a priority attribute.
The instinctive reaction would be they should all get the same priority but
 there not a case for saying that it should not be allowed.

The rationale would be to highlight that the subparts may have had
different priorities in the first place so making their priorities
homogenous might actually be the source of what would be a hard to find bug.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post90030.html</link><pubDate>Tue, 09 Apr 2013 12:37:59 GMT</pubDate></item><item><title>Re:  Matching string values across element boundaries</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>David,

Can you give a more complex example, how &quot;variable in structure&quot; those
citations may be. This may also shed some light on the kind of processing you
want to do. Changing tags to characters (why are you using ASCII instead of
some high Unicode character from the private use area?) and then back to tags
seems not a very interesting thing

- Michael

Am 08.04.2013 um 20:15 schrieb David Sewell &lt;dsewell@xxxxxxxxxxxx&gt;:

&gt; I expect this has been discussed here before, but I can't locate any
relevant
&gt; discussion, so here goes.
&gt;
&gt; We have input data with many unmarked short-title citations that look like
this:
&gt;
&gt;   Sprague, &lt;hi rend=&quot;italic&quot;&gt;Braintree Families&lt;/hi&gt;
&gt;
&gt; We want to wrap them inside another element, in our case a &lt;ref&gt; to the
&gt; bibliographic expansion. We have a venerable chain of XSLT 2.0 transforms
that
&gt; does this, and pretty well, by preprocessing the data to convert all those
&lt;hi&gt;
&gt; tags into a pair of unique ASCII characters, so that we can do
string-matching
&gt; operations within a single text node that now includes something like
&gt;
&gt;   Sprague, &quot;Braintree Families%
&gt;
&gt; which is easy to handle with xsl:analyze-string. then once we've wrapped all
the
&gt; strings we need to, we post-process with xsl:analyze-string to put the &lt;hi&gt;
&gt; elements back in.
&gt;
&gt; In practice, given the proper regexes, this works quite well and provides
the
&gt; desired output, but I always feel a bit guilty about the hackishness of the
&gt; approach. Given that the citations are quite variable in structure (usually
but
&gt; not always containing &lt;hi&gt; elements, with various combinations of text nodes
at
&gt; start and end), I've never come up with a good general-purpose way to
operate
&gt; purely on elements and text nodes without the convert-tags-to-characters
step.
&gt; Is there one (or more)?
&gt;
&gt; David S.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post40030.html</link><pubDate>Mon, 08 Apr 2013 20:58:49 GMT</pubDate></item><item><title>Re:  XPath 3.0: Is it possible to do recursion in an  a</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Something new in addition to the treatment of this subject in the
current thread -- tail-call optimization and how to survive its
complete lack in current XPath 3.0 processors:

http://dnovatchev.wordpress.com/2013/04/08/recursion-with-anonymous-inline-functions-in-xpath-3-0-part-ii/




On Sun, Oct 14, 2012 at 9:44 AM, Costello, Roger L. &lt;costello@xxxxxxxxx&gt; wrote:
&gt;
&gt; Thank you very much Dimitre. That is a fantastic technique.
&gt;
&gt; Using Dimitre's technique, I implemented the &quot;until&quot; function:
&gt;
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt; &lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
&gt;                             xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;
&gt;                             version=&quot;3.0&quot;&gt;
&gt;
&gt;     &lt;xsl:output method=&quot;text&quot;/&gt;
&gt;
&gt;     &lt;xsl:variable name=&quot;isNegative&quot; select=&quot;function($x as xs:integer) {$x lt 0}&quot; /&gt;
&gt;     &lt;xsl:variable name=&quot;decrement&quot; select=&quot;function($x as xs:integer) {$x - 1}&quot; /&gt;
&gt;     &lt;xsl:variable name=&quot;_until&quot; select=&quot;
&gt;                   function(
&gt;                                     $p as function(item()*) as xs:boolean,
&gt;                                     $f as function(item()*) as item()*,
&gt;                                     $x as item()*,
&gt;                                     $_until as function(function(), function(), item()*, function()) as item()*
&gt;                                  ) as item()*
&gt;                      {if ($p($x)) then $x else $_until($p, $f, $f($x), $_until)}
&gt;         &quot; /&gt;
&gt;
&gt;     &lt;xsl:variable name=&quot;until&quot; select=&quot;
&gt;                   function(
&gt;                                      $p as function(item()*) as xs:boolean,
&gt;                                      $f as function(item()*) as item()*,
&gt;                                      $x as item()*
&gt;                                   ) as item()*
&gt;                       {$_until($p, $f, $x, $_until)}
&gt;           &quot; /&gt;
&gt;
&gt;     &lt;xsl:template match=&quot;/&quot;&gt;
&gt;         &lt;xsl:value-of select=&quot;$until($isNegative, $decrement, 3)&quot; /&gt;
&gt;     &lt;/xsl:template&gt;
&gt;
&gt; &lt;/xsl:stylesheet&gt;
&gt;
&gt; /Roger
&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
-------------------------------------
To avoid situations in which you might make mistakes may be the
biggest mistake of all
------------------------------------
Quality means doing it right when no one is looking.
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play
-------------------------------------
Facts do not cease to exist because they are ignored.
-------------------------------------
Typing monkeys will write all Shakespeare's works in 200yrs.Will they
write all patents, too? :)
-------------------------------------
I finally figured out the only reason to be alive is to enjoy it.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post80030.html</link><pubDate>Mon, 08 Apr 2013 20:04:55 GMT</pubDate></item><item><title>Re:  Matching string values across element boundaries</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>David - I think the answer whether there is any improvement to be made 
to your system will depend in detail on just how the matching algorithm 
works.  Clearly if it expects a string, you have to give it one, and you 
are left with something like your approach.  If you're willing to 
revisit the matching algorithm (I expect you don't want to - it sounds 
hairy), you could probably also change the markup generation.  One idea 
that springs to mind is the highlighters available in search platforms: 
these typically operate on text only, remembering the position of every 
word, and allow you to mark them with tags in a highlighting pass, which 
you can later coalesce using XSLT or some other markup-aware process.  
If you can cast the matching problem as a search problem, you could 
leverage MarkLogic, or Lucene or something like that.  Maybe that would 
be better than what you have, I don't know.</tt><br>
<br>
<tt>-Mike</tt><br>
<br>
<tt>On 4/8/2013 2:15 PM, David Sewell wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">I expect this has been discussed here before, but I can't locate any relevant
discussion, so here goes.</pre><br>
<tt>We have input data with many unmarked short-title citations that look like this:</tt><br>
<br>
<tt>    Sprague, &lt;hi rend=&quot;italic&quot;&gt;Braintree Families&lt;/hi&gt;</tt><br>
<br>
<pre style="margin: 0em;">We want to wrap them inside another element, in our case a &lt;ref&gt; to the
bibliographic expansion. We have a venerable chain of XSLT 2.0 transforms that
does this, and pretty well, by preprocessing the data to convert all those &lt;hi&gt;
tags into a pair of unique ASCII characters, so that we can do string-matching
operations within a single text node that now includes something like</pre><br>
<tt>    Sprague, &quot;Braintree Families%</tt><br>
<br>
<pre style="margin: 0em;">which is easy to handle with xsl:analyze-string. then once we've wrapped all the
strings we need to, we post-process with xsl:analyze-string to put the &lt;hi&gt;
elements back in.</pre><br>
<pre style="margin: 0em;">In practice, given the proper regexes, this works quite well and provides the
desired output, but I always feel a bit guilty about the hackishness of the
approach. Given that the citations are quite variable in structure (usually but
not always containing &lt;hi&gt; elements, with various combinations of text nodes at
start and end), I've never come up with a good general-purpose way to operate
purely on elements and text nodes without the convert-tags-to-characters step.
Is there one (or more)?</pre><br>
<tt>David S.
</tt></blockquote><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post70030.html</link><pubDate>Mon, 08 Apr 2013 19:00:00 GMT</pubDate></item><item><title>Re:  Matching string values across element boundaries</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Anaylze-string can match the string, and wrap the &lt;ref&gt; around the matching
substring easily.
The problem is that the matching-substring/context-item has it's markup
stripped out, so what you
would get is:

&lt;note&gt;See for example &lt;ref target=&quot;st002&quot;&gt;Jay, Unpublished Papers&lt;/ref&gt;,
4:123.&lt;/note&gt;

instead of:

&lt;note&gt;See for example &lt;ref target=&quot;st002&quot;&gt;Jay, &lt;i&gt;Unpublished
Papers&lt;/i&gt;&lt;/ref&gt;, 4:123.&lt;/note&gt;


And I can't think of any way to preserve the markup except by escaping it in
some manner.

-- Steve Majewski / UVA Alderman Library



On Apr 8, 2013, at 4:26 PM, David Sewell wrote:

&gt; A sample of the citation abbreviations that need to be matched (for
simplicity, &lt;i&gt; is used to indicate italics), from the lookup table used by
the transforms (omitting the expansions of the abbreviations that are in the
lookup table also):
&gt;
&gt; &lt;abbr xml:id=&quot;st001&quot;&gt;&lt;i&gt;Cal. Franklin Papers&lt;/i&gt;, A.P.S.&lt;/abbr&gt;
&gt; &lt;abbr xml:id=&quot;st002&quot;&gt;Jay, &lt;i&gt;Unpublished Papers&lt;/i&gt;&lt;/abbr&gt;
&gt; &lt;abbr xml:id=&quot;st003&quot;&gt;&lt;i&gt;JCC&lt;/i&gt;&lt;/abbr&gt;
&gt; &lt;abbr xml:id=&quot;st004&quot;&gt;&lt;i&gt;Oxford Classical Dicy.&lt;/i&gt;&lt;/abbr&gt;
&gt; &lt;abbr xml:id=&quot;st005&quot;&gt;U.S. Census, 1790&lt;/abbr&gt;
&gt;
&gt; In the incoming XML, abbreviations like those above appear in running text
without wrapper elements. The automated process to add wrappers needs to
operate on string values that often cross &lt;i&gt; boundaries., as in the first two
examples. So one might find in running text:
&gt;
&gt;    &lt;note&gt;See for example Jay, &lt;i&gt;Unpublished Papers&lt;/i&gt;, 4:123.&lt;/note&gt;
&gt;
&gt; which needs to be transformed into
&gt;
&gt;    &lt;note&gt;See for example &lt;ref target=&quot;st002&quot;&gt;Jay, &lt;i&gt;Unpublished
Papers&lt;/i&gt;&lt;/ref&gt;, 4:123.&lt;/note&gt;
&gt;
&gt; The XPath //note[matches(., 'Jay, Unpublished Papers')] will match the
input &lt;note&gt;, but the complexity is writing a template that wraps the
appropriate portions of the note in a &lt;ref&gt; element. That's why our
preprocessing converts &lt;i&gt; tags in both input and lookup table to single text
characters to make the string matching relatively simple.
&gt;
&gt; And we do in fact use unusual Unicode for markers in our current transform,
the example I gave substituted markers that would show up in everyone's
email.
&gt;
&gt; David
&gt;
&gt; On Apr 8, 2013, at 2:58 PM, Michael M|ller-Hillebrand &lt;mmh@xxxxxxxxx&gt;
wrote:
&gt;
&gt;&gt; David,
&gt;&gt;
&gt;&gt; Can you give a more complex example, how &quot;variable in structure&quot; those
citations may be. This may also shed some light on the kind of processing you
want to do. Changing tags to characters (why are you using ASCII instead of
some high Unicode character from the private use area?) and then back to tags
seems not a very interesting thing
&gt;&gt;
&gt;&gt; - Michael
&gt;&gt;
&gt;&gt; Am 08.04.2013 um 20:15 schrieb David Sewell &lt;dsewell@xxxxxxxxxxxx&gt;:
&gt;&gt;
&gt;&gt;&gt; I expect this has been discussed here before, but I can't locate any
relevant
&gt;&gt;&gt; discussion, so here goes.
&gt;&gt;&gt;
&gt;&gt;&gt; We have input data with many unmarked short-title citations that look like
this:
&gt;&gt;&gt;
&gt;&gt;&gt; Sprague, &lt;hi rend=&quot;italic&quot;&gt;Braintree Families&lt;/hi&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; We want to wrap them inside another element, in our case a &lt;ref&gt; to the
&gt;&gt;&gt; bibliographic expansion. We have a venerable chain of XSLT 2.0 transforms
that
&gt;&gt;&gt; does this, and pretty well, by preprocessing the data to convert all those
&lt;hi&gt;
&gt;&gt;&gt; tags into a pair of unique ASCII characters, so that we can do
string-matching
&gt;&gt;&gt; operations within a single text node that now includes something like
&gt;&gt;&gt;
&gt;&gt;&gt; Sprague, &quot;Braintree Families%
&gt;&gt;&gt;
&gt;&gt;&gt; which is easy to handle with xsl:analyze-string. then once we've wrapped
all the
&gt;&gt;&gt; strings we need to, we post-process with xsl:analyze-string to put the
&lt;hi&gt;
&gt;&gt;&gt; elements back in.
&gt;&gt;&gt;
&gt;&gt;&gt; In practice, given the proper regexes, this works quite well and provides
the
&gt;&gt;&gt; desired output, but I always feel a bit guilty about the hackishness of
the
&gt;&gt;&gt; approach. Given that the citations are quite variable in structure
(usually but
&gt;&gt;&gt; not always containing &lt;hi&gt; elements, with various combinations of text
nodes at
&gt;&gt;&gt; start and end), I've never come up with a good general-purpose way to
operate
&gt;&gt;&gt; purely on elements and text nodes without the convert-tags-to-characters
step.
&gt;&gt;&gt; Is there one (or more)?
&gt;&gt;&gt;
&gt;&gt;&gt; David S.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post60030.html</link><pubDate>Mon, 08 Apr 2013 17:01:09 GMT</pubDate></item><item><title>Re:  Matching string values across element boundaries</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>A sample of the citation abbreviations that need to be matched (for
simplicity, &lt;i&gt; is used to indicate italics), from the lookup table used by
the transforms (omitting the expansions of the abbreviations that are in the
lookup table also):

&lt;abbr xml:id=&quot;st001&quot;&gt;&lt;i&gt;Cal. Franklin Papers&lt;/i&gt;, A.P.S.&lt;/abbr&gt;
&lt;abbr xml:id=&quot;st002&quot;&gt;Jay, &lt;i&gt;Unpublished Papers&lt;/i&gt;&lt;/abbr&gt;
&lt;abbr xml:id=&quot;st003&quot;&gt;&lt;i&gt;JCC&lt;/i&gt;&lt;/abbr&gt;
&lt;abbr xml:id=&quot;st004&quot;&gt;&lt;i&gt;Oxford Classical Dicy.&lt;/i&gt;&lt;/abbr&gt;
&lt;abbr xml:id=&quot;st005&quot;&gt;U.S. Census, 1790&lt;/abbr&gt;

In the incoming XML, abbreviations like those above appear in running text
without wrapper elements. The automated process to add wrappers needs to
operate on string values that often cross &lt;i&gt; boundaries., as in the first two
examples. So one might find in running text:

    &lt;note&gt;See for example Jay, &lt;i&gt;Unpublished Papers&lt;/i&gt;, 4:123.&lt;/note&gt;

which needs to be transformed into

    &lt;note&gt;See for example &lt;ref target=&quot;st002&quot;&gt;Jay, &lt;i&gt;Unpublished
Papers&lt;/i&gt;&lt;/ref&gt;, 4:123.&lt;/note&gt;

The XPath //note[matches(., 'Jay, Unpublished Papers')] will match the  input
&lt;note&gt;, but the complexity is writing a template that wraps the appropriate
portions of the note in a &lt;ref&gt; element. That's why our preprocessing converts
&lt;i&gt; tags in both input and lookup table to single text characters to make the
string matching relatively simple.

And we do in fact use unusual Unicode for markers in our current transform,
the example I gave substituted markers that would show up in everyone's
email.

David

On Apr 8, 2013, at 2:58 PM, Michael M|ller-Hillebrand &lt;mmh@xxxxxxxxx&gt; wrote:

&gt; David,
&gt;
&gt; Can you give a more complex example, how &quot;variable in structure&quot; those
citations may be. This may also shed some light on the kind of processing you
want to do. Changing tags to characters (why are you using ASCII instead of
some high Unicode character from the private use area?) and then back to tags
seems not a very interesting thing
&gt;
&gt; - Michael
&gt;
&gt; Am 08.04.2013 um 20:15 schrieb David Sewell &lt;dsewell@xxxxxxxxxxxx&gt;:
&gt;
&gt;&gt; I expect this has been discussed here before, but I can't locate any
relevant
&gt;&gt; discussion, so here goes.
&gt;&gt;
&gt;&gt; We have input data with many unmarked short-title citations that look like
this:
&gt;&gt;
&gt;&gt;  Sprague, &lt;hi rend=&quot;italic&quot;&gt;Braintree Families&lt;/hi&gt;
&gt;&gt;
&gt;&gt; We want to wrap them inside another element, in our case a &lt;ref&gt; to the
&gt;&gt; bibliographic expansion. We have a venerable chain of XSLT 2.0 transforms
that
&gt;&gt; does this, and pretty well, by preprocessing the data to convert all those
&lt;hi&gt;
&gt;&gt; tags into a pair of unique ASCII characters, so that we can do
string-matching
&gt;&gt; operations within a single text node that now includes something like
&gt;&gt;
&gt;&gt;  Sprague, &quot;Braintree Families%
&gt;&gt;
&gt;&gt; which is easy to handle with xsl:analyze-string. then once we've wrapped
all the
&gt;&gt; strings we need to, we post-process with xsl:analyze-string to put the &lt;hi&gt;
&gt;&gt; elements back in.
&gt;&gt;
&gt;&gt; In practice, given the proper regexes, this works quite well and provides
the
&gt;&gt; desired output, but I always feel a bit guilty about the hackishness of the
&gt;&gt; approach. Given that the citations are quite variable in structure (usually
but
&gt;&gt; not always containing &lt;hi&gt; elements, with various combinations of text
nodes at
&gt;&gt; start and end), I've never come up with a good general-purpose way to
operate
&gt;&gt; purely on elements and text nodes without the convert-tags-to-characters
step.
&gt;&gt; Is there one (or more)?
&gt;&gt;
&gt;&gt; David S.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post50030.html</link><pubDate>Mon, 08 Apr 2013 16:26:06 GMT</pubDate></item><item><title> Matching string values across element boundaries</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>I expect this has been discussed here before, but I can't locate any relevant
discussion, so here goes.

We have input data with many unmarked short-title citations that look like
this:

   Sprague, &lt;hi rend=&quot;italic&quot;&gt;Braintree Families&lt;/hi&gt;

We want to wrap them inside another element, in our case a &lt;ref&gt; to the
bibliographic expansion. We have a venerable chain of XSLT 2.0 transforms that
does this, and pretty well, by preprocessing the data to convert all those
&lt;hi&gt;
tags into a pair of unique ASCII characters, so that we can do string-matching
operations within a single text node that now includes something like

   Sprague, &quot;Braintree Families%

which is easy to handle with xsl:analyze-string. then once we've wrapped all
the
strings we need to, we post-process with xsl:analyze-string to put the &lt;hi&gt;
elements back in.

In practice, given the proper regexes, this works quite well and provides the
desired output, but I always feel a bit guilty about the hackishness of the
approach. Given that the citations are quite variable in structure (usually
but
not always containing &lt;hi&gt; elements, with various combinations of text nodes
at
start and end), I've never come up with a good general-purpose way to operate
purely on elements and text nodes without the convert-tags-to-characters step.
Is there one (or more)?

David S.

--
David Sewell, Editorial and Technical Manager
ROTUNDA, The University of Virginia Press
PO Box 400314, Charlottesville, VA 22904-4314 USA
Email: dsewell@xxxxxxxxxxxx   Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post30030.html</link><pubDate>Mon, 08 Apr 2013 14:15:28 GMT</pubDate></item><item><title>Re:  CSSXX to XML</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 03/30/2013 09:03 PM, Dorothy Hoskins wrote:</tt><br>
<br>
<tt>https://github.com/andriy-gerasika/css2xml</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post90020.html</link><pubDate>Fri, 05 Apr 2013 14:01:04 GMT</pubDate></item><item><title>Re:  Cannot write more than one result document to the </title><description><![CDATA[<!--X-Body-of-Message-->
<tt>At 2013-04-04 20:22 -0700, Dan Vint wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>Thanks, I can see that argument. but now you open a can of worms for 
me. So say your template for b just writes output to the standard 
result tree (not separate files). Why doesn't the same argument for 
parallelism apply there?
</tt></blockquote><tt><br>It is sitting in memory waiting to be rearranged.</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>Probably answering my own question here, I'm guessing the difference 
is writing to a file more or less serially vs writing to a tree. The 
processor can write to multiple locations in the tree and keep track 
of where multiple b outputs should be created, but not as well 
supported writing to a file from multiple sources (unless your 
willing to live with jumbled results in the file).
</tt></blockquote><tt><br>I couldn't have said it better myself.</tt><br>
<br>
<tt>Good luck in your project!</tt><br>
<br>
<tt>. . . . . . . . . Ken</tt><br>
<br>
<pre style="margin: 0em;"><br>--
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post20030.html</link><pubDate>Fri, 05 Apr 2013 11:08:12 GMT</pubDate></item><item><title> Balisage 2013</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Is good publicity for you now. Can you repurpose one
of your humanities ones?

Papers are due 22 April (the 19th extended)

This is your wakeup call.


--Debbie

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post10030.html</link><pubDate>Fri, 05 Apr 2013 10:55:12 GMT</pubDate></item><item><title>Re:  Cannot write more than one result document to the </title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Dan,

In your own answer to your own question you also have another solution
to your problem: generate your results in a temporary tree, then
serialize that, taking care when you do so not to serialize the same
results more than once.

This is essentially Ken's solution (offered early in the thread)
except it determines whether results are being duplicated after
generating them (but before serializing them), not before. This may
make it a bit more robust in the face of complexity -- and it also
exposes the extra work you are asking the processor to do, which Ken's
heuristic approach avoids. (So I'd probably prefer Ken's way at least
until things got really complicated.)

Cheers, Wendell

On Thu, Apr 4, 2013 at 11:22 PM, Dan Vint &lt;dvint@xxxxxxxxx&gt; wrote:
&gt; Thanks, I can see that argument. but now you open a can of worms for me. So
&gt; say your template for b just writes output to the standard result tree (not
&gt; separate files). Why doesn't the same argument for parallelism apply there?
&gt;
&gt; Probably answering my own question here, I'm guessing the difference is
&gt; writing to a file more or less serially vs writing to a tree. The processor
&gt; can write to multiple locations in the tree and keep track of where multiple
&gt; b outputs should be created, but not as well supported writing to a file
&gt; from multiple sources (unless your willing to live with jumbled results in
&gt; the file).
&gt;
&gt; Thanks again.
&gt;
&gt; ..dan
&gt;
&gt;
&gt; At 07:56 PM 4/4/2013, you wrote:
&gt;&gt;
&gt;&gt; At 2013-04-04 19:37 -0700, Dan Vint wrote:
&gt;&gt;&gt;
&gt;&gt;&gt; I can live with the rule, just would like to understand the logic.
&gt;&gt;
&gt;&gt;
&gt;&gt; Consider the following scenario.  An XML document has two elements &lt;b&gt;:
&gt;&gt;
&gt;&gt;   &lt;a&gt;
&gt;&gt;     &lt;b id=&quot;1&quot;&gt;...&lt;/b&gt;
&gt;&gt;     &lt;b id=&quot;2&quot;&gt;...&lt;/b&gt;
&gt;&gt;   &lt;/a&gt;
&gt;&gt;
&gt;&gt; An XSLT stylesheet uses the built-in template rule for &lt;a&gt; and has a
&gt;&gt; template rule for &lt;b&gt;:
&gt;&gt;
&gt;&gt;    &lt;xsl:template match=&quot;b&quot;&gt;
&gt;&gt;      &lt;xsl:result-document href=&quot;output.xml&quot;&gt;
&gt;&gt;        &lt;xsl:copy-of select=&quot;.&quot;/&gt;
&gt;&gt;      &lt;/xsl:result-document&gt;
&gt;&gt;    &lt;/xsl:template&gt;
&gt;&gt;
&gt;&gt; If the specification allowed this, then without considering the
&gt;&gt; opportunities of parallelism, one might come to the conclusion that the file
&gt;&gt; &quot;output.xml&quot; would always contain:
&gt;&gt;
&gt;&gt;     &lt;b id=&quot;1&quot;&gt;...&lt;/b&gt;&lt;b id=&quot;2&quot;&gt;...&lt;/b&gt;
&gt;&gt;
&gt;&gt; The problem is that the specification does not require the XSLT processor
&gt;&gt; to complete the processing of the first &lt;b&gt; before starting or even ending
&gt;&gt; the processing of the second &lt;b&gt;.  Sure a single-process implementation &quot;X&quot;
&gt;&gt; likely would.  But a parallelized (is that a word?) implementation &quot;Y&quot;
&gt;&gt; running on multiple CPUs could very well fully process the second &lt;b&gt; before
&gt;&gt; the first &lt;b&gt; if it chose to do so.  Its only obligation is to arrange the
&gt;&gt; resulting tree with the result of processing the first &lt;b&gt; before the result
&gt;&gt; of processing the second &lt;b&gt;.  This obligation ensures that the result of
&gt;&gt; processing by &quot;X&quot; is identical to the result of processing by &quot;Y&quot;.  But
&gt;&gt; there is no obligation on what the processor does to get to that result.
&gt;&gt;
&gt;&gt; When using &lt;xsl:result-document&gt; the processor is not building the result
&gt;&gt; tree.  It is creating a completely separate result.  If the instruction
&gt;&gt; required &quot;re-opening&quot; of the file for append, processor &quot;X&quot; likely would
&gt;&gt; produce the expected result, but processor &quot;Y&quot; in the situation above would
&gt;&gt; produce an unexpected result.  Two processors would produce two results.
&gt;&gt;
&gt;&gt; And this is also why one cannot assert that the writing to the file is
&gt;&gt; even finished before the next attempt to write to the file starts.  The file
&gt;&gt; handle could very well still be left open by one parallel process when the
&gt;&gt; other is ready to open it for itself.  So it can't be used even if the file
&gt;&gt; is opened for write and not for append.
&gt;&gt;
&gt;&gt; Note that some of my students have come to class thinking that you have to
&gt;&gt; fully complete an &lt;xsl:result-document&gt; before starting another one to
&gt;&gt; another URI, but I tell them that is not the case.  You can nest
&gt;&gt; &lt;xsl:result-document&gt; instructions to different URI target locations, and
&gt;&gt; the nested &lt;xsl:result-document&gt; will complete the nested file and resume
&gt;&gt; the &quot;outer&quot; file output when done, without having to close and re-open the
&gt;&gt; outer file.  This has been a very handy feature when fragmenting files.  And
&gt;&gt; this would be another reason not to allow the same URI to be used.
&gt;&gt;
&gt;&gt;&gt; I know the what now, even though I don't understand why the rule exists
&gt;&gt;&gt; ;-)
&gt;&gt;
&gt;&gt;
&gt;&gt; I hope the explanation above has helped.
&gt;&gt;
&gt;&gt; . . . . . . . . . Ken
&gt;&gt;
&gt;&gt; --
&gt;&gt; Contact us for world-wide XML consulting and instructor-led training |
&gt;&gt; Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
&gt;&gt; Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
&gt;&gt; G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
&gt;&gt; Google+ profile: https://plus.google.com/116832879756988317389/about |
&gt;&gt; Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |
&gt;&gt;
&gt;
&gt; ---------------------------------------------------------------------------
&gt; Danny Vint
&gt;
&gt; Panoramic Photography
&gt; http://www.dvint.com
&gt;
&gt; voice: 619-938-3610
&gt;



-- 
Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables
_____oo_________o_o___ooooo____ooooooo_^

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post00030.html</link><pubDate>Fri, 05 Apr 2013 09:18:13 GMT</pubDate></item><item><title>Re:  Cannot write more than one result document to the </title><description><![CDATA[<!--X-Body-of-Message-->
<pre>&gt; The problem is that the specification does not require the XSLT processor to
complete the processing of the first &lt;b&gt; before starting or even ending the
processing of the second &lt;b&gt;.  Sure a single-process implementation &quot;X&quot; likely
would.  But a parallelized (is that a word?) implementation &quot;Y&quot; running on
multiple CPUs could very well fully process the second &lt;b&gt; before the first
&lt;b&gt; if it chose to do so.  Its only obligation is to arrange the resulting
tree with the result of processing the first &lt;b&gt; before the result of
processing the second &lt;b&gt;.  This obligation ensures that the result of
processing by &quot;X&quot; is identical to the result of processing by &quot;Y&quot;.  But there
is no obligation on what the processor does to get to that result.
&gt;
&gt; When using &lt;xsl:result-document&gt; the processor is not building the result
tree.  It is creating a completely separate result.  If the instruction
required &quot;re-opening&quot; of the file for append, processor &quot;X&quot; likely would
produce the expected result, but processor &quot;Y&quot; in the situation above would
produce an unexpected result.  Two processors would produce two results.
&gt;
&gt; And this is also why one cannot assert that the writing to the file is even
finished before the next attempt to write to the file starts.  The file handle
could very well still be left open by one parallel process when the other is
ready to open it for itself.  So it can't be used even if the file is opened
for write and not for append.
&gt;
Indeed. Saxon-EE 9.5 will execute xsl:result-document instructions
asynchronously, so the rule in the spec that you can't write two documents to
the same URI turns out to be very useful. If you do something like this:

&lt;xsl:for-each select=&quot;employee&quot;&gt;
 &lt;xsl:result-document href=&quot;{@ssn}&quot;&gt;
   &lt;xsl:copy-of select=&quot;.&quot;/&gt;
 &lt;/xsl:result-document&gt;
&lt;/xsl:for-each&gt;

then you might well have a dozen threads operating at once, each copying a
different employee element to a different result file. If the URIs were not
unique, this would cause havoc - in fact the optimization would not really be
possible.

I can see why you find the rule irritating - I've been in the same situation
myself - but it's there for a very good reason.

And by the way, your mental model that the result file is closed when the
xsl:result-document end tag is encountered might be a convenient way of
thinking about things, and perhaps not even too far from reality, but it's not
the way the semantics of the language work, and sooner or later it will lead
to difficulties in understanding what's going on. It's a bit like imagining
that when you do readFile('xyz') in Java, the file is closed when the closing
')' is encountered.

Michael Kay
Saxonica

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post80020.html</link><pubDate>Fri, 05 Apr 2013 09:08:18 GMT</pubDate></item><item><title>Re:  Cannot write more than one result document to the </title><description><![CDATA[<!--X-Body-of-Message-->
<tt>At 2013-04-04 19:37 -0700, Dan Vint wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>I can live with the rule, just would like to understand the logic.
</tt></blockquote><tt><br>Consider the following scenario.  An XML document has two elements &lt;b&gt;:</tt><br>
<br>
<pre style="margin: 0em;">  &lt;a&gt;
    &lt;b id=&quot;1&quot;&gt;...&lt;/b&gt;
    &lt;b id=&quot;2&quot;&gt;...&lt;/b&gt;
  &lt;/a&gt;</pre><br>
<tt>An XSLT stylesheet uses the built-in template rule for &lt;a&gt; and has a 
template rule for &lt;b&gt;:</tt><br>
<br>
<pre style="margin: 0em;">   &lt;xsl:template match=&quot;b&quot;&gt;
     &lt;xsl:result-document href=&quot;output.xml&quot;&gt;
       &lt;xsl:copy-of select=&quot;.&quot;/&gt;
     &lt;/xsl:result-document&gt;
   &lt;/xsl:template&gt;</pre><br>
<tt>If the specification allowed this, then without considering the 
opportunities of parallelism, one might come to the conclusion that 
the file &quot;output.xml&quot; would always contain:</tt><br>
<br>
<tt>    &lt;b id=&quot;1&quot;&gt;...&lt;/b&gt;&lt;b id=&quot;2&quot;&gt;...&lt;/b&gt;</tt><br>
<br>
<tt>The problem is that the specification does not require the XSLT 
processor to complete the processing of the first &lt;b&gt; before starting 
or even ending the processing of the second &lt;b&gt;.  Sure a 
single-process implementation &quot;X&quot; likely would.  But a parallelized 
(is that a word?) implementation &quot;Y&quot; running on multiple CPUs could 
very well fully process the second &lt;b&gt; before the first &lt;b&gt; if it 
chose to do so.  Its only obligation is to arrange the resulting tree 
with the result of processing the first &lt;b&gt; before the result of 
processing the second &lt;b&gt;.  This obligation ensures that the result 
of processing by &quot;X&quot; is identical to the result of processing by 
&quot;Y&quot;.  But there is no obligation on what the processor does to get to 
that result.</tt><br>
<br>
<tt>When using &lt;xsl:result-document&gt; the processor is not building the 
result tree.  It is creating a completely separate result.  If the 
instruction required &quot;re-opening&quot; of the file for append, processor 
&quot;X&quot; likely would produce the expected result, but processor &quot;Y&quot; in 
the situation above would produce an unexpected result.  Two 
processors would produce two results.</tt><br>
<br>
<tt>And this is also why one cannot assert that the writing to the file 
is even finished before the next attempt to write to the file 
starts.  The file handle could very well still be left open by one 
parallel process when the other is ready to open it for itself.  So 
it can't be used even if the file is opened for write and not for append.</tt><br>
<br>
<tt>Note that some of my students have come to class thinking that you 
have to fully complete an &lt;xsl:result-document&gt; before starting 
another one to another URI, but I tell them that is not the 
case.  You can nest &lt;xsl:result-document&gt; instructions to different 
URI target locations, and the nested &lt;xsl:result-document&gt; will 
complete the nested file and resume the &quot;outer&quot; file output when 
done, without having to close and re-open the outer file.  This has 
been a very handy feature when fragmenting files.  And this would be 
another reason not to allow the same URI to be used.</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>I know the what now, even though I don't understand why the rule exists ;-)
</tt></blockquote><tt><br>I hope the explanation above has helped.</tt><br>
<br>
<tt>. . . . . . . . . Ken</tt><br>
<br>
<pre style="margin: 0em;">--
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post60020.html</link><pubDate>Thu, 04 Apr 2013 22:56:54 GMT</pubDate></item><item><title>Re:  Cannot write more than one result document to the </title><description><![CDATA[<!--X-Body-of-Message-->
<pre>On 4 Apr 2013, at 21:42, dvint@xxxxxxxxx wrote:

&gt; I understand why this might be an issue to have two different streams
&gt; writing to the same file, but should this always fail just because the
&gt; file is opened twice for write in one stylesheet?

It's not clear what you would like to happen. Do you want to see both outputs
appended to the same file? Even though it wouldn't be well-formed XML? Even
though the order of the results is unpredictable?

Or would you like one of the outputs to overwrite the other?

In fact, it's not too hard to workaround this problem. Add some kind of random
suffix to the URL generated in the result-document href attribute, and write
an OutputURIResolver that causes this suffix to be ignored.

Michael Kay
Saxonica

&gt;
&gt; I'm trying to process some DITA content that is using conrefs (think
&gt; xinclude statements). So I have one file that makes 2 references to
&gt; another file to include content from that second file.
&gt;
&gt; We want to change this arrangement such that there is only one includable
&gt; section in a given file. So I'm splitting the second file into 2 new files
&gt; and modifying the references accordingly in the first.
&gt;
&gt; Here is s simplified view of what is going on (for those that know DITA
&gt; please excuse the pseudo code):
&gt;
&gt; Topic file structure:
&gt;
&gt; &lt;concept&gt;
&gt;   &lt;h1 conref=&quot;file2.xml#sysoutput&quot;&gt;&lt;/h1&gt;
&gt;   &lt;h2 conref=file2.xml#inline&quot;&gt;&lt;/h2&gt;
&gt; &lt;/concept&gt;
&gt;
&gt;
&gt; File2.xml structure:
&gt;
&gt; &lt;concept&gt;
&gt;    &lt;h1 id=&quot;sysoutput&quot;&gt;
&gt;       &lt;p&gt;This is the first set of content&lt;/p&gt;
&gt;    &lt;/h1&gt;
&gt;    &lt;h2 id=&quot;inline&quot;&gt;
&gt;       &lt;p&gt;this is the second referenced content&lt;/p&gt;
&gt;    &lt;/h2&gt;
&gt; &lt;/concept&gt;
&gt;
&gt; Need to change this to be:
&gt;
&gt;
&gt; Topic file structure:
&gt;
&gt; &lt;concept&gt;
&gt;   &lt;h1 conref=&quot;file2-sysoutput.xml#sysoutput&quot;&gt;&lt;/h1&gt;
&gt;   &lt;h2 conref=file2-inline.xml#inline&quot;&gt;&lt;/h2&gt;
&gt; &lt;/concept&gt;
&gt;
&gt;
&gt; File2-sysoutput.xml structure:
&gt;
&gt; &lt;concept&gt;
&gt;    &lt;h1 id=&quot;sysoutput&quot;&gt;
&gt;       &lt;p&gt;This is the first set of content&lt;/p&gt;
&gt;    &lt;/h1&gt;
&gt; &lt;/concept&gt;
&gt;
&gt;
&gt; File2-inline.xml structure:
&gt;
&gt; &lt;concept&gt;
&gt;    &lt;h2 id=&quot;inline&quot;&gt;
&gt;       &lt;p&gt;this is the second referenced content&lt;/p&gt;
&gt;    &lt;/h2&gt;
&gt; &lt;/concept&gt;
&gt;
&gt;
&gt; So my stylesheet is processing the topic file. I have a template that is
&gt; triggered when an @conref attribute is found and it creates the new
&gt; attribute value as well as making the new file.
&gt;
&gt; &lt;xsl:template name=&quot;make-conref&quot;&gt;
&gt; &lt;xsl:param name=&quot;file&quot; as=&quot;xs:string&quot;/&gt;
&gt; &lt;xsl:param name=&quot;conref-sourcefile&quot; as=&quot;xs:string&quot;/&gt;
&gt;  &lt;xsl:result-document method=&quot;xml&quot;  encoding=&quot;UTF-8&quot; href=&quot;{$file}&quot;&gt;
&gt;     &lt;concept&gt;
&gt; 	&lt;xsl:apply-templates select=&quot;doc($conref-sourcefile)//*[@id=$target-id]&quot;/&gt;
&gt;     &lt;/concept&gt;
&gt;  &lt;/xsl:result-document&gt;
&gt;
&gt; &lt;!-- return the new conref statement to replace the one we found --&gt;
&gt;   &lt;xsl:attribute name=&quot;conref&quot; select=&quot;$newconref&quot;/&gt;
&gt; &lt;/xsl:template&gt;
&gt;
&gt; So this template gets the modified filename that uses the id value to make
&gt; it unique, processes the included section and closes the result document
&gt; before continuing to the next content.
&gt;
&gt; I could see this error being raised if one of the conref'd sections
&gt; actually made a circular reference to itself, but I have not been able to
&gt; find this situation.
&gt;
&gt; One other detail is I'm using Kernow to process a directory with the same
&gt; stylesheet. So maybe there is something with the caching going on? I've
&gt; set the multi-threading to use a single thread so there should be no
&gt; collisions there.
&gt;
&gt; Kernow reports that it is net.sf.saxon.trans.XPathException throwing the
&gt; error.
&gt;
&gt; ..dan

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post90010.html</link><pubDate>Thu, 04 Apr 2013 22:18:37 GMT</pubDate></item><item><title>Re:  Cannot write more than one result document to the </title><description><![CDATA[<!--X-Body-of-Message-->
<pre>On Thu, 2013-04-04 at 16:46 -0700, Dan Vint wrote:
&gt; I guess what I'm expecting is that the result document is closed once 
&gt; the &lt;/xslt:result-document&gt; end tag is found.

This is a procedural do-this-then-that way of looking at XSLT.

However, XSLT stylesheets can be evaluated in any order, as long as the
end result meets the spec. XSLT is not a first-this-then-that language.

In addition, the XSLT stylesheet is read into memory and parsed long
before it's executed, so finding an end tag just marks the boundary of a
node in a tree.

Hope this helps.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post30020.html</link><pubDate>Thu, 04 Apr 2013 21:53:13 GMT</pubDate></item><item><title>Re:  Cannot write more than one result document to the </title><description><![CDATA[<!--X-Body-of-Message-->
<tt>At 2013-04-04 16:46 -0700, Dan Vint wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>I guess what I'm expecting is that the result document is closed 
once the &lt;/xslt:result-document&gt; end tag is found.
</tt></blockquote><tt><br>Yes, it is.</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>Instead XSLT seems to keep this memory around that it is there.
</tt></blockquote><tt><br>No, not in memory.</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>I'm happy with just over writing the last file created as it is all 
the same content each time.
</tt></blockquote><tt><br>Fine ... if you can make the assumption that the same conref 
attribute will create the same output, then I have a suggestion for you.</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>Yeah maybe inefficient, but I expected it to work. Out of 3000 files 
I have to process with lots of need for this file splitting I found 
2 that complain about writing to the same result document.
</tt></blockquote><tt><br>But that complaint isn't superfluous, it is explicit in the specification:</tt><br>
<br>
<pre style="margin: 0em;">  http://www.w3.org/TR/2007/REC-xslt20-20070123/#element-result-document
  [ERR XTDE1490] It is a non-recoverable dynamic error for
  a transformation to generate two or more final result
  trees with the same URI.</pre><br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>With the first posting I wasn't sure where in the processing this 
was occurring, then I found the files that actually were trying to 
create the file twice. I still don't understand why this is a 
problem when the output file should be closed by the time the next 
write sequence is started.
</tt></blockquote><tt><br>It isn't a problem with the implementation, it is a formal aspect of 
the specification as cited above.</tt><br>
<br>
<tt>Could you simply check back to make sure you haven't already created the file?</tt><br>
<br>
<pre style="margin: 0em;">   &lt;xsl:if test=&quot;not(preceding::*[@conref=current()/@conref])&quot;&gt;
     &lt;xsl:result-document href=.......</pre><br>
<tt>So, for every unique conref attribute you'll get only a single 
invocation of &lt;xsl:result-document&gt;.</tt><br>
<br>
<tt>I hope this helps.</tt><br>
<br>
<tt>. . . . . . . . . Ken</tt><br>
<br>
<pre style="margin: 0em;">--
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post20020.html</link><pubDate>Thu, 04 Apr 2013 21:52:01 GMT</pubDate></item><item><title> [Ann] A new desktop app for syntax-highlighting and  f</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Dear list,

I'm pleased to a new and very simple desktop tool.

XMLSpectrum-FX is a cross-platform open-source product, it generates
syntax-highlighted and formatted HTML from source code files or
snippets of XPath, XSLT (including 3.0), XProc, XML Schema and other
XML standards (currently working on XQuery support).

This tool is effectively a graphical front-end for the (GitHub hosted)
XMLSpectrum project which comprises a small set of XSLT files. The
front-end provides control for all the transform settings whilst the
XSLT is responsible for the parsing and rendering of the code. The
result of the transfrom is rendered in the embedded Webkit-based
browser.

For input, files can be drag and dropped onto the tool, URLs entered,
or code snippets copied and pasted into a text area.

(Note: Saxon-HE from Saxonica is used for all XSLT processing and is
distributed as part of the download.)

XMLSpectrum pays particular attention to the preservation of
whitespace and syntax-coloring of XPath. It is also capable of
correcting XML indentation that has gone wrong without corrupting the
relative indentation within the XML content (attributes or otherwise).

To help keep this product light, some of the more powerful XMLSpecturm
features such as XSLT package support are not included just yet.

Parts of this product have a dependency on Java 1.7.0_07 (due to the
use of Java-FX 2.0).

More details and the product download are available from the product site at:

http://qutoric.com/xmlspectrum/

Many thanks

Phil Fearon

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post60010.html</link><pubDate>Thu, 04 Apr 2013 20:26:36 GMT</pubDate></item><item><title>Re:  Cannot write more than one result document to the </title><description><![CDATA[<!--X-Body-of-Message-->
<tt>Thanks, I can see that argument. but now you open a can of worms for 
me. So say your template for b just writes output to the standard 
result tree (not separate files). Why doesn't the same argument for 
parallelism apply there?</tt><br>
<br>
<tt>Probably answering my own question here, I'm guessing the difference 
is writing to a file more or less serially vs writing to a tree. The 
processor can write to multiple locations in the tree and keep track 
of where multiple b outputs should be created, but not as well 
supported writing to a file from multiple sources (unless your 
willing to live with jumbled results in the file).</tt><br>
<br>
<tt>Thanks again.</tt><br>
<br>
<tt>..dan</tt><br>
<br>
<tt>At 07:56 PM 4/4/2013, you wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>At 2013-04-04 19:37 -0700, Dan Vint wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>I can live with the rule, just would like to understand the logic.
</tt></blockquote><tt><br>Consider the following scenario.  An XML document has two elements &lt;b&gt;:</tt><br>
<br>
<pre style="margin: 0em;">  &lt;a&gt;
    &lt;b id=&quot;1&quot;&gt;...&lt;/b&gt;
    &lt;b id=&quot;2&quot;&gt;...&lt;/b&gt;
  &lt;/a&gt;</pre><br>
<tt>An XSLT stylesheet uses the built-in template rule for &lt;a&gt; and has a 
template rule for &lt;b&gt;:</tt><br>
<br>
<pre style="margin: 0em;">   &lt;xsl:template match=&quot;b&quot;&gt;
     &lt;xsl:result-document href=&quot;output.xml&quot;&gt;
       &lt;xsl:copy-of select=&quot;.&quot;/&gt;
     &lt;/xsl:result-document&gt;
   &lt;/xsl:template&gt;</pre><br>
<tt>If the specification allowed this, then without considering the 
opportunities of parallelism, one might come to the conclusion that 
the file &quot;output.xml&quot; would always contain:</tt><br>
<br>
<tt>    &lt;b id=&quot;1&quot;&gt;...&lt;/b&gt;&lt;b id=&quot;2&quot;&gt;...&lt;/b&gt;</tt><br>
<br>
<tt>The problem is that the specification does not require the XSLT 
processor to complete the processing of the first &lt;b&gt; before 
starting or even ending the processing of the second &lt;b&gt;.  Sure a 
single-process implementation &quot;X&quot; likely would.  But a parallelized 
(is that a word?) implementation &quot;Y&quot; running on multiple CPUs could 
very well fully process the second &lt;b&gt; before the first &lt;b&gt; if it 
chose to do so.  Its only obligation is to arrange the resulting 
tree with the result of processing the first &lt;b&gt; before the result 
of processing the second &lt;b&gt;.  This obligation ensures that the 
result of processing by &quot;X&quot; is identical to the result of processing 
by &quot;Y&quot;.  But there is no obligation on what the processor does to 
get to that result.</tt><br>
<br>
<tt>When using &lt;xsl:result-document&gt; the processor is not building the 
result tree.  It is creating a completely separate result.  If the 
instruction required &quot;re-opening&quot; of the file for append, processor 
&quot;X&quot; likely would produce the expected result, but processor &quot;Y&quot; in 
the situation above would produce an unexpected result.  Two 
processors would produce two results.</tt><br>
<br>
<tt>And this is also why one cannot assert that the writing to the file 
is even finished before the next attempt to write to the file 
starts.  The file handle could very well still be left open by one 
parallel process when the other is ready to open it for itself.  So 
it can't be used even if the file is opened for write and not for append.</tt><br>
<br>
<tt>Note that some of my students have come to class thinking that you 
have to fully complete an &lt;xsl:result-document&gt; before starting 
another one to another URI, but I tell them that is not the 
case.  You can nest &lt;xsl:result-document&gt; instructions to different 
URI target locations, and the nested &lt;xsl:result-document&gt; will 
complete the nested file and resume the &quot;outer&quot; file output when 
done, without having to close and re-open the outer file.  This has 
been a very handy feature when fragmenting files.  And this would be 
another reason not to allow the same URI to be used.</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>I know the what now, even though I don't understand why the rule exists ;-)
</tt></blockquote><tt><br>I hope the explanation above has helped.</tt><br>
<br>
<tt>. . . . . . . . . Ken</tt><br>
<br>
<pre style="margin: 0em;">--
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |</pre><br>
</blockquote><pre style="margin: 0em;"><br>---------------------------------------------------------------------------
Danny Vint</pre><br>
<pre style="margin: 0em;">Panoramic Photography
http://www.dvint.com</pre><br>
<tt>voice: 619-938-3610</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post70020.html</link><pubDate>Thu, 04 Apr 2013 20:22:20 GMT</pubDate></item><item><title>Re:  Cannot write more than one result document to the </title><description><![CDATA[<!--X-Body-of-Message-->
<tt>At 06:52 PM 4/4/2013, you wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>It isn't a problem with the implementation, it is a formal aspect of 
the specification as cited above.
</tt></blockquote><tt><br>I figured it probably was, I guess I'm also asking why you would want 
to turn off the capability when it is safe? I know I've completed 
writing to that file, so why is there a problem - other than some 
where in developing the spec someone came up with a rule. I can live 
with the rule, just would like to understand the logic.</tt><br>
<br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>Could you simply check back to make sure you haven't already created the file?</tt><br>
<br>
<pre style="margin: 0em;">   &lt;xsl:if test=&quot;not(preceding::*[@conref=current()/@conref])&quot;&gt;
     &lt;xsl:result-document href=.......</pre><br>
<tt>So, for every unique conref attribute you'll get only a single 
invocation of &lt;xsl:result-document&gt;.
</tt></blockquote><tt></tt><br>
<br>
<tt>When I originally posted the question it was to answer the why and 
also get some help in trying to track down where the problem was. I 
thought my original situation was as I first posted in which I was 
writing 2 different file names. I hadn't found the one file in the 
3000 that was really causing the problem which was my follow up post 
in which I had 2 references to the same section and was thus writing 
the same file twice for that one topic file. I also knew that There 
were several other files with exactly the same combination of 
references. I needed to make sure I had a single file for all those 
references as we will be maintaining these going forward.</tt><br>
<br>
<tt>Complicating the matter was that I was running within Kernow and it 
was handling the logic to walk through the directory structure and 
process the files. Its log output doesn't always align with the last 
file processed. So based upon files that were around my error in the 
list I was finding my initial situation and couldn't understand why 
it was complaining - I had two unique names.</tt><br>
<br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>I hope this helps.
</tt></blockquote><tt><br>It does, thanks everyone. I know the what now, even though I don't 
understand why the rule exists ;-)</tt><br>
<br>
<pre style="margin: 0em;">..dan
---------------------------------------------------------------------------
Danny Vint</pre><br>
<pre style="margin: 0em;">Panoramic Photography
http://www.dvint.com</pre><br>
<tt>voice: 619-938-3610</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post50020.html</link><pubDate>Thu, 04 Apr 2013 19:37:48 GMT</pubDate></item><item><title>Re:  Cannot write more than one result document to the </title><description><![CDATA[<!--X-Body-of-Message-->
<tt>It may be but there are aspects of a procedural language in XSLT. I 
don't mind it catching the error that I truly have 2 different 
streams that haven't completed writing their output to a file, but 
why kill the other situation?</tt><br>
<br>
<tt>..dan</tt><br>
<br>
<tt>At 06:53 PM 4/4/2013, you wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">On Thu, 2013-04-04 at 16:46 -0700, Dan Vint wrote:
&gt; I guess what I'm expecting is that the result document is closed once
&gt; the &lt;/xslt:result-document&gt; end tag is found.</pre><br>
<tt>This is a procedural do-this-then-that way of looking at XSLT.</tt><br>
<br>
<pre style="margin: 0em;">However, XSLT stylesheets can be evaluated in any order, as long as the
end result meets the spec. XSLT is not a first-this-then-that language.</pre><br>
<pre style="margin: 0em;">In addition, the XSLT stylesheet is read into memory and parsed long
before it's executed, so finding an end tag just marks the boundary of a
node in a tree.</pre><br>
<tt>Hope this helps.</tt><br>
<br>
<tt>Liam</tt><br>
<br>
<pre style="margin: 0em;">--
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml
</pre></blockquote><pre style="margin: 0em;"><br>---------------------------------------------------------------------------
Danny Vint</pre><br>
<pre style="margin: 0em;">Panoramic Photography
http://www.dvint.com</pre><br>
<tt>voice: 619-938-3610</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post40020.html</link><pubDate>Thu, 04 Apr 2013 19:27:13 GMT</pubDate></item><item><title>Re:  xsl:apply-imports behavior wrong in Saxon?</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>The situation is that you are calling xsl:apply-imports when there is no
matching user-defined template rule in an imported stylesheet.

The XSLT 2.0 specification is clear about what happens here:

&quot;If no matching template rule is found that satisfies these criteria, the
built-in template rule for the node kind is used.&quot;

The XSLT 1.0 specification is less clear on the subject. It says

(a) &quot;xsl:apply-imports processes the current node using only template rules
that were imported into the stylesheet element containing the current template
rule&quot;, and

(b) &quot;The built-in template rules are treated as if they were imported
implicitly before the stylesheet&quot;

My belief is that if you read these two statements together, they indicate
that the same behaviour as in 2.0 is intended. There's room for debate,
however, because of the phrase &quot;before the stylesheet&quot; as distinct from &quot;into
the stylesheet&quot;.

Michael Kay
Saxonica

On 4 Apr 2013, at 17:10, Bob Stayton wrote:

&gt;
&gt; According to Saxon author Michael Kay's website, his description of
&gt; xsl:apply-imports is:
&gt;
&gt; &quot;The effect is to search for a template that matches the current node and
&gt; that is defined in a stylesheet that was imported (directly or indirectly,
&gt; possibly via xsl:include) from the stylesheet containing the current
&gt; template, and whose mode matches the current mode. If there is such a
&gt; template, it is activated using the current node. If not, the call on
&gt; xsl:apply-imports has no effect.&quot;
&gt;
Yes. That was written a long time ago, and it's wrong. I will fix it.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post50010.html</link><pubDate>Thu, 04 Apr 2013 18:38:56 GMT</pubDate></item><item><title> [ANN] No Fooling: Time to Start on Your Balisage Paper</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>OK, I know I &quot;cried wolf&quot; earlier. This time I mean it: the due-date for
submissions to Balisage and the pre-conference Symposium on Native XML
User Interfaces is almost here.

Papers are due on April 19th. That's soon!

Balisage Call for Participation:
http://www.balisage.net/Call4Participation.html
Native XML User Interfaces:
http://www.balisage.net/XML-Interfaces/index.html


Information about Balisage in general: http://www.balisage.net/ or
  info@xxxxxxxxxxxx


======================================================================
Balisage: The Markup Conference 2013          <a  href="mailto:info@xxxxxxxxxxxx">mailto:info@xxxxxxxxxxxx</a>
August 6-9, 2013                              http://www.balisage.net
Preconference Symposium                       August 5, 2012
======================================================================

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post00020.html</link><pubDate>Thu, 04 Apr 2013 17:35:04 GMT</pubDate></item><item><title>Re:  Cannot write more than one result document to the </title><description><![CDATA[<!--X-Body-of-Message-->
<tt>I guess what I'm expecting is that the result document is closed once 
the &lt;/xslt:result-document&gt; end tag is found. Instead XSLT seems to 
keep this memory around that it is there. I'm happy with just over 
writing the last file created as it is all the same content each 
time. Yeah maybe inefficient, but I expected it to work. Out of 3000 
files I have to process with lots of need for this file splitting I 
found 2 that complain about writing to the same result document.</tt><br>
<br>
<tt>With the first posting I wasn't sure where in the processing this was 
occurring, then I found the files that actually were trying to create 
the file twice. I still don't understand why this is a problem when 
the output file should be closed by the time the next write sequence 
is started.</tt><br>
<br>
<tt>I was also getting a successful result when I processed what I 
thought was the problem file as it was difficult to determine in the 
batch mode as to what file was creating the problem.</tt><br>
<br>
<tt>..dan</tt><br>
<br>
<tt><br>At 02:18 PM 4/4/2013, you wrote:</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>On 4 Apr 2013, at 21:42, dvint@xxxxxxxxx wrote:</tt><br>
<br>
<pre style="margin: 0em;">&gt; I understand why this might be an issue to have two different streams
&gt; writing to the same file, but should this always fail just because the
&gt; file is opened twice for write in one stylesheet?</pre><br>
<tt>It's not clear what you would like to happen. Do you want to see 
both outputs appended to the same file? Even though it wouldn't be 
well-formed XML? Even though the order of the results is unpredictable?</tt><br>
<br>
<tt>Or would you like one of the outputs to overwrite the other?</tt><br>
<br>
<tt>In fact, it's not too hard to workaround this problem. Add some kind 
of random suffix to the URL generated in the result-document href 
attribute, and write an OutputURIResolver that causes this suffix to 
be ignored.</tt><br>
<br>
<pre style="margin: 0em;">Michael Kay
Saxonica</pre><br>
<tt>&gt;<br>
&gt; I'm trying to process some DITA content that is using conrefs (think<br>
&gt; xinclude statements). So I have one file that makes 2 references to<br>
&gt; another file to include content from that second file.<br>
&gt;<br>
&gt; We want to change this arrangement such that there is only one includable<br>
&gt; section in a given file. So I'm splitting the second file into 2 new files<br>
&gt; and modifying the references accordingly in the first.<br>
&gt;<br>
&gt; Here is s simplified view of what is going on (for those that know DITA<br>
&gt; please excuse the pseudo code):<br>
&gt;<br>
&gt; Topic file structure:<br>
&gt;<br>
&gt; &lt;concept&gt;<br>
&gt;   &lt;h1 conref=&quot;file2.xml#sysoutput&quot;&gt;&lt;/h1&gt;<br>
&gt;   &lt;h2 conref=file2.xml#inline&quot;&gt;&lt;/h2&gt;<br>
&gt; &lt;/concept&gt;<br>
&gt;<br>
&gt;<br>
&gt; File2.xml structure:<br>
&gt;<br>
&gt; &lt;concept&gt;<br>
&gt;    &lt;h1 id=&quot;sysoutput&quot;&gt;<br>
&gt;       &lt;p&gt;This is the first set of content&lt;/p&gt;<br>
&gt;    &lt;/h1&gt;<br>
&gt;    &lt;h2 id=&quot;inline&quot;&gt;<br>
&gt;       &lt;p&gt;this is the second referenced content&lt;/p&gt;<br>
&gt;    &lt;/h2&gt;<br>
&gt; &lt;/concept&gt;<br>
&gt;<br>
&gt; Need to change this to be:<br>
&gt;<br>
&gt;<br>
&gt; Topic file structure:<br>
&gt;<br>
&gt; &lt;concept&gt;<br>
&gt;   &lt;h1 conref=&quot;file2-sysoutput.xml#sysoutput&quot;&gt;&lt;/h1&gt;<br>
&gt;   &lt;h2 conref=file2-inline.xml#inline&quot;&gt;&lt;/h2&gt;<br>
&gt; &lt;/concept&gt;<br>
&gt;<br>
&gt;<br>
&gt; File2-sysoutput.xml structure:<br>
&gt;<br>
&gt; &lt;concept&gt;<br>
&gt;    &lt;h1 id=&quot;sysoutput&quot;&gt;<br>
&gt;       &lt;p&gt;This is the first set of content&lt;/p&gt;<br>
&gt;    &lt;/h1&gt;<br>
&gt; &lt;/concept&gt;<br>
&gt;<br>
&gt;<br>
&gt; File2-inline.xml structure:<br>
&gt;<br>
&gt; &lt;concept&gt;<br>
&gt;    &lt;h2 id=&quot;inline&quot;&gt;<br>
&gt;       &lt;p&gt;this is the second referenced content&lt;/p&gt;<br>
&gt;    &lt;/h2&gt;<br>
&gt; &lt;/concept&gt;<br>
&gt;<br>
&gt;<br>
&gt; So my stylesheet is processing the topic file. I have a template that is<br>
&gt; triggered when an @conref attribute is found and it creates the new<br>
&gt; attribute value as well as making the new file.<br>
&gt;<br>
&gt; &lt;xsl:template name=&quot;make-conref&quot;&gt;<br>
&gt; &lt;xsl:param name=&quot;file&quot; as=&quot;xs:string&quot;/&gt;<br>
&gt; &lt;xsl:param name=&quot;conref-sourcefile&quot; as=&quot;xs:string&quot;/&gt;<br>
&gt;  &lt;xsl:result-document method=&quot;xml&quot;  encoding=&quot;UTF-8&quot; href=&quot;{$file}&quot;&gt;<br>
&gt;     &lt;concept&gt;<br>
&gt;       &lt;xsl:apply-templates 
select=&quot;doc($conref-sourcefile)//*[@id=$target-id]&quot;/&gt;<br>
&gt;     &lt;/concept&gt;<br>
&gt;  &lt;/xsl:result-document&gt;<br>
&gt;<br>
&gt; &lt;!-- return the new conref statement to replace the one we found --&gt;<br>
&gt;   &lt;xsl:attribute name=&quot;conref&quot; select=&quot;$newconref&quot;/&gt;<br>
&gt; &lt;/xsl:template&gt;<br>
&gt;<br>
&gt; So this template gets the modified filename that uses the id value to make<br>
&gt; it unique, processes the included section and closes the result document<br>
&gt; before continuing to the next content.<br>
&gt;<br>
&gt; I could see this error being raised if one of the conref'd sections<br>
&gt; actually made a circular reference to itself, but I have not been able to<br>
&gt; find this situation.<br>
&gt;<br>
&gt; One other detail is I'm using Kernow to process a directory with the same<br>
&gt; stylesheet. So maybe there is something with the caching going on? I've<br>
&gt; set the multi-threading to use a single thread so there should be no<br>
&gt; collisions there.<br>
&gt;<br>
&gt; Kernow reports that it is net.sf.saxon.trans.XPathException throwing the<br>
&gt; error.<br>
&gt;<br>
&gt; ..dan
</tt></blockquote><pre style="margin: 0em;"><br>---------------------------------------------------------------------------
Danny Vint</pre><br>
<pre style="margin: 0em;">Panoramic Photography
http://www.dvint.com</pre><br>
<tt>voice: 619-938-3610</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post10020.html</link><pubDate>Thu, 04 Apr 2013 16:46:31 GMT</pubDate></item><item><title>Re:  xpath 2 regex</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 04/04/13 13:56, Michael Sokolov wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">It seems likely () (for grouping) was intended rather than [] (for a
character class)?
</pre></blockquote><tt></tt><br>
<br>
<tt>Yes Michael, that makes sense, though testing shows that as unnecessary 
in this simple case.</tt><br>
<br>
<tt><br>regards</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt><br>On 04/04/2013 08:04 AM, David Carlisle wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>On 04/04/2013 13:00, David Carlisle wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>On 04/04/2013 12:40, davep wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">&lt;xsl:template
match=&quot;p[matches(normalize-space(), '^[the quick] |
[brown fox]' )]&quot;</pre><br>
<br>
</blockquote><tt><br>that matches either</tt><br>
<br>
<pre style="margin: 0em;">a string that starts with one of the letters t h e ' ' q u i c k
followed by a space.</pre><br>
<pre style="margin: 0em;">or string that contains
a space followed by one of the letters  b r o w n f x</pre><br>
<br>
</blockquote><tt></tt><br>
<br>
<tt>the second clause should be</tt><br>
<br>
<pre style="margin: 0em;"><br> or string that contains
 a space followed by one of the letters  b r o w n ' ' f x</pre><br>
<pre style="margin: 0em;">Although you can't actually match a space followed by another space in
this context as you have used normalize-space on the input.</pre><br>
<tt>David</tt><br>
<br>
<tt></tt><br>
<br>
<tt></tt><br>
<br>
<pre style="margin: 0em;">________________________________________________________________________
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.</pre><br>
<pre style="margin: 0em;">This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs.
________________________________________________________________________</pre><br>
</blockquote><tt></tt><br>
<br>
</blockquote><tt></tt><br>
<br>
<tt><br>regards</tt><br>
<br>
<pre style="margin: 0em;">--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post20010.html</link><pubDate>Thu, 04 Apr 2013 14:13:07 GMT</pubDate></item><item><title>Re:  xpath 2 regex</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>davep wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>Tks for the quick reply.</tt><br>
<br>
<tt>On 04/04/13 12:49, Martin Honnen wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>davep wrote:</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">If so, what patter matches a p element which starts with
the string &quot;the quick brown&quot; or contains &quot;brown fox&quot; please?
</pre></blockquote><pre style="margin: 0em;"><br>   &lt;xsl:template match=&quot;p[matches(., '(^the quick brown)|brown
fox')]&quot;&gt;...&lt;/xsl:template&gt;
</pre></blockquote><tt><br>Are the brackets necessary Martin?
</tt></blockquote><tt><br>I am not entiry sure they are needed, maybe someone else can tell us, or 
maybe later on I will find time to make sense of the combined schema and 
XPath/XSLT regular expression syntax (which introduced the '^' and '$' 
on top of the schema regular expression syntax).</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post90000.html</link><pubDate>Thu, 04 Apr 2013 14:04:02 GMT</pubDate></item><item><title>Re:  Cannot write more than one result document to the </title><description><![CDATA[<!--X-Body-of-Message-->
<pre>It looks like this is more the issue:

&lt;concept&gt;
   &lt;h1 conref=&quot;file2.xml#sysoutput&quot;&gt;&lt;/h1&gt;
   &lt;h1 conref=file2.xml#sysoutput&quot;&gt;&lt;/h1&gt;
&lt;/concept&gt;

Same situation applies, tha the result document should be closed, but it
is writing to the same file twice within the session. This happens in
single file mode in kernow as well as the directory mode.


&gt; I understand why this might be an issue to have two different streams
&gt; writing to the same file, but should this always fail just because the
&gt; file is opened twice for write in one stylesheet?
&gt;
&gt; I'm trying to process some DITA content that is using conrefs (think
&gt; xinclude statements). So I have one file that makes 2 references to
&gt; another file to include content from that second file.
&gt;
&gt; We want to change this arrangement such that there is only one includable
&gt; section in a given file. So I'm splitting the second file into 2 new files
&gt; and modifying the references accordingly in the first.
&gt;
&gt; Here is s simplified view of what is going on (for those that know DITA
&gt; please excuse the pseudo code):
&gt;
&gt; Topic file structure:
&gt;
&gt; &lt;concept&gt;
&gt;    &lt;h1 conref=&quot;file2.xml#sysoutput&quot;&gt;&lt;/h1&gt;
&gt;    &lt;h2 conref=file2.xml#inline&quot;&gt;&lt;/h2&gt;
&gt; &lt;/concept&gt;
&gt;
&gt;
&gt; File2.xml structure:
&gt;
&gt; &lt;concept&gt;
&gt;     &lt;h1 id=&quot;sysoutput&quot;&gt;
&gt;        &lt;p&gt;This is the first set of content&lt;/p&gt;
&gt;     &lt;/h1&gt;
&gt;     &lt;h2 id=&quot;inline&quot;&gt;
&gt;        &lt;p&gt;this is the second referenced content&lt;/p&gt;
&gt;     &lt;/h2&gt;
&gt; &lt;/concept&gt;
&gt;
&gt; Need to change this to be:
&gt;
&gt;
&gt; Topic file structure:
&gt;
&gt; &lt;concept&gt;
&gt;    &lt;h1 conref=&quot;file2-sysoutput.xml#sysoutput&quot;&gt;&lt;/h1&gt;
&gt;    &lt;h2 conref=file2-inline.xml#inline&quot;&gt;&lt;/h2&gt;
&gt; &lt;/concept&gt;
&gt;
&gt;
&gt; File2-sysoutput.xml structure:
&gt;
&gt; &lt;concept&gt;
&gt;     &lt;h1 id=&quot;sysoutput&quot;&gt;
&gt;        &lt;p&gt;This is the first set of content&lt;/p&gt;
&gt;     &lt;/h1&gt;
&gt; &lt;/concept&gt;
&gt;
&gt;
&gt; File2-inline.xml structure:
&gt;
&gt; &lt;concept&gt;
&gt;     &lt;h2 id=&quot;inline&quot;&gt;
&gt;        &lt;p&gt;this is the second referenced content&lt;/p&gt;
&gt;     &lt;/h2&gt;
&gt; &lt;/concept&gt;
&gt;
&gt;
&gt; So my stylesheet is processing the topic file. I have a template that is
&gt; triggered when an @conref attribute is found and it creates the new
&gt; attribute value as well as making the new file.
&gt;
&gt; &lt;xsl:template name=&quot;make-conref&quot;&gt;
&gt; &lt;xsl:param name=&quot;file&quot; as=&quot;xs:string&quot;/&gt;
&gt; &lt;xsl:param name=&quot;conref-sourcefile&quot; as=&quot;xs:string&quot;/&gt;
&gt;   &lt;xsl:result-document method=&quot;xml&quot;  encoding=&quot;UTF-8&quot; href=&quot;{$file}&quot;&gt;
&gt;      &lt;concept&gt;
&gt; 	&lt;xsl:apply-templates
&gt; select=&quot;doc($conref-sourcefile)//*[@id=$target-id]&quot;/&gt;
&gt;      &lt;/concept&gt;
&gt;   &lt;/xsl:result-document&gt;
&gt;
&gt; &lt;!-- return the new conref statement to replace the one we found --&gt;
&gt;    &lt;xsl:attribute name=&quot;conref&quot; select=&quot;$newconref&quot;/&gt;
&gt; &lt;/xsl:template&gt;
&gt;
&gt; So this template gets the modified filename that uses the id value to make
&gt; it unique, processes the included section and closes the result document
&gt; before continuing to the next content.
&gt;
&gt; I could see this error being raised if one of the conref'd sections
&gt; actually made a circular reference to itself, but I have not been able to
&gt; find this situation.
&gt;
&gt; One other detail is I'm using Kernow to process a directory with the same
&gt; stylesheet. So maybe there is something with the caching going on? I've
&gt; set the multi-threading to use a single thread so there should be no
&gt; collisions there.
&gt;
&gt; Kernow reports that it is net.sf.saxon.trans.XPathException throwing the
&gt; error.
&gt;
&gt; ..dan

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post80010.html</link><pubDate>Thu, 04 Apr 2013 14:03:33 GMT</pubDate></item><item><title>Re:  xpath 2 regex</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>davep wrote:</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">If so, what patter matches a p element which starts with
the string &quot;the quick brown&quot; or contains &quot;brown fox&quot; please?
</pre></blockquote><tt><br>  &lt;xsl:template match=&quot;p[matches(., '(^the quick brown)|brown 
fox')]&quot;&gt;...&lt;/xsl:template&gt;</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post60000.html</link><pubDate>Thu, 04 Apr 2013 13:49:24 GMT</pubDate></item><item><title> Cannot write more than one result document to the same</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>I understand why this might be an issue to have two different streams
writing to the same file, but should this always fail just because the
file is opened twice for write in one stylesheet?

I'm trying to process some DITA content that is using conrefs (think
xinclude statements). So I have one file that makes 2 references to
another file to include content from that second file.

We want to change this arrangement such that there is only one includable
section in a given file. So I'm splitting the second file into 2 new files
and modifying the references accordingly in the first.

Here is s simplified view of what is going on (for those that know DITA
please excuse the pseudo code):

Topic file structure:

&lt;concept&gt;
   &lt;h1 conref=&quot;file2.xml#sysoutput&quot;&gt;&lt;/h1&gt;
   &lt;h2 conref=file2.xml#inline&quot;&gt;&lt;/h2&gt;
&lt;/concept&gt;


File2.xml structure:

&lt;concept&gt;
    &lt;h1 id=&quot;sysoutput&quot;&gt;
       &lt;p&gt;This is the first set of content&lt;/p&gt;
    &lt;/h1&gt;
    &lt;h2 id=&quot;inline&quot;&gt;
       &lt;p&gt;this is the second referenced content&lt;/p&gt;
    &lt;/h2&gt;
&lt;/concept&gt;

Need to change this to be:


Topic file structure:

&lt;concept&gt;
   &lt;h1 conref=&quot;file2-sysoutput.xml#sysoutput&quot;&gt;&lt;/h1&gt;
   &lt;h2 conref=file2-inline.xml#inline&quot;&gt;&lt;/h2&gt;
&lt;/concept&gt;


File2-sysoutput.xml structure:

&lt;concept&gt;
    &lt;h1 id=&quot;sysoutput&quot;&gt;
       &lt;p&gt;This is the first set of content&lt;/p&gt;
    &lt;/h1&gt;
&lt;/concept&gt;


File2-inline.xml structure:

&lt;concept&gt;
    &lt;h2 id=&quot;inline&quot;&gt;
       &lt;p&gt;this is the second referenced content&lt;/p&gt;
    &lt;/h2&gt;
&lt;/concept&gt;


So my stylesheet is processing the topic file. I have a template that is
triggered when an @conref attribute is found and it creates the new
attribute value as well as making the new file.

&lt;xsl:template name=&quot;make-conref&quot;&gt;
&lt;xsl:param name=&quot;file&quot; as=&quot;xs:string&quot;/&gt;
&lt;xsl:param name=&quot;conref-sourcefile&quot; as=&quot;xs:string&quot;/&gt;
  &lt;xsl:result-document method=&quot;xml&quot;  encoding=&quot;UTF-8&quot; href=&quot;{$file}&quot;&gt;
     &lt;concept&gt;
	&lt;xsl:apply-templates select=&quot;doc($conref-sourcefile)//*[@id=$target-id]&quot;/&gt;
     &lt;/concept&gt;
  &lt;/xsl:result-document&gt;

&lt;!-- return the new conref statement to replace the one we found --&gt;
   &lt;xsl:attribute name=&quot;conref&quot; select=&quot;$newconref&quot;/&gt;
&lt;/xsl:template&gt;

So this template gets the modified filename that uses the id value to make
it unique, processes the included section and closes the result document
before continuing to the next content.

I could see this error being raised if one of the conref'd sections
actually made a circular reference to itself, but I have not been able to
find this situation.

One other detail is I'm using Kernow to process a directory with the same
stylesheet. So maybe there is something with the caching going on? I've
set the multi-threading to use a single thread so there should be no
collisions there.

Kernow reports that it is net.sf.saxon.trans.XPathException throwing the
error.

..dan

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post70010.html</link><pubDate>Thu, 04 Apr 2013 13:42:25 GMT</pubDate></item><item><title>Re:  xsl:apply-imports behavior wrong in Saxon?</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>At 2013-04-04 09:10 -0700, Bob Stayton wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>I have uncovered a significant difference in the way xsltproc and 
Saxon (both 6 and 9)<br>
handle xsl:apply-imports when using a template mode.  It seem that Saxon<br>
is doing the wrong thing here, but I wanted to ask if others interpret it<br>
this way.  I cannot find anything in the archive on this subject.
</tt></blockquote><tt><br>I go to the specification and I can see the Saxon behaviour in the 
words of the specification, but not in the words you quote from Michael.</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">I'm processing this simple document book.xml:
...
with this stylesheet (modetest.xsl):
...
And the imported no-mode.xsl stylesheet is:
...
When I apply modetest.xsl to book.xml using xsltproc, the message output is
just:</pre><br>
<tt>Reached apply-imports in modetest.xsl</tt><br>
<br>
<tt>When I apply modetest.xsl to book.xml using Saxon, the output is:</tt><br>
<br>
<pre style="margin: 0em;">Reached apply-imports in modetest.xsl
reached fallback in modetest.xsl for element title
reached fallback in modetest.xsl for element para
</pre></blockquote><tt><br>Yes, those are the results I get with Saxon (I don't have xsltproc installed).</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">According to Saxon author Michael Kay's website, his description of
xsl:apply-imports is:</pre><br>
<pre style="margin: 0em;">&quot;The effect is to search for a template that matches the current node and
that is defined in a stylesheet that was imported (directly or indirectly,
possibly via xsl:include) from the stylesheet containing the current
template, and whose mode matches the current mode. If there is such a
template, it is activated using the current node. If not, the call on
xsl:apply-imports has no effect.&quot;
</pre></blockquote><tt><br>That last bits are what I don't agree with.  And it isn't what I 
teach in the classroom.  And the Saxon execution results above mesh 
with what I teach in the classroom.</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">There is no template matching on book in mode=&quot;inside_mode&quot; in the imported
stylesheet, so the call on xsl:apply-imports should have no effect.
</pre></blockquote><tt><br>I disagree.</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">Why is Saxon applying
templates in mode=&quot;inside_mode&quot; to the children of book?
</pre></blockquote><tt><br>This is my read of the specification and what is happening in the 
above results:</tt><br>
<br>
<pre style="margin: 0em;">   http://www.w3.org/TR/1999/REC-xslt-19991116#apply-imports
   ...
   xsl:apply-imports processes the current node using only
   template rules that were imported into the stylesheet
   element containing the current template rule; the node is
   processed in the current template rule's mode.</pre><br>
<tt>In the classroom I paraphrase the above as:</tt><br>
<br>
<pre style="margin: 0em;">   xsl:apply-imports reapplies the last-matched node in the
   last-matched mode using only the imported stylesheets
   (and it can't be used inside of a for-each).</pre><br>
<tt>So, consider that you are reapplying &lt;book&gt; in &quot;inside_mode&quot; using 
only the no-mode.xsl template rules (per the specification).  Well, I 
understand that the specification says that when there is no template 
rule that matches the node being matched, the built-in template rules 
are triggered (which is contrary to the &quot;has no effect&quot; bit in 
Michael's description).  So, in your case, the &lt;book&gt; in 
&quot;inside_mode&quot; has no match in the imported stylesheet and so is being 
matched by the built-in template rule, which pushes the child nodes 
of &lt;book&gt; in the same mode.  These children are fresh game ... the 
&lt;book&gt; node has done its business with the imported 
stylesheets.  Those children are pushed in back at the top of the 
stylesheet import tree and are being matched by your fallback template.</tt><br>
<br>
<tt>And so Saxon is producing the results that you see.</tt><br>
<br>
<tt>So, it looks like xsltproc is doing the &quot;has no effect&quot; bit, and 
Saxon is letting the built-in template rules handle the node that is 
not matched by the set of template rules in the imported stylesheets.</tt><br>
<br>
<tt>Reading the specification, I don't see anything in section 5.8 that 
says the built-in template rule processing is not engaged:</tt><br>
<br>
<pre style="margin: 0em;">  http://www.w3.org/TR/1999/REC-xslt-19991116#built-in-rule
  There is a built-in template rule to allow recursive processing
  to continue in the absence of a successful pattern match by an
  explicit template rule in the stylesheet.
  ...
  There is also a built-in template rule for each mode, which
  allows recursive processing to continue in the same mode in the
  absence of a successful pattern match by an explicit template
  rule in the stylesheet.</pre><br>
<tt>I don't see anything in section 5.8 that says the built-in rules are 
not in play when &lt;xsl:apply-imports&gt; is using as the user's 
stylesheet only the template rules of the imported stylesheets.  The 
imported stylesheet has its own imported stylesheets and reliance on 
the built-in template rules.</tt><br>
<br>
<tt>And I don't see why recursive behaviour would be short-circuited by 
&lt;xsl:apply-imports/&gt;.  I certainly have plenty of cases where what 
I'm importing is, itself, the apex of a tree of stylesheet fragments 
and I would want *all* of those stylesheet fragments (and the 
implicit fragment of the built-in template rules) in play and not 
just the template rules of the apex stylesheet I've imported.</tt><br>
<br>
<tt>So I think the Saxon behaviour is consistent with the specification 
and the xsltproc behaviour and the last two sentences of Michael's 
description are not correct.</tt><br>
<br>
<tt>I am open to being convinced otherwise, but I think it would be 
difficult.  I need &quot;full stylesheet behaviours&quot; when I use 
&lt;xsl:apply-imports/&gt; and not just the one &quot;level&quot; of imported 
stylesheets.  Which is what I'm getting with Saxon.</tt><br>
<br>
<tt>Oh ... consider this ... I have a working stylesheet with imported 
fragments or whatever. All the fragments are read-only.  Say they are 
the DocBook stylesheets.  If I want to change the behaviour of one 
construct, I can import the DocBook apex stylesheet into a stylesheet 
that matches on the construct, does what it needs to, and then uses 
&lt;xsl:apply-imports/&gt; to recreate the original DocBook behaviours.  I 
certainly would not want *only* the template rules of the top-level 
apex stylesheet of DocBook to be engaged ignoring the imported 
stylesheets and built-in template rule behaviours.</tt><br>
<br>
<tt>I hope this helps.</tt><br>
<br>
<tt>. . . . . . . . . . . . Ken</tt><br>
<br>
<pre style="margin: 0em;">--
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post40010.html</link><pubDate>Thu, 04 Apr 2013 13:11:17 GMT</pubDate></item><item><title>Re:  xpath 2 regex</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 04/04/2013 13:00, David Carlisle wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>On 04/04/2013 12:40, davep wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">     &lt;xsl:template
match=&quot;p[matches(normalize-space(), '^[the quick] |
[brown fox]' )]&quot;</pre><br>
<br>
</blockquote><tt><br>that matches either</tt><br>
<br>
<pre style="margin: 0em;">a string that starts with one of the letters t h e ' ' q u i c k
followed by a space.</pre><br>
<pre style="margin: 0em;">or string that contains
a space followed by one of the letters  b r o w n f x</pre><br>
<br>
</blockquote><tt></tt><br>
<br>
<tt>the second clause should be</tt><br>
<br>
<pre style="margin: 0em;"><br> or string that contains
 a space followed by one of the letters  b r o w n ' ' f x</pre><br>
<tt>Although you can't actually match a space followed by another space in 
this context as you have used normalize-space on the input.</tt><br>
<br>
<tt>David</tt><br>
<br>
<tt></tt><br>
<br>
<tt></tt><br>
<br>
<pre style="margin: 0em;">________________________________________________________________________
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.</pre><br>
<tt>This e-mail has been scanned for all viruses by Star. The service is<br>
powered by MessageLabs. 
________________________________________________________________________</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post00010.html</link><pubDate>Thu, 04 Apr 2013 13:04:06 GMT</pubDate></item><item><title>Re:  xpath 2 regex</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 04/04/2013 12:40, davep wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">     &lt;xsl:template
match=&quot;p[matches(normalize-space(), '^[the quick] |
[brown fox]' )]&quot;</pre><br>
<br>
</blockquote><tt><br>that matches either</tt><br>
<br>
<tt>a string that starts with one of the letters t h e ' ' q u i c k 
followed by a space.</tt><br>
<br>
<pre style="margin: 0em;">or string that contains
a space followed by one of the letters  b r o w n f x</pre><br>
<tt><br>David</tt><br>
<br>
<pre style="margin: 0em;"><br>________________________________________________________________________
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.</pre><br>
<tt>This e-mail has been scanned for all viruses by Star. The service is<br>
powered by MessageLabs. 
________________________________________________________________________</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post80000.html</link><pubDate>Thu, 04 Apr 2013 13:00:25 GMT</pubDate></item><item><title>Re:  xpath 2 regex</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>Tks for the quick reply.</tt><br>
<br>
<tt>On 04/04/13 12:49, Martin Honnen wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>davep wrote:</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">If so, what patter matches a p element which starts with
the string &quot;the quick brown&quot; or contains &quot;brown fox&quot; please?
</pre></blockquote><pre style="margin: 0em;"><br>   &lt;xsl:template match=&quot;p[matches(., '(^the quick brown)|brown
fox')]&quot;&gt;...&lt;/xsl:template&gt;
</pre></blockquote><tt><br>Are the brackets necessary Martin?</tt><br>
<br>
<tt></tt><br>
<br>
<tt></tt><br>
<br>
<tt><br>regards</tt><br>
<br>
<pre style="margin: 0em;">--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post70000.html</link><pubDate>Thu, 04 Apr 2013 12:52:44 GMT</pubDate></item><item><title> xpath 2 regex</title><description><![CDATA[<!--X-Body-of-Message-->
<pre style="margin: 0em;">	&lt;xsl:template
match=&quot;p[matches(normalize-space(), '^[the quick] |
[brown fox]' )]&quot;</pre><br>
<pre style="margin: 0em;">I'm having problems interpreting this.
  I think
&lt;p&gt;   the quick .....&lt;/p&gt; matches
&lt;p&gt;the quick... &lt;/p&gt; matches</pre><br>
<pre style="margin: 0em;">what role does the  | take please?
  a simple alternate?</pre><br>
<tt>&lt;p&gt;.... brown fox ...&lt;/p&gt; Matches?</tt><br>
<br>
<tt></tt><br>
<br>
<pre style="margin: 0em;">http://www.w3.org/TR/xmlschema-2/#regexs
seems to show this</pre><br>
<tt>...<br>
Doesn't [xxx] indicate a character class?<br>
So what about<br>
&lt;p&gt;.... xof nwbro&lt;/p&gt;  Would this match<br>
or basically anything containing any (subset of) of that group of 
characters?</tt><br>
<br>
<pre style="margin: 0em;">If so, what patter matches a p element which starts with
the string &quot;the quick brown&quot; or contains &quot;brown fox&quot; please?</pre><br>
<tt>regards</tt><br>
<br>
<tt></tt><br>
<br>
<tt></tt><br>
<br>
<tt><br>regards</tt><br>
<br>
<pre style="margin: 0em;">--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post50000.html</link><pubDate>Thu, 04 Apr 2013 12:40:52 GMT</pubDate></item><item><title> xsl:apply-imports behavior wrong in Saxon?</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>I have uncovered a significant difference in the way xsltproc and Saxon 
(both 6 and 9)<br>
handle xsl:apply-imports when using a template mode.  It seem that Saxon<br>
is doing the wrong thing here, but I wanted to ask if others interpret it<br>
this way.  I cannot find anything in the archive on this subject.</tt><br>
<br>
<pre style="margin: 0em;">I'm processing this simple document book.xml:
----------------------------------------------------------------------------------------------------------------------------
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;book&gt;
 &lt;title&gt;My book title&lt;/title&gt;
 &lt;para&gt;My first para&lt;/para&gt;
&lt;/book&gt;
----------------------------------------------------------------------------------------------------------------------------</pre><br>
<pre style="margin: 0em;">with this stylesheet (modetest.xsl):
----------------------------------------------------------------------------------------------------------------------------
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;xsl:stylesheet
 xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
 version=&quot;1.0&quot;&gt;</pre><br>
<tt>&lt;xsl:import href=&quot;no-mode.xsl&quot;/&gt;</tt><br>
<br>
<tt>&lt;xsl:param name=&quot;myflag&quot; select=&quot;1&quot;/&gt;</tt><br>
<br>
<pre style="margin: 0em;">&lt;xsl:template match=&quot;book&quot;&gt;
 &lt;xsl:apply-templates select=&quot;.&quot; mode=&quot;inside_mode&quot;/&gt;
&lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">&lt;xsl:template match=&quot;book&quot; mode=&quot;inside_mode&quot;&gt;
 &lt;xsl:choose&gt;
   &lt;xsl:when test=&quot;$myflag != 0&quot;&gt;
     &lt;xsl:message&gt;Reached apply-imports in modetest.xsl&lt;/xsl:message&gt;
     &lt;xsl:apply-imports/&gt;
   &lt;/xsl:when&gt;
   &lt;xsl:otherwise&gt;
     &lt;xsl:message&gt;Reached otherwise in modetest.xsl&lt;/xsl:message&gt;
   &lt;/xsl:otherwise&gt;
 &lt;/xsl:choose&gt;
&lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">&lt;xsl:template match=&quot;*&quot; mode=&quot;inside_mode&quot;&gt;
 &lt;xsl:message&gt;reached fallback in modetest.xsl for element
    &lt;xsl:value-of select=&quot;local-name()&quot;/&gt;&lt;/xsl:message&gt;
&lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">&lt;/xsl:stylesheet&gt;
----------------------------------------------------------------------------------------------------------------------------</pre><br>
<pre style="margin: 0em;"><br>And the imported no-mode.xsl stylesheet is:
----------------------------------------------------------------------------------------------------------------------------
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;xsl:stylesheet
 xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
 version=&quot;1.0&quot;&gt;</pre><br>
<pre style="margin: 0em;">&lt;xsl:template match=&quot;book&quot;&gt;
 &lt;xsl:choose&gt;
   &lt;xsl:when test=&quot;$myflag != 0&quot;&gt;
     &lt;xsl:message&gt;Reached when in no_mode.xsl&lt;/xsl:message&gt;
     &lt;xsl:apply-imports/&gt;
   &lt;/xsl:when&gt;
   &lt;xsl:otherwise&gt;
     &lt;xsl:message&gt;Reached otherwise in no_mode.xsl&lt;/xsl:message&gt;
   &lt;/xsl:otherwise&gt;
 &lt;/xsl:choose&gt;
&lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">&lt;/xsl:stylesheet&gt;
----------------------------------------------------------------------------------------------------------------------------</pre><br>
<pre style="margin: 0em;">When I apply modetest.xsl to book.xml using xsltproc, the message output is
just:</pre><br>
<tt>Reached apply-imports in modetest.xsl</tt><br>
<br>
<tt>When I apply modetest.xsl to book.xml using Saxon, the output is:</tt><br>
<br>
<pre style="margin: 0em;">Reached apply-imports in modetest.xsl
reached fallback in modetest.xsl for element title
reached fallback in modetest.xsl for element para</pre><br>
<pre style="margin: 0em;">According to Saxon author Michael Kay's website, his description of
xsl:apply-imports is:</pre><br>
<pre style="margin: 0em;">&quot;The effect is to search for a template that matches the current node and
that is defined in a stylesheet that was imported (directly or indirectly,
possibly via xsl:include) from the stylesheet containing the current
template, and whose mode matches the current mode. If there is such a
template, it is activated using the current node. If not, the call on
xsl:apply-imports has no effect.&quot;</pre><br>
<pre style="margin: 0em;">There is no template matching on book in mode=&quot;inside_mode&quot; in the imported
stylesheet, so the call on xsl:apply-imports should have no effect.  That is
what I see when I process with xsltproc.  However, Saxon continues
processing the children of book in that mode, even though there is no
xsl:apply-templates to trigger such processing.   Why is Saxon applying
templates in mode=&quot;inside_mode&quot; to the children of book?</pre><br>
<pre style="margin: 0em;">Bob Stayton
Sagehill Enterprises
bobs@xxxxxxxxxxxx</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post30010.html</link><pubDate>Thu, 04 Apr 2013 09:10:18 GMT</pubDate></item><item><title>Re:  xpath 2 regex</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>It seems likely () (for grouping) was intended rather than [] (for a 
character class)?</tt><br>
<br>
<tt>On 04/04/2013 08:04 AM, David Carlisle wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>On 04/04/2013 13:00, David Carlisle wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>On 04/04/2013 12:40, davep wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">&lt;xsl:template
match=&quot;p[matches(normalize-space(), '^[the quick] |
[brown fox]' )]&quot;</pre><br>
<br>
</blockquote><tt><br>that matches either</tt><br>
<br>
<pre style="margin: 0em;">a string that starts with one of the letters t h e ' ' q u i c k
followed by a space.</pre><br>
<pre style="margin: 0em;">or string that contains
a space followed by one of the letters  b r o w n f x</pre><br>
<br>
</blockquote><tt></tt><br>
<br>
<tt>the second clause should be</tt><br>
<br>
<pre style="margin: 0em;"><br> or string that contains
 a space followed by one of the letters  b r o w n ' ' f x</pre><br>
<tt>Although you can't actually match a space followed by another space in 
this context as you have used normalize-space on the input.</tt><br>
<br>
<tt>David</tt><br>
<br>
<tt></tt><br>
<br>
<tt></tt><br>
<br>
<pre style="margin: 0em;">________________________________________________________________________
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.</pre><br>
<tt>This e-mail has been scanned for all viruses by Star. The service is<br>
powered by MessageLabs. 
________________________________________________________________________</tt><br>
<br>
</blockquote><tt></tt><br>
<br>
<pre style="margin: 0em;">--
Michael Sokolov
Senior Architect
Safari Books Online</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post10010.html</link><pubDate>Thu, 04 Apr 2013 08:56:23 GMT</pubDate></item><item><title> Best way of preserving comments?</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Using XSLT 2, this combination:

 &lt;xsl:strip-space elements = &quot;*&quot; /&gt;
 &lt;xsl:template match=&quot;element()|attribute()&quot;&gt;... skip selected *|@* ... /&gt;
 &lt;xsl:template match=&quot;text()|@_ix&quot;&gt;
   &lt;xsl:copy-of select=&quot;.&quot;/&gt;
 &lt;/xsl:template&gt;
 &lt;xsl:template match=&quot;comment()&quot;&gt;
   &lt;xsl:copy-of select=&quot;.&quot;/&gt;&lt;xsl:text&gt;
&lt;/xsl:text&gt;
 &lt;/xsl:template&gt;

is the best I could do to preserve the original comment and element
layout, shown with beginning of input and output XML, below. Can this
be improved? Losing empty lines is tolerable, losing line breaks is
not so great.

Thanks
Wolfgang

Beginning of input XML:
=============================================
&lt;ns2:cca_rom_db xmlns:ns2=&quot;/rss/at/obb/cca&quot; version=&quot;0.1&quot;&gt;


&lt;!-- changing: processor_data (0) --&gt;
&lt;!-- .    OREST Problem --&gt;
&lt;!-- .    check this hex values !!!!!!!!!!!!!!!! --&gt;
&lt;processor_data _ix=&quot;0&quot; reo_bos_zentrale=&quot;----&quot; /&gt;


&lt;!-- __________CCA-patches IRT_______________ --&gt;
&lt;!-- changing: versions --&gt;
&lt;!-- .    not provided by OREST - done to minimize differences --&gt;


&lt;!-- changing: pcx_info --&gt;
&lt;!-- .    OREST - station time missing --&gt;
&lt;pcx_info _ix=&quot;1&quot; ... /&gt;
===========================================

Head of output XML:
============================================
&lt;ns2:cca_rom_db xmlns:ns2=&quot;/rss/at/obb/cca&quot;&gt;&lt;!-- changing:
processor_data (0) --&gt;
&lt;!-- .    OREST Problem --&gt;
&lt;!-- .    check this hex values !!!!!!!!!!!!!!!! --&gt;
&lt;processor_data _ix=&quot;0&quot; reo_bos_zentrale=&quot;----&quot;/&gt;
   &lt;!-- __________CCA-patches IRT_______________ --&gt;
&lt;!-- changing: versions --&gt;
&lt;!-- .    not provided by OREST - done to minimize differences --&gt;
&lt;!-- changing: pcx_info --&gt;
&lt;!-- .    OREST - station time missing --&gt;
&lt;pcx_info _ix=&quot;1&quot; ... /&gt;
===========================================

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post10000.html</link><pubDate>Wed, 03 Apr 2013 15:08:54 GMT</pubDate></item><item><title>Re:  Best way of preserving comments?</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>On Wed, April 3, 2013 2:08 pm, Wolfgang Laun wrote:
&gt; Using XSLT 2, this combination:
&gt;
&gt;  &lt;xsl:strip-space elements = &quot;*&quot; /&gt;

If you don't strip white-space and do use:

&lt;xsl:output method=&quot;xml&quot; indent=&quot;no&quot; /&gt;

then you should get your existing white-space without the added indent:

&gt; &lt;processor_data _ix=&quot;0&quot; reo_bos_zentrale=&quot;----&quot;/&gt;
&gt;    &lt;!-- __________CCA-patches IRT_______________ --&gt;

Since you say you want to skip some elements, you may also want a template
to skip the white-space nodes before/after the skipped elements.

Regards,



Tony Graham                                   tgraham@xxxxxxxxxx
Consultant                                 http://www.mentea.net
Mentea       13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
 --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
    XML, XSL-FO and XSLT consulting, training and programming

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post40000.html</link><pubDate>Wed, 03 Apr 2013 14:56:48 GMT</pubDate></item><item><title>Re:  Best way of preserving comments?</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 03/04/2013 14:08, Wolfgang Laun wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>Using XSLT 2, this combination:</tt><br>
<br>
<pre style="margin: 0em;">  &lt;xsl:strip-space elements = &quot;*&quot; /&gt;
  &lt;xsl:template match=&quot;element()|attribute()&quot;&gt;... skip selected *|@* ... /&gt;
  &lt;xsl:template match=&quot;text()|@_ix&quot;&gt;
    &lt;xsl:copy-of select=&quot;.&quot;/&gt;
  &lt;/xsl:template&gt;
  &lt;xsl:template match=&quot;comment()&quot;&gt;
    &lt;xsl:copy-of select=&quot;.&quot;/&gt;&lt;xsl:text&gt;
&lt;/xsl:text&gt;
  &lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">is the best I could do to preserve the original comment and element
layout, shown with beginning of input and output XML, below. Can this
be improved? Losing empty lines is tolerable, losing line breaks is
not so great.</pre><br>
<pre style="margin: 0em;">Thanks
Wolfgang
</pre></blockquote><tt><br>Within the body of the document just copying comments is fine but before 
or after the document element white space nodes are not generated as the 
default XDM generation does not consider white space children of the 
root node to be significant (and of course there are no other text node 
children of the root node in a well formed document.</tt><br>
<br>
<tt>So what I do is have two templates</tt><br>
<br>
<pre style="margin: 0em;">&lt;xsl:template match=&quot;/comment()&quot; priority=&quot;2&quot;&gt;
   &lt;xsl:copy-of select=&quot;.&quot;/&gt;&lt;xsl:text&gt;&amp;#10;&lt;/xsl:text&gt;
&lt;xsl:text&gt;</pre><br>
<pre style="margin: 0em;"><br>&lt;xsl:template match=&quot;comment()&quot;&gt;
   &lt;xsl:copy-of select=&quot;.&quot;/&gt;
&lt;xsl:text&gt;</pre><br>
<tt>Of course this doesn't preserve newlines around initial comments<br>
it just adds a newline whether there was one there or not but it works 
OK in practice.</tt><br>
<br>
<tt>Sometimes I also have</tt><br>
<br>
<pre style="margin: 0em;">&lt;xsl:template match=&quot;/&quot; priority=&quot;2&quot;&gt;
  &lt;xsl:text&gt;&amp;#10;&lt;/xsl:text&gt;
  &lt;xsl:apply-templates/&gt;
&lt;xsl:text&gt;</pre><br>
<tt>as well to get a newline at the start</tt><br>
<br>
<tt><br>David</tt><br>
<br>
<pre style="margin: 0em;"><br>________________________________________________________________________
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.</pre><br>
<tt>This e-mail has been scanned for all viruses by Star. The service is<br>
powered by MessageLabs. 
________________________________________________________________________</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201304/post30000.html</link><pubDate>Wed, 03 Apr 2013 14:23:46 GMT</pubDate></item><item><title>Re:  Best way of preserving comments?</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>&gt;  &lt;xsl:strip-space elements = &quot;*&quot; /&gt;

&gt; is the best I could do to preserve the original comment and element
&gt; layout, shown with beginning of input and output XML, below. Can this
&gt; be improved? Losing empty lines is tolerable, losing line breaks is
&gt; not so great.

Hi,

It's not clear what you are trying to do as your code conflicts with
your wordy description... maybe produce a simple small complete sample
with required output.

cheers
andrew


--
Andrew Welch
http://andrewjwelch.com

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post20000.html</link><pubDate>Wed, 03 Apr 2013 14:15:49 GMT</pubDate></item><item><title>RE:  XML Schema 1.0 files</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>When I Have done collecting results and have had time to analyze it I will be
publishing the results,
but I dont want to rush it, I want to make sure the data is clean and analysis
is done well.
IMHO premature publication is worse than none.


----------------------------------------
David A. Lee
dlee@xxxxxxxxxxx
http://www.xmlsh.org

-----Original Message-----
From: davep [<a  href="mailto:davep@xxxxxxxxxxxxx">mailto:davep@xxxxxxxxxxxxx</a>]
Sent: Thursday, March 28, 2013 3:25 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  XML Schema 1.0 files

Thanks Mike,
    Quite comprehensive.

On 27/03/13 22:54, Michael Kay wrote:
&gt; In general, extracting information from schema documents using XSLT is
&gt; difficult, unless you are prepared to make assumptions and
&gt; approximations - for example, you might be prepared to ignore the impact
&gt; of xs:redefine, or the risk of finding xs:element declarations within an
&gt; xs:documentation element.
&gt;
&gt; In this case I think you can get a reasonable answer fairly easily. If
&gt; you find an &lt;xs:element name=&quot;N&quot;&gt; then the namespace in question is one
&gt; of the following:
&gt;
&gt; (a) if parent::xs:schema then ../@targetNamespace if present, else &quot;&quot;
&gt;
&gt; (b) otherwise, if normalize-space(@form)=&quot;qualified&quot; or empty(@form) and
&gt; normalize-space(ancestor::xs:schema/@elementFormDefault)=&quot;qualified&quot;,
&gt; then ancestor::xs:schema/@targetNamespace if present, else &quot;&quot;
&gt;
&gt; (c) otherwise, &quot;&quot;
&gt;
&gt; I think this caters for most possibilities; an exception is chameleon
&gt; include where the declarations in a schema document acquire the target
&gt; namespace of the including schema document.


I know the chameleon 'method' is used, but am prepared to accept
problems from that. Since I'm file based I have no option (other than
to assume the 'parent' including file targetNamespace.

Also that redefine isn't used.

Thanks.



regards

--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201304/post00000.html</link><pubDate>Mon, 01 Apr 2013 12:38:32 GMT</pubDate></item><item><title>Re:  CSSXX to XML</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>On Sat, Mar 30, 2013 at 8:03 PM, Dorothy Hoskins
&lt;dorothy.hoskins@xxxxxxxxx&gt; wrote:
&gt;
&gt; HI, I have an interesting problem in that I am trying to figure out
&gt; how to load and process a CSS file to grab content from CSS class
&gt; definitions and poke them into XML files.
(...)
&gt; The commonalities of the CSS text are that a
&gt; line which contains &quot;{&quot; has the information I want for the
&gt; class/@element and class/@name.

CSS parsing is difficult; it's usually better to use an existing
library that deals with all the quirks that real-life css can have. In
Python, 'cssutils' is pretty good.

This Python code (10 lines) will do a basic xml encoding of css rules:

# start Python code
import cssutils, gnosis.xml.pickle

css = {}
sheet = cssutils.parseFile(&quot;yourcssfile.css&quot;)

for rule in sheet:
  if rule.type == rule.STYLE_RULE:
    css[rule.selectorText] = {}
    for property in rule.style:
      css[rule.selectorText][property.name] = property.value

print gnosis.xml.pickle.dumps(css)
# end Python code

When applied to this css:

pre {
    padding: 5px;
    background-color: #eeffcc;
    color: #333333;
    line-height: 120%;
    border: 1px solid #ac9;
    border-left: none;
    border-right: none;
}
tt {
    background-color: #ecf0f3;
    padding: 0 1px 0 1px;
    font-size: 0.95em;
}
th {
    background-color: #ede;
}
.warning tt {
    background: #efc2c2;
}
.note tt {
    background: #d6d6d6;
}
.viewcode-back {
    font-family: sans-serif;
}
div.viewcode-block:target {
    background-color: #f4debf;
    border-top: 1px solid #ac9;
    border-bottom: 1px solid #ac9;
}

It will produce this xml:

&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;!DOCTYPE PyObject SYSTEM &quot;PyObjects.dtd&quot;&gt;
&lt;PyObject family=&quot;obj&quot; type=&quot;builtin_wrapper&quot;  class=&quot;_EmptyClass&quot;&gt;
&lt;attr name=&quot;__toplevel__&quot; type=&quot;dict&quot; id=&quot;3068659748&quot; &gt;
  &lt;entry&gt;
    &lt;key type=&quot;string&quot;&gt;pre&lt;/key&gt;
    &lt;val type=&quot;dict&quot; id=&quot;3068659068&quot; &gt;
      &lt;entry&gt;
        &lt;key type=&quot;string&quot;&gt;color&lt;/key&gt;
        &lt;val type=&quot;string&quot;&gt;#333&lt;/val&gt;
      &lt;/entry&gt;
      &lt;entry&gt;
        &lt;key type=&quot;string&quot;&gt;border-right&lt;/key&gt;
        &lt;val type=&quot;string&quot;&gt;none&lt;/val&gt;
      &lt;/entry&gt;
      &lt;entry&gt;
        &lt;key type=&quot;string&quot;&gt;padding&lt;/key&gt;
        &lt;val type=&quot;string&quot;&gt;5px&lt;/val&gt;
      &lt;/entry&gt;
      &lt;entry&gt;
        &lt;key type=&quot;string&quot;&gt;border-left&lt;/key&gt;
        &lt;val type=&quot;string&quot;&gt;none&lt;/val&gt;
      &lt;/entry&gt;
      &lt;entry&gt;
        &lt;key type=&quot;string&quot;&gt;border&lt;/key&gt;
        &lt;val type=&quot;string&quot;&gt;1px solid #ac9&lt;/val&gt;
      &lt;/entry&gt;
      &lt;entry&gt;
        &lt;key type=&quot;string&quot;&gt;line-height&lt;/key&gt;
        &lt;val type=&quot;string&quot;&gt;120%&lt;/val&gt;
      &lt;/entry&gt;
      &lt;entry&gt;
        &lt;key type=&quot;string&quot;&gt;background-color&lt;/key&gt;
        &lt;val type=&quot;string&quot;&gt;#efc&lt;/val&gt;
      &lt;/entry&gt;
    &lt;/val&gt;
  &lt;/entry&gt;
  &lt;entry&gt;
    &lt;key type=&quot;string&quot;&gt;tt&lt;/key&gt;
    &lt;val type=&quot;dict&quot; id=&quot;3068660428&quot; &gt;
      &lt;entry&gt;
        &lt;key type=&quot;string&quot;&gt;padding&lt;/key&gt;
        &lt;val type=&quot;string&quot;&gt;0 1px 0 1px&lt;/val&gt;
      &lt;/entry&gt;
      &lt;entry&gt;
        &lt;key type=&quot;string&quot;&gt;font-size&lt;/key&gt;
        &lt;val type=&quot;string&quot;&gt;0.95em&lt;/val&gt;
      &lt;/entry&gt;
      &lt;entry&gt;
        &lt;key type=&quot;string&quot;&gt;background-color&lt;/key&gt;
        &lt;val type=&quot;string&quot;&gt;#ecf0f3&lt;/val&gt;
      &lt;/entry&gt;
    &lt;/val&gt;
  &lt;/entry&gt;
  &lt;entry&gt;
    &lt;key type=&quot;string&quot;&gt;div.viewcode-block:target&lt;/key&gt;
    &lt;val type=&quot;dict&quot; id=&quot;3069557180&quot; &gt;
      &lt;entry&gt;
        &lt;key type=&quot;string&quot;&gt;border-top&lt;/key&gt;
        &lt;val type=&quot;string&quot;&gt;1px solid #ac9&lt;/val&gt;
      &lt;/entry&gt;
      &lt;entry&gt;
        &lt;key type=&quot;string&quot;&gt;background-color&lt;/key&gt;
        &lt;val type=&quot;string&quot;&gt;#f4debf&lt;/val&gt;
      &lt;/entry&gt;
      &lt;entry&gt;
        &lt;key type=&quot;string&quot;&gt;border-bottom&lt;/key&gt;
        &lt;val type=&quot;string&quot;&gt;1px solid #ac9&lt;/val&gt;
      &lt;/entry&gt;
    &lt;/val&gt;
  &lt;/entry&gt;
  &lt;entry&gt;
    &lt;key type=&quot;string&quot;&gt;.warning tt&lt;/key&gt;
    &lt;val type=&quot;dict&quot; id=&quot;3069532468&quot; &gt;
      &lt;entry&gt;
        &lt;key type=&quot;string&quot;&gt;background&lt;/key&gt;
        &lt;val type=&quot;string&quot;&gt;#efc2c2&lt;/val&gt;
      &lt;/entry&gt;
    &lt;/val&gt;
  &lt;/entry&gt;
  &lt;entry&gt;
    &lt;key type=&quot;string&quot;&gt;th&lt;/key&gt;
    &lt;val type=&quot;dict&quot; id=&quot;3069554868&quot; &gt;
      &lt;entry&gt;
        &lt;key type=&quot;string&quot;&gt;background-color&lt;/key&gt;
        &lt;val type=&quot;string&quot;&gt;#ede&lt;/val&gt;
      &lt;/entry&gt;
    &lt;/val&gt;
  &lt;/entry&gt;
  &lt;entry&gt;
    &lt;key type=&quot;string&quot;&gt;.viewcode-back&lt;/key&gt;
    &lt;val type=&quot;dict&quot; id=&quot;3068661516&quot; &gt;
      &lt;entry&gt;
        &lt;key type=&quot;string&quot;&gt;font-family&lt;/key&gt;
        &lt;val type=&quot;string&quot;&gt;sans-serif&lt;/val&gt;
      &lt;/entry&gt;
    &lt;/val&gt;
  &lt;/entry&gt;
  &lt;entry&gt;
    &lt;key type=&quot;string&quot;&gt;.note tt&lt;/key&gt;
    &lt;val type=&quot;dict&quot; id=&quot;3068658388&quot; &gt;
      &lt;entry&gt;
        &lt;key type=&quot;string&quot;&gt;background&lt;/key&gt;
        &lt;val type=&quot;string&quot;&gt;#d6d6d6&lt;/val&gt;
      &lt;/entry&gt;
    &lt;/val&gt;
  &lt;/entry&gt;
&lt;/attr&gt;
&lt;/PyObject&gt;

- - -

It's a really simple start; some things that are easy to improve --
the resulting xml is not very pretty, but that can be improved with
either further XSLT processing (&quot;entry&quot; elements that have
&quot;val[@type='dict']&quot; children are CSSrules; &quot;entry&quot; elements that only
have string vals as children are properties) or a custom XML
serializer (Gnosis is a little antique anyway).

Also, we only retrieve rules and properties from the parsed css, but
there can be many other things (priority, imports, etc. etc.)

The main problem, regarding your requirements, is that css selectors
can be complex, and AFAIK cssutils doesn't parse selector expressions
(it does parse multiple selectors into list of selectors, but not
selector elements into element|class|name|child|descendant etc.)

Hope this helps.

Regards,
Emmanuel BC)guC)


PS: I'm not sure, but I think Saxon-CE directly exposes some css
properties; that may also help?

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post30080.html</link><pubDate>Sun, 31 Mar 2013 22:18:21 GMT</pubDate></item><item><title>Re:  CSSXX to XML</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>Hi Dorothy,</tt><br>
<br>
<tt>You might want to try our css expander.</tt><br>
<br>
<tt>Itbs a three-step process:</tt><br>
<br>
<tt>b Transform the XHTML and its CSS, be it linked, included as style 
element or style attribute, into an XML representation of the CSS.</tt><br>
<br>
<tt>b Transform this representation into an XSLT stylesheet, where XSLT 
matching patterns correspond to CSS selectors and XSLT priority 
attributes correspond to CSS precedence rules.</tt><br>
<br>
<tt>b Apply this stylesheet to the original XHTML document.</tt><br>
<br>
<tt>You can use it as an XProc step. If you check out this sample project 
with svn, 
https://subversion.le-tex.de/common/sandbox/css_expand_standalone/trunk/, you 
can invoke it as described here (replacing calabash.sh with calabash.bat 
if youbre on Windows): 
https://subversion.le-tex.de/common/sandbox/css_expand_standalone/trunk/README.txt</tt><br>
<br>
<tt>Or just check out this directory: 
https://subversion.le-tex.de/common/css-expand/xslt/ and use it like 
this (assuming that you have a front-end script for Saxon, called saxon):</tt><br>
<br>
<tt>saxon -xsl:css-parser.xsl -s:/path/to/file.xhtml -o:css.xml<br>
saxon -xsl:css2xsl.xsl -s:css.xml -o:expand.xsl 
path-constraint='[self::*:img]'<br>
saxon -xsl:expand.xsl -s:/path/to/file.xhtml -o:expanded.xhtml</tt><br>
<br>
<tt>You need the path-constraint attribute on the second step only if you 
want to restrict expansion to the img element.</tt><br>
<br>
<tt>On the same step, you may specify another parameter, prop-constraint. 
Example: prop-constraint=&quot;width max-width&quot;.</tt><br>
<br>
<tt>You need to further transform the css:* attributes in the expanded 
output to match your needs.</tt><br>
<br>
<tt>There is also a Relax NG schema for CSS as XML attributes: 
https://github.com/gimsieke/CSSa</tt><br>
<br>
<tt>There is currently no combined XHTML+CSSa schema, though. I should 
create one, because itbs just cool to be able to validate the CSS 
property values, as we experience daily when validating DocBook+CSSa 
with our Hub schema, https://github.com/gimsieke/Hub, deployed here: 
http://www.le-tex.de/resource/schema/hub/1.1/hub.rng</tt><br>
<br>
<tt>Since you are also using InDesign, you might want to try our IDMLbHub 
XML converter, https://subversion.le-tex.de/idmltools/trunk/idml2xml/<br>
Just yesterday, I implemented nested styles (i.e., their resolution to 
spans with character styles).</tt><br>
<br>
<tt>Gerrit</tt><br>
<br>
<tt></tt><br>
<br>
<tt>On 30.03.2013 20:03, Dorothy Hoskins wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">HI, I have an interesting problem in that I am trying to figure out
how to load and process a CSS file to grab content from CSS class
definitions and poke them into XML files.
In the source XML, which is scraped from XHTML pages, I find images
with CSS classes:
&lt;img class=&quot;frame-3&quot; src=&quot;image/file.jpeg&quot; alt=&quot;image&quot; /&gt;</pre><br>
<pre style="margin: 0em;">In the CSS of the ePub, I find the dimension information that I want
for the image:
img.frame-3 {
     height:448px;
     width:339px;
}</pre><br>
<pre style="margin: 0em;">My desired XML output is &lt;image height=&quot;44&quot; width=&quot;339&quot;
src=&quot;image/file.jpeg&quot; alt=&quot;image&quot; /&gt;</pre><br>
<pre style="margin: 0em;">I have the idea of grabbing the CSS and processing the CSS text to
achieve something like this:
&lt;css&gt;
&lt;class element=&quot;img&quot; name=&quot;frame-3&quot;&gt;
&lt;attribute name=&quot;height&quot; value=&quot;44&quot;/&gt;&lt;!-- px assumed in XHTML --&gt;
&lt;attribute name=&quot;width&quot; value=&quot;339&quot;/&gt;
&lt;/class&gt;
&lt;/css&gt;</pre><br>
<pre style="margin: 0em;">I know I can handle everything else I want to do once I get the CSS
into an XML structure. The commonalities of the CSS text are that a
line which contains &quot;{&quot; has the information I want for the
class/@element and class/@name. The subsequent lines until the &quot;}&quot;
occurs have the content that I want to process into the attribute/name
and attribute/value. It seems like regex is the way to go but I don't
know how to start - do I load the CSS file into a variable as
xs:string? process it as unparsed-text? if anyone knows a good example
of creating such structure from a text input in the archives or
online, please point me in the right direction.
Thanks, Dorothy</pre><br>
</blockquote><pre style="margin: 0em;"><br>--
Gerrit Imsieke
GeschC$ftsfC&lt;hrer / Managing Director
le-tex publishing services GmbH
Weissenfelser Str. 84, 04229 Leipzig, Germany
Phone +49 341 355356 110, Fax +49 341 355356 510
gerrit.imsieke@xxxxxxxxx, http://www.le-tex.de</pre><br>
<pre style="margin: 0em;">Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930</pre><br>
<pre style="margin: 0em;">GeschC$ftsfC&lt;hrer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard VC6ckler</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post20080.html</link><pubDate>Sat, 30 Mar 2013 20:59:49 GMT</pubDate></item><item><title>Re:  CSSXX to XML</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>Dorothy, I have an example of using unparsed-text() and 
&lt;xsl:analyze-string&gt; with regular expressions in this 
publicly-available set of stylesheets that convert CSV 
(comma-separated values) and TSV (tab-separated values) into XML:</tt><br>
<br>
<tt>  http://www.CraneSoftwrights.com/resources/#csv</tt><br>
<br>
<tt>The input is a text file and the output is XML.  If I were to write 
what you need I would start with these files myself and work from there.</tt><br>
<br>
<tt>I hope this helps!</tt><br>
<br>
<tt>. . . . . . . . . . Ken</tt><br>
<br>
<tt>At 2013-03-30 15:03 -0400, Dorothy Hoskins wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">HI, I have an interesting problem in that I am trying to figure out
how to load and process a CSS file to grab content from CSS class
definitions and poke them into XML files.
In the source XML, which is scraped from XHTML pages, I find images
with CSS classes:
&lt;img class=&quot;frame-3&quot; src=&quot;image/file.jpeg&quot; alt=&quot;image&quot; /&gt;</pre><br>
<pre style="margin: 0em;">In the CSS of the ePub, I find the dimension information that I want
for the image:
img.frame-3 {
    height:448px;
    width:339px;
}</pre><br>
<pre style="margin: 0em;">My desired XML output is &lt;image height=&quot;44&quot; width=&quot;339&quot;
src=&quot;image/file.jpeg&quot; alt=&quot;image&quot; /&gt;</pre><br>
<pre style="margin: 0em;">I have the idea of grabbing the CSS and processing the CSS text to
achieve something like this:
&lt;css&gt;
&lt;class element=&quot;img&quot; name=&quot;frame-3&quot;&gt;
&lt;attribute name=&quot;height&quot; value=&quot;44&quot;/&gt;&lt;!-- px assumed in XHTML --&gt;
&lt;attribute name=&quot;width&quot; value=&quot;339&quot;/&gt;
&lt;/class&gt;
&lt;/css&gt;</pre><br>
<pre style="margin: 0em;">I know I can handle everything else I want to do once I get the CSS
into an XML structure. The commonalities of the CSS text are that a
line which contains &quot;{&quot; has the information I want for the
class/@element and class/@name. The subsequent lines until the &quot;}&quot;
occurs have the content that I want to process into the attribute/name
and attribute/value. It seems like regex is the way to go but I don't
know how to start - do I load the CSS file into a variable as
xs:string? process it as unparsed-text? if anyone knows a good example
of creating such structure from a text input in the archives or
online, please point me in the right direction.
Thanks, Dorothy
</pre></blockquote><tt></tt><br>
<br>
<pre style="margin: 0em;">--
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post10080.html</link><pubDate>Sat, 30 Mar 2013 15:08:40 GMT</pubDate></item><item><title> CSSXX to XML</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>HI, I have an interesting problem in that I am trying to figure out
how to load and process a CSS file to grab content from CSS class
definitions and poke them into XML files.
In the source XML, which is scraped from XHTML pages, I find images
with CSS classes:
&lt;img class=&quot;frame-3&quot; src=&quot;image/file.jpeg&quot; alt=&quot;image&quot; /&gt;

In the CSS of the ePub, I find the dimension information that I want
for the image:
img.frame-3 {
    height:448px;
    width:339px;
}

My desired XML output is &lt;image height=&quot;44&quot; width=&quot;339&quot;
src=&quot;image/file.jpeg&quot; alt=&quot;image&quot; /&gt;

I have the idea of grabbing the CSS and processing the CSS text to
achieve something like this:
&lt;css&gt;
&lt;class element=&quot;img&quot; name=&quot;frame-3&quot;&gt;
&lt;attribute name=&quot;height&quot; value=&quot;44&quot;/&gt;&lt;!-- px assumed in XHTML --&gt;
&lt;attribute name=&quot;width&quot; value=&quot;339&quot;/&gt;
&lt;/class&gt;
&lt;/css&gt;

I know I can handle everything else I want to do once I get the CSS
into an XML structure. The commonalities of the CSS text are that a
line which contains &quot;{&quot; has the information I want for the
class/@element and class/@name. The subsequent lines until the &quot;}&quot;
occurs have the content that I want to process into the attribute/name
and attribute/value. It seems like regex is the way to go but I don't
know how to start - do I load the CSS file into a variable as
xs:string? process it as unparsed-text? if anyone knows a good example
of creating such structure from a text input in the archives or
online, please point me in the right direction.
Thanks, Dorothy

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post00080.html</link><pubDate>Sat, 30 Mar 2013 15:03:47 GMT</pubDate></item><item><title>Re:  XML and JSON performance tests in browsers</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>The network is iphone4 over 100 mb/5mb fiber and wifi.



El 28/03/2013, a las 13:29, David Lee &lt;dlee@xxxxxxxxxxx&gt; escribiC3:

&gt; I am conducting research on real-world JSON and XML browser performance.
&gt; I would appreciate anyone with a few minutes to give it a try and send me
comments.   And if possible forward to your network.
&gt; ( Note: This test is NOT intended to test everything  ... its a focused test
with a few controlled variables).
&gt;
&gt; What You Do
&gt;
&gt; Go to
&gt;    http://speedtest.xmlsh.org
&gt;
&gt; Click &quot;Run Tests And Submit...&quot;
&gt; Test takes about 1 - 3 minutes depending on your internet and device speed.
&gt;
&gt; Repeat as often as have patience on as many difference OS's, machines,
browser vendors and versions and devices.
&gt; I am particularly interested in mobile devices as these have had much less
coverage in these kinds of experiments, but anything you can try is valuable.
&gt;
&gt; Please feel free to pass this link on ... I will be updating the tests
pending comments of this initial public beta and then intend on distributing
the test to a wider audience (including full source).
&gt;
&gt; The results are intended to be published publicly after enough data
collection and analysis has been completed.
&gt;
&gt; Your participation is hoped to bring world peace, let cats sleep with dogs,
stop a zombie Armageddon and let Henny Penny come to terms with her
hallucinations about the sky falling.
&gt;
&gt; Thank you for any assistance and comments.
&gt;
&gt; ----------------------------------------
&gt; David A. Lee
&gt; dlee@xxxxxxxxxxx
&gt; http://www.xmlsh.org

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post90070.html</link><pubDate>Thu, 28 Mar 2013 13:53:22 GMT</pubDate></item><item><title>Re:  XML and JSON performance tests in browsers</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Done!

Could you share the results?



El 28/03/2013, a las 13:29, David Lee &lt;dlee@xxxxxxxxxxx&gt; escribiC3:

&gt; I am conducting research on real-world JSON and XML browser performance.
&gt; I would appreciate anyone with a few minutes to give it a try and send me
comments.   And if possible forward to your network.
&gt; ( Note: This test is NOT intended to test everything  ... its a focused test
with a few controlled variables).
&gt;
&gt; What You Do
&gt;
&gt; Go to
&gt;    http://speedtest.xmlsh.org
&gt;
&gt; Click &quot;Run Tests And Submit...&quot;
&gt; Test takes about 1 - 3 minutes depending on your internet and device speed.
&gt;
&gt; Repeat as often as have patience on as many difference OS's, machines,
browser vendors and versions and devices.
&gt; I am particularly interested in mobile devices as these have had much less
coverage in these kinds of experiments, but anything you can try is valuable.
&gt;
&gt; Please feel free to pass this link on ... I will be updating the tests
pending comments of this initial public beta and then intend on distributing
the test to a wider audience (including full source).
&gt;
&gt; The results are intended to be published publicly after enough data
collection and analysis has been completed.
&gt;
&gt; Your participation is hoped to bring world peace, let cats sleep with dogs,
stop a zombie Armageddon and let Henny Penny come to terms with her
hallucinations about the sky falling.
&gt;
&gt; Thank you for any assistance and comments.
&gt;
&gt; ----------------------------------------
&gt; David A. Lee
&gt; dlee@xxxxxxxxxxx
&gt; http://www.xmlsh.org

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post80070.html</link><pubDate>Thu, 28 Mar 2013 13:51:44 GMT</pubDate></item><item><title> XML and JSON performance tests in browsers</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>I am conducting research on real-world JSON and XML browser performance.
I would appreciate anyone with a few minutes to give it a try and send me
comments.   And if possible forward to your network.
( Note: This test is NOT intended to test everything  ... its a focused test
with a few controlled variables).

What You Do

Go to
   http://speedtest.xmlsh.org

Click &quot;Run Tests And Submit...&quot;
Test takes about 1 - 3 minutes depending on your internet and device speed.

Repeat as often as have patience on as many difference OS's, machines, browser
vendors and versions and devices.
I am particularly interested in mobile devices as these have had much less
coverage in these kinds of experiments, but anything you can try is valuable.

Please feel free to pass this link on ... I will be updating the tests pending
comments of this initial public beta and then intend on distributing the test
to a wider audience (including full source).

The results are intended to be published publicly after enough data collection
and analysis has been completed.

Your participation is hoped to bring world peace, let cats sleep with dogs,
 stop a zombie Armageddon and let Henny Penny come to terms with her
hallucinations about the sky falling.

Thank you for any assistance and comments.

----------------------------------------
David A. Lee
dlee@xxxxxxxxxxx
http://www.xmlsh.org

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post70070.html</link><pubDate>Thu, 28 Mar 2013 12:29:23 GMT</pubDate></item><item><title>Re:  XML Schema 1.0 files</title><description><![CDATA[<!--X-Body-of-Message-->
<pre style="margin: 0em;">Thanks Mike,
   Quite comprehensive.</pre><br>
<tt>On 27/03/13 22:54, Michael Kay wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">In general, extracting information from schema documents using XSLT is
difficult, unless you are prepared to make assumptions and
approximations - for example, you might be prepared to ignore the impact
of xs:redefine, or the risk of finding xs:element declarations within an
xs:documentation element.</pre><br>
<pre style="margin: 0em;">In this case I think you can get a reasonable answer fairly easily. If
you find an &lt;xs:element name=&quot;N&quot;&gt; then the namespace in question is one
of the following:</pre><br>
<tt>(a) if parent::xs:schema then ../@targetNamespace if present, else &quot;&quot;</tt><br>
<br>
<pre style="margin: 0em;">(b) otherwise, if normalize-space(@form)=&quot;qualified&quot; or empty(@form) and
normalize-space(ancestor::xs:schema/@elementFormDefault)=&quot;qualified&quot;,
then ancestor::xs:schema/@targetNamespace if present, else &quot;&quot;</pre><br>
<tt>(c) otherwise, &quot;&quot;</tt><br>
<br>
<pre style="margin: 0em;">I think this caters for most possibilities; an exception is chameleon
include where the declarations in a schema document acquire the target
namespace of the including schema document.
</pre></blockquote><tt></tt><br>
<br>
<tt>I know the chameleon 'method' is used, but am prepared to accept 
problems from that. Since I'm file based I have no option (other than<br>
to assume the 'parent' including file targetNamespace.</tt><br>
<br>
<tt>Also that redefine isn't used.</tt><br>
<br>
<tt>Thanks.</tt><br>
<br>
<tt></tt><br>
<br>
<tt>regards</tt><br>
<br>
<pre style="margin: 0em;">--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post60070.html</link><pubDate>Thu, 28 Mar 2013 07:25:22 GMT</pubDate></item><item><title>Re:  XML Schema 1.0 files</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>In general, extracting information from schema documents using XSLT is 
difficult, unless you are prepared to make assumptions and 
approximations - for example, you might be prepared to ignore the impact 
of xs:redefine, or the risk of finding xs:element declarations within an 
xs:documentation element.</tt><br>
<br>
<tt>In this case I think you can get a reasonable answer fairly easily. If 
you find an &lt;xs:element name=&quot;N&quot;&gt; then the namespace in question is one 
of the following:</tt><br>
<br>
<tt>(a) if parent::xs:schema then ../@targetNamespace if present, else &quot;&quot;</tt><br>
<br>
<tt>(b) otherwise, if normalize-space(@form)=&quot;qualified&quot; or empty(@form) and 
normalize-space(ancestor::xs:schema/@elementFormDefault)=&quot;qualified&quot;, 
then ancestor::xs:schema/@targetNamespace if present, else &quot;&quot;</tt><br>
<br>
<tt>(c) otherwise, &quot;&quot;</tt><br>
<br>
<tt>I think this caters for most possibilities; an exception is chameleon 
include where the declarations in a schema document acquire the target 
namespace of the including schema document.</tt><br>
<br>
<pre style="margin: 0em;">Michael Kay
Saxonica</pre><br>
<tt><br>On 27/03/2013 10:14, davep wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>Given an XML schema, I want to find files containing definitions &amp; 
references  of a particular element</tt><br>
<br>
<tt>Root is</tt><br>
<br>
<pre style="margin: 0em;">&lt;xsd:schema xmlns=&quot;http://www.x&quot;
    targetNamespace=&quot;http://www.x&quot;
  ...</pre><br>
<tt>Later I see</tt><br>
<br>
<tt>&lt;xsd:element ref=&quot;X&quot;/&gt;</tt><br>
<br>
<tt>and</tt><br>
<br>
<pre style="margin: 0em;">&lt;xsd:element name=&quot;X&quot;&gt;
but also
&lt;xsd:element ref=&quot;dc:X&quot;/&gt;</pre><br>
<tt><br>I'm looking for some xslt 2.0 that will combine<br>
them to search for element X definitions and references<br>
and report their namespace.<br>
I'm working on a directory, so I'll be using collection() but<br>
for one file all I want to know is<br>
if element X (ref or def) is in the  file, and if so, what the 
appropriate namespace is.<br>
So the stylesheet parameters are the localname and the<br>
returned value either nothing (not found) or the namespace in which the<br>
element is, indicating it was found?<br>
AFAICT in the above example, the namespace is 
/xsd:schema/@targetNamespace</tt><br>
<br>
<tt>Has anyone done this before please?</tt><br>
<br>
<tt>TiA</tt><br>
<br>
<tt>regards
</tt></blockquote><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post50070.html</link><pubDate>Wed, 27 Mar 2013 22:54:23 GMT</pubDate></item><item><title>Re:  How to write a stream-oriented XSLT filter?</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 27/03/2013 17:32, Liam R E Quin wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">You could look into XQuery - a number of XQuery implementations that can
live in servlets can talk to relational databases. You can filter the
output using XSLT too.  But that's still an architectural change.
</pre></blockquote><tt><br>Thanks, but filtering and so on is handled very nicely in the application, and I 
have no wish to fix what ain't broke!<br>
--<br>
John English</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post10070.html</link><pubDate>Wed, 27 Mar 2013 20:13:46 GMT</pubDate></item><item><title>RE:  Processing tab delimited text with XSLT</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Hi Ken,

Thanks for your generous help. I will check it out and see if I can make it
work.

Rick

-----Original Message-----
From: G. Ken Holman [<a  href="mailto:g.ken.holman@xxxxxxxxx">mailto:g.ken.holman@xxxxxxxxx</a>] On Behalf Of G. Ken
Holman
Sent: Wednesday, March 27, 2013 3:11 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx; xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Processing tab delimited text with XSLT

At 2013-03-27 15:06 -0400, Rick Quatro wrote:
&gt;I would like to process some tab-delimited text and am not sure how to 
&gt;do this with XSLT. I want to import some tab-delimited text and export 
&gt;a comma-separated file with some of the data rearranged, etc. Is XSLT 
&gt;suitable for a task like this? I have the 2nd edition of Michael Kay's 
&gt;book so if there are any pointers there, I would appreciate it. Thank you
very much.

I have some XSLT 2.0 templates ready to go for TSV and CSV files here:

   http://www.CraneSoftwrights.com/resources/#csv

I hope this helps.

. . . . . . . . Ken


--
Public XSLT, XSL-FO, UBL and code list classes in Europe -- Apr 2013 |
Contact us for world-wide XML consulting and instructor-led training | Free
5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |

--~--

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post40070.html</link><pubDate>Wed, 27 Mar 2013 15:28:16 GMT</pubDate></item><item><title>Re:  Processing tab delimited text with XSLT</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>At 2013-03-27 15:06 -0400, Rick Quatro wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">I would like to process some tab-delimited text and am not sure how to do
this with XSLT. I want to import some tab-delimited text and export a
comma-separated file with some of the data rearranged, etc. Is XSLT suitable
for a task like this? I have the 2nd edition of Michael Kay's book so if
there are any pointers there, I would appreciate it. Thank you very much.
</pre></blockquote><tt><br>I have some XSLT 2.0 templates ready to go for TSV and CSV files here:</tt><br>
<br>
<tt>  http://www.CraneSoftwrights.com/resources/#csv</tt><br>
<br>
<tt>I hope this helps.</tt><br>
<br>
<tt>. . . . . . . . Ken</tt><br>
<br>
<pre style="margin: 0em;"><br>--
Public XSLT, XSL-FO, UBL and code list classes in Europe -- Apr 2013 |
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post30070.html</link><pubDate>Wed, 27 Mar 2013 15:10:31 GMT</pubDate></item><item><title> Processing tab delimited text with XSLT</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>I would like to process some tab-delimited text and am not sure how to do
this with XSLT. I want to import some tab-delimited text and export a
comma-separated file with some of the data rearranged, etc. Is XSLT suitable
for a task like this? I have the 2nd edition of Michael Kay's book so if
there are any pointers there, I would appreciate it. Thank you very much.

Rick Quatro

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post20070.html</link><pubDate>Wed, 27 Mar 2013 15:06:32 GMT</pubDate></item><item><title>Re:  XML Schema 1.0 files</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>A partial answer</tt><br>
<br>
<tt>using xmlsh</tt><br>
<br>
<tt>xpath -i abc.xsd 
&quot;//xsd:attribute[@name='x']/ancestor::xsd:schema/@targetNamespace&quot;</tt><br>
<br>
<tt>Delivers the associated namespace when a match is found.</tt><br>
<br>
<tt><br>regards</tt><br>
<br>
<tt></tt><br>
<br>
<tt>On 27/03/13 11:58, davep wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>On 27/03/13 11:34, Wolfgang Laun wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">I think I did something similar only recently. My XML schema had
attributes marking the &quot;interesting&quot; xsd:element (and xsd:attribute)
definitions. Based on this I created a key with the names of the
marked elements.</pre><br>
<pre style="margin: 0em;">&lt;xsl:key name=&quot;kSkips&quot;
          match=&quot;element()[@my:mark='1']&quot;
          use=&quot;@name&quot;/&gt;</pre><br>
<tt>Key lookup uses name() to identify an &quot;interesting&quot; element in the XML.</tt><br>
<br>
<tt>-W
</tt></blockquote><pre style="margin: 0em;"><br>I'm querying a set of files (cmd line, via xmlsh) so I don't have
a list of names</pre><br>
<tt>Basically they are all interesting?</tt><br>
<br>
<tt>Thanks Wolfgang</tt><br>
<br>
<tt>DaveP</tt><br>
<br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt></tt><br>
<br>
<tt>On 27/03/2013, davep &lt;davep@xxxxxxxxxxxxx&gt; wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>On 27/03/13 10:56, Philip Fearon wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">I haven't done this myself (and I may be missing something obvious),
but have you tried using the XPath 2.0 fn:resolve-QName() function
(http://www.w3.org/TR/xpath-functions/#func-resolve-QName) ?</pre><br>
<pre style="margin: 0em;">The xs:QName result of this function can then be used as the argument
for fn:namespace-uri-from-QName() to return the namespace URI.</pre><br>
<tt>Phil Fearon
</tt></blockquote><tt></tt><br>
<br>
<pre style="margin: 0em;">I think not Phil?
net.sf.saxon.s9api.SaxonApiException: Function resolve-QName() must have
2 arguments</pre><br>
<pre style="margin: 0em;">I want to query with a localname only?
This because the element may be in any one of a number of namespaces?</pre><br>
<tt>Thanks for the suggestion though.</tt><br>
<br>
<tt>regards</tt><br>
<br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt><br>On Wed, Mar 27, 2013 at 10:14 AM, davep &lt;davep@xxxxxxxxxxxxx&gt; wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">Given an XML schema, I want to find files containing definitions &amp;
references  of a particular element</pre><br>
<tt>Root is</tt><br>
<br>
<pre style="margin: 0em;">&lt;xsd:schema xmlns=&quot;http://www.x&quot;
          targetNamespace=&quot;http://www.x&quot;
    ...</pre><br>
<tt>Later I see</tt><br>
<br>
<tt>&lt;xsd:element ref=&quot;X&quot;/&gt;</tt><br>
<br>
<tt>and</tt><br>
<br>
<pre style="margin: 0em;">&lt;xsd:element name=&quot;X&quot;&gt;
but also
&lt;xsd:element ref=&quot;dc:X&quot;/&gt;</pre><br>
<pre style="margin: 0em;"><br>I'm looking for some xslt 2.0 that will combine
them to search for element X definitions and references
and report their namespace.
I'm working on a directory, so I'll be using collection() but
for one file all I want to know is
if element X (ref or def) is in the  file, and if so, what the
appropriate
namespace is.
So the stylesheet parameters are the localname and the
returned value either nothing (not found) or the namespace in which
the
element is, indicating it was found?
AFAICT in the above example, the namespace is
/xsd:schema/@targetNamespace</pre><br>
<tt>Has anyone done this before please?</tt><br>
<br>
<tt>TiA</tt><br>
<br>
<tt>regards</tt><br>
<br>
<pre style="margin: 0em;">--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk</pre><br>
</blockquote><tt></tt><br>
<br>
</blockquote><tt></tt><br>
<br>
<tt><br>regards</tt><br>
<br>
<pre style="margin: 0em;">--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk
</pre></blockquote><tt></tt><br>
<br>
<br>
</blockquote><tt></tt><br>
<br>
<tt><br>regards</tt><br>
<br>
</blockquote><tt></tt><br>
<br>
<tt><br>regards</tt><br>
<br>
<pre style="margin: 0em;">--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post90060.html</link><pubDate>Wed, 27 Mar 2013 13:28:55 GMT</pubDate></item><item><title>Re:  XML Schema 1.0 files</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>I think I did something similar only recently. My XML schema had
attributes marking the &quot;interesting&quot; xsd:element (and xsd:attribute)
definitions. Based on this I created a key with the names of the
marked elements.

&lt;xsl:key name=&quot;kSkips&quot;
         match=&quot;element()[@my:mark='1']&quot;
         use=&quot;@name&quot;/&gt;

Key lookup uses name() to identify an &quot;interesting&quot; element in the XML.

-W


On 27/03/2013, davep &lt;davep@xxxxxxxxxxxxx&gt; wrote:
&gt; On 27/03/13 10:56, Philip Fearon wrote:
&gt;&gt; I haven't done this myself (and I may be missing something obvious),
&gt;&gt; but have you tried using the XPath 2.0 fn:resolve-QName() function
&gt;&gt; (http://www.w3.org/TR/xpath-functions/#func-resolve-QName) ?
&gt;&gt;
&gt;&gt; The xs:QName result of this function can then be used as the argument
&gt;&gt; for fn:namespace-uri-from-QName() to return the namespace URI.
&gt;&gt;
&gt;&gt; Phil Fearon
&gt;
&gt;
&gt; I think not Phil?
&gt; net.sf.saxon.s9api.SaxonApiException: Function resolve-QName() must have
&gt; 2 arguments
&gt;
&gt; I want to query with a localname only?
&gt; This because the element may be in any one of a number of namespaces?
&gt;
&gt; Thanks for the suggestion though.
&gt;
&gt; regards
&gt;
&gt;
&gt;&gt;
&gt;&gt; On Wed, Mar 27, 2013 at 10:14 AM, davep &lt;davep@xxxxxxxxxxxxx&gt; wrote:
&gt;&gt;&gt; Given an XML schema, I want to find files containing definitions &amp;
&gt;&gt;&gt; references  of a particular element
&gt;&gt;&gt;
&gt;&gt;&gt; Root is
&gt;&gt;&gt;
&gt;&gt;&gt; &lt;xsd:schema xmlns=&quot;http://www.x&quot;
&gt;&gt;&gt;          targetNamespace=&quot;http://www.x&quot;
&gt;&gt;&gt;    ...
&gt;&gt;&gt;
&gt;&gt;&gt; Later I see
&gt;&gt;&gt;
&gt;&gt;&gt; &lt;xsd:element ref=&quot;X&quot;/&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; and
&gt;&gt;&gt;
&gt;&gt;&gt; &lt;xsd:element name=&quot;X&quot;&gt;
&gt;&gt;&gt; but also
&gt;&gt;&gt; &lt;xsd:element ref=&quot;dc:X&quot;/&gt;
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; I'm looking for some xslt 2.0 that will combine
&gt;&gt;&gt; them to search for element X definitions and references
&gt;&gt;&gt; and report their namespace.
&gt;&gt;&gt; I'm working on a directory, so I'll be using collection() but
&gt;&gt;&gt; for one file all I want to know is
&gt;&gt;&gt; if element X (ref or def) is in the  file, and if so, what the
&gt;&gt;&gt; appropriate
&gt;&gt;&gt; namespace is.
&gt;&gt;&gt; So the stylesheet parameters are the localname and the
&gt;&gt;&gt; returned value either nothing (not found) or the namespace in which the
&gt;&gt;&gt; element is, indicating it was found?
&gt;&gt;&gt; AFAICT in the above example, the namespace is
&gt;&gt;&gt; /xsd:schema/@targetNamespace
&gt;&gt;&gt;
&gt;&gt;&gt; Has anyone done this before please?
&gt;&gt;&gt;
&gt;&gt;&gt; TiA
&gt;&gt;&gt;
&gt;&gt;&gt; regards
&gt;&gt;&gt;
&gt;&gt;&gt; --
&gt;&gt;&gt; Dave Pawson
&gt;&gt;&gt; XSLT XSL-FO FAQ.
&gt;&gt;&gt; http://www.dpawson.co.uk
&gt;&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;
&gt;
&gt;
&gt; regards
&gt;
&gt; --
&gt; Dave Pawson
&gt; XSLT XSL-FO FAQ.
&gt; http://www.dpawson.co.uk

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post70060.html</link><pubDate>Wed, 27 Mar 2013 12:34:32 GMT</pubDate></item><item><title>Re:  How to write a stream-oriented XSLT filter?</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 26/03/2013 21:20, Michael Kay wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">The only way to get the data from one to the other without putting it all in
memory is to run them in separate threads with a shared buffer.
</pre></blockquote><tt><br>That's the only way I could think of doing it as well, but I don't fancy running 
two threads for every request. (And it also explains why I haven't found any 
streaming examples of filters out there!)</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">However... How large is your output? It's quite possible to handle 100Mb or so
before you have to resort to streaming. And surely 100Mb is far more than you
want to send to a browser. Perhaps you're dealing with much smaller data sizes
and you just need to change your system configuration so it doesn't run out of
memory?
</pre></blockquote><tt><br>I discovered a pathological case the hard way. I'm displaying tables out of a DB 
with options to filter the selected rows and also select the number of rows per 
page (10, 20, 50, 100, ALL). The table remembers the last rows-per-page 
selection. If I select say 200 rows and I want to see all of them, that's fine, 
but if I go back to the same table (currently ~200K rows and growing), the 
filter isn't remembered and it tries to display all of the rows. One of the 
fields is a clob, so it can be a lot of data -- I don't know exactly how much 
because it dies before it can tell me!</tt><br>
<br>
<tt>It sounds like it would be simpler for me to just cap the number of rows per 
page to 10000 or some such, and experiment to find out when it blows up to 
choose a high but safe limit. Except for the one table that showed up the 
problem, 10000 would generally be equivalent to &quot;all&quot;...</tt><br>
<br>
<pre style="margin: 0em;">Thanks for the advice,
--
John English</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post30060.html</link><pubDate>Wed, 27 Mar 2013 12:04:40 GMT</pubDate></item><item><title>Re:  XML Schema 1.0 files</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 27/03/13 11:34, Wolfgang Laun wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">I think I did something similar only recently. My XML schema had
attributes marking the &quot;interesting&quot; xsd:element (and xsd:attribute)
definitions. Based on this I created a key with the names of the
marked elements.</pre><br>
<pre style="margin: 0em;">&lt;xsl:key name=&quot;kSkips&quot;
          match=&quot;element()[@my:mark='1']&quot;
          use=&quot;@name&quot;/&gt;</pre><br>
<tt>Key lookup uses name() to identify an &quot;interesting&quot; element in the XML.</tt><br>
<br>
<tt>-W
</tt></blockquote><pre style="margin: 0em;"><br>I'm querying a set of files (cmd line, via xmlsh) so I don't have
a list of names</pre><br>
<tt>Basically they are all interesting?</tt><br>
<br>
<tt>Thanks Wolfgang</tt><br>
<br>
<tt>DaveP</tt><br>
<br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt></tt><br>
<br>
<tt>On 27/03/2013, davep &lt;davep@xxxxxxxxxxxxx&gt; wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>On 27/03/13 10:56, Philip Fearon wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">I haven't done this myself (and I may be missing something obvious),
but have you tried using the XPath 2.0 fn:resolve-QName() function
(http://www.w3.org/TR/xpath-functions/#func-resolve-QName) ?</pre><br>
<pre style="margin: 0em;">The xs:QName result of this function can then be used as the argument
for fn:namespace-uri-from-QName() to return the namespace URI.</pre><br>
<tt>Phil Fearon
</tt></blockquote><tt></tt><br>
<br>
<pre style="margin: 0em;">I think not Phil?
net.sf.saxon.s9api.SaxonApiException: Function resolve-QName() must have
2 arguments</pre><br>
<pre style="margin: 0em;">I want to query with a localname only?
This because the element may be in any one of a number of namespaces?</pre><br>
<tt>Thanks for the suggestion though.</tt><br>
<br>
<tt>regards</tt><br>
<br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt><br>On Wed, Mar 27, 2013 at 10:14 AM, davep &lt;davep@xxxxxxxxxxxxx&gt; wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">Given an XML schema, I want to find files containing definitions &amp;
references  of a particular element</pre><br>
<tt>Root is</tt><br>
<br>
<pre style="margin: 0em;">&lt;xsd:schema xmlns=&quot;http://www.x&quot;
          targetNamespace=&quot;http://www.x&quot;
    ...</pre><br>
<tt>Later I see</tt><br>
<br>
<tt>&lt;xsd:element ref=&quot;X&quot;/&gt;</tt><br>
<br>
<tt>and</tt><br>
<br>
<pre style="margin: 0em;">&lt;xsd:element name=&quot;X&quot;&gt;
but also
&lt;xsd:element ref=&quot;dc:X&quot;/&gt;</pre><br>
<pre style="margin: 0em;"><br>I'm looking for some xslt 2.0 that will combine
them to search for element X definitions and references
and report their namespace.
I'm working on a directory, so I'll be using collection() but
for one file all I want to know is
if element X (ref or def) is in the  file, and if so, what the
appropriate
namespace is.
So the stylesheet parameters are the localname and the
returned value either nothing (not found) or the namespace in which the
element is, indicating it was found?
AFAICT in the above example, the namespace is
/xsd:schema/@targetNamespace</pre><br>
<tt>Has anyone done this before please?</tt><br>
<br>
<tt>TiA</tt><br>
<br>
<tt>regards</tt><br>
<br>
<pre style="margin: 0em;">--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk</pre><br>
</blockquote><tt></tt><br>
<br>
</blockquote><tt></tt><br>
<br>
<tt><br>regards</tt><br>
<br>
<pre style="margin: 0em;">--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk
</pre></blockquote><tt></tt><br>
<br>
<br>
</blockquote><tt></tt><br>
<br>
<tt><br>regards</tt><br>
<br>
<pre style="margin: 0em;">--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post80060.html</link><pubDate>Wed, 27 Mar 2013 11:58:24 GMT</pubDate></item><item><title>Re:  How to write a stream-oriented XSLT filter?</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>On Wed, 2013-03-27 at 12:04 +0200, John English wrote:
&gt; [...] I'm displaying tables out of a DB 
&gt; with options to filter the selected rows and also select the number of rows per 
&gt; page (10, 20, 50, 100, ALL). 

You could look into XQuery - a number of XQuery implementations that can
live in servlets can talk to relational databases. You can filter the
output using XSLT too.  But that's still an architectural change.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post00070.html</link><pubDate>Wed, 27 Mar 2013 11:32:49 GMT</pubDate></item><item><title>Re:  XML Schema 1.0 files</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 27/03/13 10:56, Philip Fearon wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">I haven't done this myself (and I may be missing something obvious),
but have you tried using the XPath 2.0 fn:resolve-QName() function
(http://www.w3.org/TR/xpath-functions/#func-resolve-QName) ?</pre><br>
<pre style="margin: 0em;">The xs:QName result of this function can then be used as the argument
for fn:namespace-uri-from-QName() to return the namespace URI.</pre><br>
<tt>Phil Fearon
</tt></blockquote><tt></tt><br>
<br>
<tt>I think not Phil?<br>
net.sf.saxon.s9api.SaxonApiException: Function resolve-QName() must have 
2 arguments</tt><br>
<br>
<pre style="margin: 0em;">I want to query with a localname only?
This because the element may be in any one of a number of namespaces?</pre><br>
<tt>Thanks for the suggestion though.</tt><br>
<br>
<tt>regards</tt><br>
<br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt><br>On Wed, Mar 27, 2013 at 10:14 AM, davep &lt;davep@xxxxxxxxxxxxx&gt; wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">Given an XML schema, I want to find files containing definitions &amp;
references  of a particular element</pre><br>
<tt>Root is</tt><br>
<br>
<pre style="margin: 0em;">&lt;xsd:schema xmlns=&quot;http://www.x&quot;
         targetNamespace=&quot;http://www.x&quot;
   ...</pre><br>
<tt>Later I see</tt><br>
<br>
<tt>&lt;xsd:element ref=&quot;X&quot;/&gt;</tt><br>
<br>
<tt>and</tt><br>
<br>
<pre style="margin: 0em;">&lt;xsd:element name=&quot;X&quot;&gt;
but also
&lt;xsd:element ref=&quot;dc:X&quot;/&gt;</pre><br>
<pre style="margin: 0em;"><br>I'm looking for some xslt 2.0 that will combine
them to search for element X definitions and references
and report their namespace.
I'm working on a directory, so I'll be using collection() but
for one file all I want to know is
if element X (ref or def) is in the  file, and if so, what the appropriate
namespace is.
So the stylesheet parameters are the localname and the
returned value either nothing (not found) or the namespace in which the
element is, indicating it was found?
AFAICT in the above example, the namespace is /xsd:schema/@targetNamespace</pre><br>
<tt>Has anyone done this before please?</tt><br>
<br>
<tt>TiA</tt><br>
<br>
<tt>regards</tt><br>
<br>
<pre style="margin: 0em;">--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk</pre><br>
</blockquote><tt></tt><br>
<br>
</blockquote><tt></tt><br>
<br>
<tt><br>regards</tt><br>
<br>
<pre style="margin: 0em;">--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post60060.html</link><pubDate>Wed, 27 Mar 2013 11:25:45 GMT</pubDate></item><item><title>Re:  XML Schema 1.0 files</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>I haven't done this myself (and I may be missing something obvious),
but have you tried using the XPath 2.0 fn:resolve-QName() function
(http://www.w3.org/TR/xpath-functions/#func-resolve-QName) ?

The xs:QName result of this function can then be used as the argument
for fn:namespace-uri-from-QName() to return the namespace URI.

Phil Fearon

On Wed, Mar 27, 2013 at 10:14 AM, davep &lt;davep@xxxxxxxxxxxxx&gt; wrote:
&gt; Given an XML schema, I want to find files containing definitions &amp;
&gt; references  of a particular element
&gt;
&gt; Root is
&gt;
&gt; &lt;xsd:schema xmlns=&quot;http://www.x&quot;
&gt;         targetNamespace=&quot;http://www.x&quot;
&gt;   ...
&gt;
&gt; Later I see
&gt;
&gt; &lt;xsd:element ref=&quot;X&quot;/&gt;
&gt;
&gt; and
&gt;
&gt; &lt;xsd:element name=&quot;X&quot;&gt;
&gt; but also
&gt; &lt;xsd:element ref=&quot;dc:X&quot;/&gt;
&gt;
&gt;
&gt; I'm looking for some xslt 2.0 that will combine
&gt; them to search for element X definitions and references
&gt; and report their namespace.
&gt; I'm working on a directory, so I'll be using collection() but
&gt; for one file all I want to know is
&gt; if element X (ref or def) is in the  file, and if so, what the appropriate
&gt; namespace is.
&gt; So the stylesheet parameters are the localname and the
&gt; returned value either nothing (not found) or the namespace in which the
&gt; element is, indicating it was found?
&gt; AFAICT in the above example, the namespace is /xsd:schema/@targetNamespace
&gt;
&gt; Has anyone done this before please?
&gt;
&gt; TiA
&gt;
&gt; regards
&gt;
&gt; --
&gt; Dave Pawson
&gt; XSLT XSL-FO FAQ.
&gt; http://www.dpawson.co.uk

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post50060.html</link><pubDate>Wed, 27 Mar 2013 10:56:26 GMT</pubDate></item><item><title> XML Schema 1.0 files</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>Given an XML schema, I want to find files containing definitions &amp; 
references  of a particular element</tt><br>
<br>
<tt>Root is</tt><br>
<br>
<pre style="margin: 0em;">&lt;xsd:schema xmlns=&quot;http://www.x&quot;
	targetNamespace=&quot;http://www.x&quot;
  ...</pre><br>
<tt>Later I see</tt><br>
<br>
<tt>&lt;xsd:element ref=&quot;X&quot;/&gt;</tt><br>
<br>
<tt>and</tt><br>
<br>
<pre style="margin: 0em;">&lt;xsd:element name=&quot;X&quot;&gt;
but also
&lt;xsd:element ref=&quot;dc:X&quot;/&gt;</pre><br>
<tt><br>I'm looking for some xslt 2.0 that will combine<br>
them to search for element X definitions and references<br>
and report their namespace.<br>
I'm working on a directory, so I'll be using collection() but<br>
for one file all I want to know is<br>
if element X (ref or def) is in the  file, and if so, what the 
appropriate namespace is.<br>
So the stylesheet parameters are the localname and the<br>
returned value either nothing (not found) or the namespace in which the<br>
element is, indicating it was found?<br>
AFAICT in the above example, the namespace is /xsd:schema/@targetNamespace</tt><br>
<br>
<tt>Has anyone done this before please?</tt><br>
<br>
<tt>TiA</tt><br>
<br>
<tt>regards</tt><br>
<br>
<pre style="margin: 0em;">--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post40060.html</link><pubDate>Wed, 27 Mar 2013 10:14:01 GMT</pubDate></item><item><title>Re:  How to write a stream-oriented XSLT filter?</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>There are two challenges here. The first is to pipe your servlet 
response into the XSLT transformer without materializing it as a string 
in memory. That's doable, though it could be tricky, because there's 
what I call a &quot;push-pull&quot; conflict - the servlet expects to write (push) 
the output, and the XML parser expects to read (pull) it, so the only 
way to get the data from one to the other without putting it all in 
memory is to run them in separate threads with a shared buffer.</tt><br>
<br>
<tt>The second is to run the XSLT transformation without building a complete 
tree representation of the source document in memory. As far as I know 
the only XSLT processor that can do that today is Saxon-EE, and even 
then, it can only do it if you're very careful to write the 
transformation in a streamable way. There's information on this here:</tt><br>
<br>
<tt>http://www.saxonica.com/documentation9.4-demo/index.html#!sourcedocs/streaming</tt><br>
<br>
<tt>However... How large is your output? It's quite possible to handle 100Mb 
or so before you have to resort to streaming. And surely 100Mb is far 
more than you want to send to a browser. Perhaps you're dealing with 
much smaller data sizes and you just need to change your system 
configuration so it doesn't run out of memory?</tt><br>
<br>
<pre style="margin: 0em;">Michael Kay
Saxonica</pre><br>
<tt>On 26/03/2013 14:41, John English wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>Apologies in advance: this is not an XSLT-specific question, but I 
thought someone here might be able to help me anyway...</tt><br>
<br>
<tt>I have an XSLT filter which transforms XML output from a servlet to 
HTML. The filter uses a CharResponseWrapper to extract the response 
output as a string and then run it through the transformer:</tt><br>
<br>
<pre style="margin: 0em;">      CharResponseWrapper wrapper =
          new CharResponseWrapper((HttpServletResponse)response);
      chain.doFilter(request,wrapper);
      s = wrapper.toString();
      if (s.length() &gt; 0) {
        Transformer transformer = xslt.newTransformer();
        Source transformSource = new StreamSource(new StringReader(s));
        StreamResult result = new StreamResult(response.getWriter());
        transformer.transform(transformSource, result);
      }</pre><br>
<tt>This works fine unless the output is larger than a certain size, at 
which point I get an OutOfMemoryError.</tt><br>
<br>
<tt>The sensible way to deal with this would presumably be to connect up 
the response's output stream to the transformer's input source, so 
that I don't have to materialise all the output as a string before I 
start transforming it. I can't find any examples which show how I can 
do this; all the examples I've seen also work by materialising the 
output as a string before processing it.</tt><br>
<br>
<tt>It seems like I will need to move the transformation into the response 
wrapper, and maybe a separate thread to run the transformation while 
the response is being generated, but it all seems incredibly 
complicated. I'm hoping it's not as complicated as I imagine, and that 
someone here has already gone through all this and will be able to 
tell me how to proceed.</tt><br>
<br>
<tt>Please can anyone point me in the right direction here?</tt><br>
<br>
<tt>TIA,
</tt></blockquote><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post20060.html</link><pubDate>Tue, 26 Mar 2013 19:20:59 GMT</pubDate></item><item><title> How to write a stream-oriented XSLT filter?</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>Apologies in advance: this is not an XSLT-specific question, but I thought 
someone here might be able to help me anyway...</tt><br>
<br>
<tt>I have an XSLT filter which transforms XML output from a servlet to HTML. The 
filter uses a CharResponseWrapper to extract the response output as a string and 
then run it through the transformer:</tt><br>
<br>
<pre style="margin: 0em;">      CharResponseWrapper wrapper =
          new CharResponseWrapper((HttpServletResponse)response);
      chain.doFilter(request,wrapper);
      s = wrapper.toString();
      if (s.length() &gt; 0) {
        Transformer transformer = xslt.newTransformer();
        Source transformSource = new StreamSource(new StringReader(s));
        StreamResult result = new StreamResult(response.getWriter());
        transformer.transform(transformSource, result);
      }</pre><br>
<tt>This works fine unless the output is larger than a certain size, at which point 
I get an OutOfMemoryError.</tt><br>
<br>
<tt>The sensible way to deal with this would presumably be to connect up the 
response's output stream to the transformer's input source, so that I don't have 
to materialise all the output as a string before I start transforming it. I 
can't find any examples which show how I can do this; all the examples I've seen 
also work by materialising the output as a string before processing it.</tt><br>
<br>
<tt>It seems like I will need to move the transformation into the response wrapper, 
and maybe a separate thread to run the transformation while the response is 
being generated, but it all seems incredibly complicated. I'm hoping it's not as 
complicated as I imagine, and that someone here has already gone through all 
this and will be able to tell me how to proceed.</tt><br>
<br>
<tt>Please can anyone point me in the right direction here?</tt><br>
<br>
<pre style="margin: 0em;">TIA,
--
John English</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post10060.html</link><pubDate>Tue, 26 Mar 2013 16:41:30 GMT</pubDate></item><item><title>Re:  What is the best solution?</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>We need more information, like what XSLT version/processor are you
using?  Are you trying to do this in browsers?  That sort of thing...

&lt;advocacy&gt;
My advice has more to do with your HTML, I'm a big fan of accessible
table markup styled with CSS, i.e. no @align, don't forget &lt;tbody&gt; and
&lt;thead&gt;, and don't be afraid to use &lt;th&gt; for table headings.  Just a
little effort in the XSLT and the resulting table, even if it's large,
is highly machine-readable, thus easily navigable by assistive devices.
I'm also a big fan of &lt;caption&gt; nested under &lt;table&gt;; this advice holds
for HTML 5.  XSLT makes it easy to generate beautiful, accessible
tables, so why not give it a try?
&lt;/advocacy&gt;

-Eric

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post00060.html</link><pubDate>Mon, 25 Mar 2013 20:49:01 GMT</pubDate></item><item><title> What is the best solution?</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>I have a structure like the one below:


        &lt;ns1:Event&gt;
            &lt;ns1:Name&gt;Anders Jacobsen - Anders Bardal&lt;/ns1:Name&gt;
            &lt;ns1:MatchId&gt;331782&lt;/ns1:MatchId&gt;
            &lt;ns1:ArrangementId&gt;100000214&lt;/ns1:ArrangementId&gt;
            &lt;ns1:ArrangementName&gt;HS215&lt;/ns1:ArrangementName&gt;
            &lt;ns1:SportId&gt;83&lt;/ns1:SportId&gt;
            &lt;ns1:SportName&gt;Hopp&lt;/ns1:SportName&gt;
            &lt;ns1:Time&gt;2013-03-22T15:15:00.000+01:00&lt;/ns1:Time&gt;
            &lt;ns1:Status Id=&quot;0&quot;&gt;Ikke startet&lt;/ns1:Status&gt;
            &lt;ns1:Item id=&quot;13869&quot;&gt;
                &lt;ns1:Number&gt;1&lt;/ns1:Number&gt;
                &lt;ns1:Name&gt;Anders Jacobsen&lt;/ns1:Name&gt;
                &lt;ns1:ShortName&gt;Jacobse&lt;/ns1:ShortName&gt;
                &lt;ns1:Abbreviation&gt;Anders Jacobsen&lt;/ns1:Abbreviation&gt;
            &lt;/ns1:Item&gt;
            &lt;ns1:Item id=&quot;13789&quot;&gt;
                &lt;ns1:Number&gt;2&lt;/ns1:Number&gt;
                &lt;ns1:Name&gt;Anders Bardal&lt;/ns1:Name&gt;
                &lt;ns1:ShortName&gt;Bardal&lt;/ns1:ShortName&gt;
                &lt;ns1:Abbreviation&gt;Anders Bardal&lt;/ns1:Abbreviation&gt;
            &lt;/ns1:Item&gt;
            &lt;ns1:BetObject Name=&quot;H2H - duell&quot; Id=&quot;181292&quot;&gt;
                &lt;ns1:BetObjectNumber&gt;56&lt;/ns1:BetObjectNumber&gt;
                &lt;ns1:Date&gt;2013-03-22T14:15:00.000+01:00&lt;/ns1:Date&gt;
                &lt;ns1:SaleStartTime&gt;2013-03-21T11:15:00.000+01:00&lt;/ns1:SaleSta
rtTime&gt;
                &lt;ns1:SaleStopTime&gt;2013-03-22T14:15:00.000+01:00&lt;/ns1:SaleStop
Time&gt;
                &lt;ns1:SaleStatusNo&gt;1&lt;/ns1:SaleStatusNo&gt;
                &lt;ns1:SaleStatusName&gt;Open&lt;/ns1:SaleStatusName&gt;
                &lt;ns1:SaleAmount&gt;0&lt;/ns1:SaleAmount&gt;
                &lt;ns1:Selection&gt;
                    &lt;ns1:SelectionSeqNo&gt;1&lt;/ns1:SelectionSeqNo&gt;
                    &lt;ns1:SelectionName&gt;Anders Jacobsen&lt;/ns1:SelectionName&gt;
                    &lt;ns1:SelectionOdds&gt;1.35&lt;/ns1:SelectionOdds&gt;
                    &lt;ns1:Withdrawn&gt;false&lt;/ns1:Withdrawn&gt;
                &lt;/ns1:Selection&gt;
                &lt;ns1:Selection&gt;
                    &lt;ns1:SelectionSeqNo&gt;2&lt;/ns1:SelectionSeqNo&gt;
                    &lt;ns1:SelectionName&gt;Anders Bardal&lt;/ns1:SelectionName&gt;
                    &lt;ns1:SelectionOdds&gt;2.5&lt;/ns1:SelectionOdds&gt;
                    &lt;ns1:Withdrawn&gt;false&lt;/ns1:Withdrawn&gt;
                &lt;/ns1:Selection&gt;
                &lt;ns1:AllowedCombinations&gt;
                    &lt;ns1:Min&gt;2&lt;/ns1:Min&gt;
                    &lt;ns1:Max&gt;10&lt;/ns1:Max&gt;
                &lt;/ns1:AllowedCombinations&gt;
                &lt;ns1:SaleChannels&gt;
                    &lt;ns1:SaleChannel&gt;
                        &lt;ns1:SaleChannelNo&gt;1&lt;/ns1:SaleChannelNo&gt;
                        &lt;ns1:SaleStartTime&gt;2013-03-22T00:00:00.000+01:00&lt;/ns1
:SaleStartTime&gt;
                        &lt;ns1:SaleStopTime&gt;2013-03-22T14:15:00.000+01:00&lt;/ns1:
SaleStopTime&gt;
                    &lt;/ns1:SaleChannel&gt;
                    &lt;ns1:SaleChannel&gt;
                        &lt;ns1:SaleChannelNo&gt;2&lt;/ns1:SaleChannelNo&gt;
                        &lt;ns1:SaleStartTime&gt;2013-03-21T11:15:00.000+01:00&lt;/ns1
:SaleStartTime&gt;
                        &lt;ns1:SaleStopTime&gt;2013-03-22T14:15:00.000+01:00&lt;/ns1:
SaleStopTime&gt;
                    &lt;/ns1:SaleChannel&gt;
                    &lt;ns1:SaleChannel&gt;
                        &lt;ns1:SaleChannelNo&gt;7&lt;/ns1:SaleChannelNo&gt;
                        &lt;ns1:SaleStartTime&gt;2013-03-21T11:15:00.000+01:00&lt;/ns1
:SaleStartTime&gt;
                        &lt;ns1:SaleStopTime&gt;2013-03-22T14:15:00.000+01:00&lt;/ns1:
SaleStopTime&gt;
                    &lt;/ns1:SaleChannel&gt;
                &lt;/ns1:SaleChannels&gt;
            &lt;/ns1:BetObject&gt;
            &lt;ns1:LivebetObjects&gt;false&lt;/ns1:LivebetObjects&gt;
            &lt;ns1:BroadcastInformation&gt;
                &lt;ns1:ChannelName&gt;Plancia - NRK&lt;/ns1:ChannelName&gt;
            &lt;/ns1:BroadcastInformation&gt;
            &lt;ns1:ExternalEventId&gt;0&lt;/ns1:ExternalEventId&gt;
            &lt;ns1:Withdrawn&gt;false&lt;/ns1:Withdrawn&gt;
        &lt;/ns1:Event&gt;

That is supposed to be like this:
&lt;table class=&quot;4-col&quot;&gt;
        &lt;tr&gt;
          &lt;td&gt;16.55&lt;/td&gt;
          &lt;td&gt;H&lt;/td&gt;
          &lt;td&gt;U&lt;/td&gt;
          &lt;td&gt;B&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
      &lt;p class=&quot;txt&quot; /&gt;
      &lt;table class=&quot;9-col&quot;&gt;
        &lt;tr&gt;
          &lt;td&gt;1&lt;/td&gt;
          &lt;td&gt;Armenia - Tsjekkia&lt;/td&gt;
          &lt;td align=&quot;right&quot;&gt;3,65&lt;/td&gt;
          &lt;td align=&quot;right&quot;&gt;3,30&lt;/td&gt;
          &lt;td align=&quot;right&quot;&gt;1,75&lt;/td&gt;
          &lt;td align=&quot;right&quot;&gt;VMKB&lt;/td&gt;
          &lt;td align=&quot;center&quot;&gt;H&lt;/td&gt;
          &lt;td align=&quot;center&quot;&gt;U&lt;/td&gt;
          &lt;td align=&quot;center&quot;&gt;B&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
          &lt;td&gt;2&lt;/td&gt;
          &lt;td&gt;Armenia - Tsjekkia Handikap 1-0&lt;/td&gt;
          &lt;td align=&quot;right&quot;&gt;1,75&lt;/td&gt;
          &lt;td align=&quot;right&quot;&gt;3,45&lt;/td&gt;
          &lt;td align=&quot;right&quot;&gt;3,15&lt;/td&gt;
          &lt;td align=&quot;right&quot; /&gt;
          &lt;td align=&quot;center&quot;&gt;H&lt;/td&gt;
          &lt;td align=&quot;center&quot;&gt;U&lt;/td&gt;
          &lt;td align=&quot;center&quot;&gt;B&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
      &lt;p class=&quot;txt&quot; /&gt;
      &lt;table class=&quot;4-col&quot;&gt;
        &lt;tr&gt;
          &lt;td&gt;17.55&lt;/td&gt;
....

So as you can see I need to group dates and times, and also sort the numbers.
I have tried the group-by and used substring-before(...,'T') but that has not
returned the wanted result.

I am currently playing with the idea of splitting the date into either two
elements or one element with two attributes. Then doing a second run on the
current with grouping and so on...
Is that the right path to follow, or do you a better idea on how to solve
this?



Best

Trond Husx
System Developer NTB, Norway

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post80050.html</link><pubDate>Mon, 25 Mar 2013 14:12:47 GMT</pubDate></item><item><title> [Announce] Looming course cancellation - XSLT/XSL-FO  </title><description><![CDATA[<!--X-Body-of-Message-->
<tt>The XSL and UBL training class early-bird deadline for Crane's 
delivery hosted by the XML Finland User Group next month as a 
fund-raiser has been extended 48 hours in an attempt not to have to 
cancel the classes due to low registration.</tt><br>
<br>
<tt>The course outlines are linked at 
http://www.xml-finland.org/index.php?option=com_content&amp;task=view&amp;id=142 
with registration information at 
http://www.xml-finland.org/index.php?option=com_content&amp;task=view&amp;id=132 
with all the details of pricing.</tt><br>
<br>
<tt>Please help spread the word or register at your earliest convenience 
before the end of Wednesday. Thank you!</tt><br>
<br>
<tt>. . . . . . . . Ken</tt><br>
<br>
<pre style="margin: 0em;">--
Public XSLT, XSL-FO, UBL and code list classes in Europe -- Apr 2013 |
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post90050.html</link><pubDate>Mon, 25 Mar 2013 10:33:59 GMT</pubDate></item><item><title> [Ann] XMLSpectrum - Update to support reformatting of </title><description><![CDATA[<!--X-Body-of-Message-->
<pre>I've updated XMLSpectrum so it can now correct the formatting of
indented multi-line XPath expressions which may be corrupted by XSLT
editors when such expressions are copied and pasted or the host XSLT
is reformatted.

The highlight-file.xsl is the entry point in XMLSpectrum, so this can
be set up as a scenario within the editor with the XSLT parameters for
'indent' set to the required number of spaces and 'auto-trim' and
'css-inline' set to 'yes'. With my editor, the properly formatted code
is opened automatically in a browser from which I then paste into the
editor - unfortunately, I first need to disable the editor's own
'smart' formatting to prevent the formatting being corrupted again.

Using XMLSpectrum in this way is somewhat cumbersome, but seems to be
the best way of fixing this issue until XSLT editors improve support
for XPath formatting (at least one vendor is looking into this).

XMLSpectrum can be downloaded from Github on:

https://github.com/pgfearo/xmlspectrum

----------
Thanks

Phil Fearon

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post70050.html</link><pubDate>Mon, 25 Mar 2013 09:17:58 GMT</pubDate></item><item><title>Re:  creating a temporary document from multiple inputs</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Reading the messages helps :-)
&lt;xsl:variable name=&quot;doc&quot; as=&quot;element()*&quot; select=&quot;document($paths)/*&quot;/&gt;

Output OK. Thanks for improving my knowledge! (With a total of 200K
characters in the 3 files there certainly wasn't a noticeable
difference in execution speed.)

-W


On 23/03/2013, Wolfgang Laun &lt;wolfgang.laun@xxxxxxxxx&gt; wrote:
&gt; Hi David,
&gt;
&gt; I tried this, and the proposed &lt;xsl:variable name=&quot;doc&quot;&gt; produces an error.
&gt;
&gt; &lt;xsl:variable name=&quot;paths&quot; as=&quot;item()*&quot;&gt;
&gt;   &lt;xsl:sequence select = &quot;($p1,$p2,$p3)&quot; /&gt;
&gt; &lt;/xsl:variable&gt;
&gt; &lt;xsl:variable name=&quot;doc&quot; as=&quot;document-node()*&quot;
&gt; select=&quot;document($paths)/*&quot;/&gt;
&gt;
&gt; Warning: on line 34
&gt;   Required item type of value of variable $doc is document-node();
&gt; supplied value has item
&gt;   type element(). The expression can succeed only if the supplied
&gt; value is an empty sequence.
&gt; Warning: on line 34 of strip4ilp.xsl:
&gt;   The only value that can pass type-checking is an empty sequence.
&gt; Required item type of
&gt;   value of variable $doc is document-node(); supplied value has item
&gt; type element()
&gt; Warning: on line 34 of strip4ilp.xsl:
&gt;   The only value that can pass type-checking is an empty sequence.
&gt; Required item type of
&gt;   value of variable $doc is document-node(); supplied value has item
&gt; type element()
&gt; Error on line 34 of strip4ilp.xsl:
&gt;   XTTE0570: Required item type of value of variable $doc is
&gt; document-node(); supplied value
&gt;   has item type element({http://www.w3.org/2001/XMLSchema}schema,
&gt; xs:anyType)
&gt;
&gt; -W
&gt;
&gt; On 23/03/2013, David Carlisle &lt;davidc@xxxxxxxxx&gt; wrote:
&gt;&gt; On 09/03/2013 16:02, Wolfgang Laun wrote:
&gt;&gt;&gt; XSLT 2.0.
&gt;&gt;&gt;
&gt;&gt;&gt; I had to create a single document from several inputs (so that a key
&gt;&gt;&gt; lookup could access them all with a single call):
&gt;&gt;&gt;
&gt;&gt;&gt; &lt;xsl:variable name=&quot;doc&quot; as=&quot;document-node()&quot;&gt; &lt;xsl:document&gt;
&gt;&gt;&gt; &lt;xsl:sequence select=&quot;document($paths)/*&quot;/&gt; &lt;/xsl:document&gt;
&gt;&gt;&gt; &lt;/xsl:variable&gt; &lt;xsl:key name=&quot;kSkips&quot;
&gt;&gt;&gt; match=&quot;element()[@omc:ilp='0']&quot; use=&quot;@name&quot;/&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; &lt;xsl:variable name=&quot;look&quot; select=&quot;key('kSkips',$name,$doc)&quot;/&gt;
&gt;&gt;&gt;
&gt;&gt;
&gt;&gt; If you are only concatenating them for the key lookup that's an
&gt;&gt; expensive way to do it (unless your processor internally manages to
&gt;&gt; avoid copying all the nodes).
&gt;&gt;
&gt;&gt; Why not just look up along the sequence of documents?
&gt;&gt;
&gt;&gt; &lt;xsl:variable name=&quot;docs&quot; as=&quot;document-node()*&quot;
&gt;&gt; select=&quot;document($paths)/*&quot;/&gt;
&gt;&gt;
&gt;&gt; &lt;xsl:variable name=&quot;look&quot; select=&quot;$docs/key('kSkips',$name,.)&quot;/&gt;
&gt;&gt;
&gt;&gt; David

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post60050.html</link><pubDate>Sat, 23 Mar 2013 16:07:53 GMT</pubDate></item><item><title>Re:  creating a temporary document from multiple inputs</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Hi David,

I tried this, and the proposed &lt;xsl:variable name=&quot;doc&quot;&gt; produces an error.

&lt;xsl:variable name=&quot;paths&quot; as=&quot;item()*&quot;&gt;
  &lt;xsl:sequence select = &quot;($p1,$p2,$p3)&quot; /&gt;
&lt;/xsl:variable&gt;
&lt;xsl:variable name=&quot;doc&quot; as=&quot;document-node()*&quot; select=&quot;document($paths)/*&quot;/&gt;

Warning: on line 34
  Required item type of value of variable $doc is document-node();
supplied value has item
  type element(). The expression can succeed only if the supplied
value is an empty sequence.
Warning: on line 34 of strip4ilp.xsl:
  The only value that can pass type-checking is an empty sequence.
Required item type of
  value of variable $doc is document-node(); supplied value has item
type element()
Warning: on line 34 of strip4ilp.xsl:
  The only value that can pass type-checking is an empty sequence.
Required item type of
  value of variable $doc is document-node(); supplied value has item
type element()
Error on line 34 of strip4ilp.xsl:
  XTTE0570: Required item type of value of variable $doc is
document-node(); supplied value
  has item type element({http://www.w3.org/2001/XMLSchema}schema, xs:anyType)

-W

On 23/03/2013, David Carlisle &lt;davidc@xxxxxxxxx&gt; wrote:
&gt; On 09/03/2013 16:02, Wolfgang Laun wrote:
&gt;&gt; XSLT 2.0.
&gt;&gt;
&gt;&gt; I had to create a single document from several inputs (so that a key
&gt;&gt; lookup could access them all with a single call):
&gt;&gt;
&gt;&gt; &lt;xsl:variable name=&quot;doc&quot; as=&quot;document-node()&quot;&gt; &lt;xsl:document&gt;
&gt;&gt; &lt;xsl:sequence select=&quot;document($paths)/*&quot;/&gt; &lt;/xsl:document&gt;
&gt;&gt; &lt;/xsl:variable&gt; &lt;xsl:key name=&quot;kSkips&quot;
&gt;&gt; match=&quot;element()[@omc:ilp='0']&quot; use=&quot;@name&quot;/&gt;
&gt;&gt;
&gt;&gt; &lt;xsl:variable name=&quot;look&quot; select=&quot;key('kSkips',$name,$doc)&quot;/&gt;
&gt;&gt;
&gt;
&gt; If you are only concatenating them for the key lookup that's an
&gt; expensive way to do it (unless your processor internally manages to
&gt; avoid copying all the nodes).
&gt;
&gt; Why not just look up along the sequence of documents?
&gt;
&gt; &lt;xsl:variable name=&quot;docs&quot; as=&quot;document-node()*&quot;
&gt; select=&quot;document($paths)/*&quot;/&gt;
&gt;
&gt; &lt;xsl:variable name=&quot;look&quot; select=&quot;$docs/key('kSkips',$name,.)&quot;/&gt;
&gt;
&gt; David

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post40050.html</link><pubDate>Sat, 23 Mar 2013 15:59:52 GMT</pubDate></item><item><title>Re:  creating a temporary document from multiple inputs</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 23/03/2013 14:59, Wolfgang Laun wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>Hi David,</tt><br>
<br>
<pre style="margin: 0em;">I tried this, and the proposed &lt;xsl:variable name=&quot;doc&quot;&gt; produces an
error.</pre><br>
<pre style="margin: 0em;">&lt;xsl:variable name=&quot;paths&quot; as=&quot;item()*&quot;&gt; &lt;xsl:sequence select =
&quot;($p1,$p2,$p3)&quot; /&gt; &lt;/xsl:variable&gt; &lt;xsl:variable name=&quot;doc&quot;
as=&quot;document-node()*&quot; select=&quot;document($paths)/*&quot;/&gt;</pre><br>
<pre style="margin: 0em;">Warning: on line 34 Required item type of value of variable $doc is
document-node(); supplied value has item type element().
</pre></blockquote><pre style="margin: 0em;"><br>Sorry I mis-read your code then copied it without seeing what it did,
you should do what I meant not what I wrote, lose the /* at the end.</pre><br>
<tt>&lt;xsl:variable name=&quot;doc&quot; as=&quot;document-node()*&quot; select=&quot;document($paths)&quot;/&gt;</tt><br>
<br>
<tt>this is supposed to be a sequence of document nodes.</tt><br>
<br>
<tt></tt><br>
<br>
<tt>David</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post50050.html</link><pubDate>Sat, 23 Mar 2013 15:02:56 GMT</pubDate></item><item><title>Re:  creating a temporary document from multiple inputs</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 09/03/2013 16:02, Wolfgang Laun wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>XSLT 2.0.</tt><br>
<br>
<pre style="margin: 0em;">I had to create a single document from several inputs (so that a key
lookup could access them all with a single call):</pre><br>
<pre style="margin: 0em;">&lt;xsl:variable name=&quot;doc&quot; as=&quot;document-node()&quot;&gt; &lt;xsl:document&gt;
&lt;xsl:sequence select=&quot;document($paths)/*&quot;/&gt; &lt;/xsl:document&gt;
&lt;/xsl:variable&gt; &lt;xsl:key name=&quot;kSkips&quot;
match=&quot;element()[@omc:ilp='0']&quot; use=&quot;@name&quot;/&gt;</pre><br>
<tt>&lt;xsl:variable name=&quot;look&quot; select=&quot;key('kSkips',$name,$doc)&quot;/&gt;</tt><br>
<br>
</blockquote><pre style="margin: 0em;"><br>If you are only concatenating them for the key lookup that's an
expensive way to do it (unless your processor internally manages to
avoid copying all the nodes).</pre><br>
<tt>Why not just look up along the sequence of documents?</tt><br>
<br>
<tt>&lt;xsl:variable name=&quot;docs&quot; as=&quot;document-node()*&quot; 
select=&quot;document($paths)/*&quot;/&gt;</tt><br>
<br>
<tt>&lt;xsl:variable name=&quot;look&quot; select=&quot;$docs/key('kSkips',$name,.)&quot;/&gt;</tt><br>
<br>
<tt>David</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post30050.html</link><pubDate>Sat, 23 Mar 2013 11:18:42 GMT</pubDate></item><item><title>Re:  Find the node name of the parent in the result tre</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 22/03/2013 21:14, Martin Holmes wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>If I have a template matching an attribute, and producing one in the 
output tree, like this:</tt><br>
<br>
<pre style="margin: 0em;">  &lt;xsl:template match=&quot;@style&quot;&gt;
        &lt;xsl:attribute name=&quot;style&quot; select=&quot;.&quot;/&gt;
  &lt;/xsl:template&gt;</pre><br>
<tt>Is there any way to know the name of the element in the result tree 
which is the parent of the attribute being created?</tt><br>
<br>
</blockquote><tt>Only by passing the information as a parameter, or working it out from 
the context (e.g. from knowledge of the name of the parent in the SOURCE 
tree).</tt><br>
<br>
<pre style="margin: 0em;">Michael Kay
Saxonica</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post10050.html</link><pubDate>Fri, 22 Mar 2013 21:26:36 GMT</pubDate></item><item><title>Re:  Find the node name of the parent in the result tre</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>At 2013-03-22 14:14 -0700, Martin Holmes wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>If I have a template matching an attribute, and producing one in the 
output tree, like this:</tt><br>
<br>
<pre style="margin: 0em;">  &lt;xsl:template match=&quot;@style&quot;&gt;
        &lt;xsl:attribute name=&quot;style&quot; select=&quot;.&quot;/&gt;
  &lt;/xsl:template&gt;
</pre></blockquote><tt><br>The above could be done with:</tt><br>
<br>
<pre style="margin: 0em;">  &lt;xsl:template match=&quot;@style&quot;&gt;
     &lt;xsl:copy-of select=&quot;.&quot;/&gt;
  &lt;/xsl:template&gt;</pre><br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>Is there any way to know the name of the element in the result tree 
which is the parent of the attribute being created?
</tt></blockquote><tt><br>In the result tree?  No.  It is write-only and cannot be 
queried.  You'd have to keep track of what you are doing.</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>Some context: I'm turning TEI @style attributes into HTML @style 
attributes in the output, and I'd like to handle situations in which 
this kind of input:</tt><br>
<br>
<tt>&lt;hi rend=&quot;text-align: center;&quot;&gt;Centred text&lt;/hi&gt;</tt><br>
<br>
<tt>results in output that doesn't work:</tt><br>
<br>
<tt>&lt;span style=&quot;text-align: center;&quot;&gt;NOT centred because it's a span&lt;/span&gt;</tt><br>
<br>
<tt>If I knew the output element was a &lt;span&gt; or element which is inline 
by default, I could add &quot;display: block&quot; automatically to any @style 
attribute that contains a block-level CSS property such as 
text-align. I don't want to add &quot;display: block&quot; in all cases, 
because e.g. a &lt;div&gt; element might already have a class which floats it.
</tt></blockquote><tt><br>It is a challenge but you have to keep track yourself.</tt><br>
<br>
<tt>When using XSLT 2.0 something I've done is I've added a tunnel 
parameter to the apply-templates stack frame indicating that I'm in a 
DIV and so act on it later when it comes time to do the style 
attribute ... something along the lines of:</tt><br>
<br>
<pre style="margin: 0em;">  &lt;xsl:template match=&quot;some-block-element&quot;&gt;
    &lt;div&gt;
      &lt;xsl:apply-templates&gt;
        &lt;xsl:with-param name=&quot;in-a-div&quot; tunnel=&quot;yes&quot; select=&quot;true()&quot;/&gt;
      &lt;/xsl:apply-templates&gt;
    &lt;/div&gt;
  &lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">  &lt;xsl:template match=&quot;@style&quot;&gt;
    &lt;xsl:param name=&quot;in-a-div&quot; tunnel=&quot;yes&quot; select=&quot;false()&quot;/&gt;
    &lt;xsl:attribute name=&quot;style&quot;
      select=&quot;concat(.,if( $in-a-div ) then ';display:block' else'')&quot;/&gt;
    &lt;/xsl:attribute&gt;
  &lt;/xsl:template&gt;</pre><br>
<tt>Then you just have to remember to add that tunnel parameter for each 
of the blocks you create so that the processing knows that was done 
&quot;way back when&quot;.</tt><br>
<br>
<tt>I hope this helps.</tt><br>
<br>
<tt>. . . . . . . . Ken</tt><br>
<br>
<pre style="margin: 0em;"><br>--
Public XSLT, XSL-FO, UBL and code list classes in Europe -- Apr 2013 |
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post00050.html</link><pubDate>Fri, 22 Mar 2013 17:23:19 GMT</pubDate></item><item><title>Re:  Find the node name of the parent in the result tre</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>On Fri, Mar 22, 2013 at 2:14 PM, Martin Holmes &lt;mholmes@xxxxxxx&gt; wrote:
&gt; If I have a template matching an attribute, and producing one in the output
&gt; tree, like this:
&gt;
&gt;   &lt;xsl:template match=&quot;@style&quot;&gt;
&gt;         &lt;xsl:attribute name=&quot;style&quot; select=&quot;.&quot;/&gt;
&gt;   &lt;/xsl:template&gt;
&gt;
&gt; Is there any way to know the name of the element in the result tree which is
&gt; the parent of the attribute being created?
&gt;
&gt; Some context: I'm turning TEI @style attributes into HTML @style attributes
&gt; in the output, and I'd like to handle situations in which this kind of
&gt; input:
&gt;
&gt; &lt;hi rend=&quot;text-align: center;&quot;&gt;Centred text&lt;/hi&gt;
&gt;
&gt; results in output that doesn't work:
&gt;
&gt; &lt;span style=&quot;text-align: center;&quot;&gt;NOT centred because it's a span&lt;/span&gt;
&gt;
&gt; If I knew the output element was a &lt;span&gt; or element which is inline by
&gt; default, I could add &quot;display: block&quot; automatically to any @style attribute
&gt; that contains a block-level CSS property such as text-align. I don't want to
&gt; add &quot;display: block&quot; in all cases, because e.g. a &lt;div&gt; element might
&gt; already have a class which floats it.
&gt;
&gt; Cheers,
&gt; Martin

A two-stage stylesheet pipeline would work, provided that the context
you need is either *all* from the original document or *all* from the
result document (but not pieces/parts from each). (Also provided no
particular resource constraint.)
Might also be stylistically better than munging it all into one
stylesheet, if doing so separates different components of the
presentation.

-Brian

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post20050.html</link><pubDate>Fri, 22 Mar 2013 16:27:28 GMT</pubDate></item><item><title> Find the node name of the parent in the result tree?</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>If I have a template matching an attribute, and producing one in the 
output tree, like this:</tt><br>
<br>
<pre style="margin: 0em;">  &lt;xsl:template match=&quot;@style&quot;&gt;
        &lt;xsl:attribute name=&quot;style&quot; select=&quot;.&quot;/&gt;
  &lt;/xsl:template&gt;</pre><br>
<tt>Is there any way to know the name of the element in the result tree 
which is the parent of the attribute being created?</tt><br>
<br>
<tt>Some context: I'm turning TEI @style attributes into HTML @style 
attributes in the output, and I'd like to handle situations in which 
this kind of input:</tt><br>
<br>
<tt>&lt;hi rend=&quot;text-align: center;&quot;&gt;Centred text&lt;/hi&gt;</tt><br>
<br>
<tt>results in output that doesn't work:</tt><br>
<br>
<tt>&lt;span style=&quot;text-align: center;&quot;&gt;NOT centred because it's a span&lt;/span&gt;</tt><br>
<br>
<tt>If I knew the output element was a &lt;span&gt; or element which is inline by 
default, I could add &quot;display: block&quot; automatically to any @style 
attribute that contains a block-level CSS property such as text-align. I 
don't want to add &quot;display: block&quot; in all cases, because e.g. a &lt;div&gt; 
element might already have a class which floats it.</tt><br>
<br>
<pre style="margin: 0em;">Cheers,
Martin</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post90040.html</link><pubDate>Fri, 22 Mar 2013 14:14:33 GMT</pubDate></item><item><title>Re:  Modes - Necessary Construct or Syntactic Sugar</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>&gt; &lt;xsl:template name=&quot;title&quot;&gt;
&gt;   &lt;xsl:param name=&quot;mode&quot; select=&quot; 'default' &quot; as=&quot;xs:string&quot; /&gt;
&gt;   &lt;xsl:choose test=&quot;$mode eq 'index'&gt;
&gt;     . . .
&gt;   &lt;/xsl:choose&gt;

: )  Liam will have meant xsl:when test (wrapped in xsl:choose)

&gt;   &lt;xsl:otherwise&gt;
&gt;     &lt;xsl:call-template name=&quot;process-contents&quot;&gt;
&gt;       &lt;xsl:with-param name=&quot;input&quot; select=&quot;node()&quot; /&gt;

and that could be an apply-templates with a tunnelled param.



-- 
Andrew Welch
http://andrewjwelch.com

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post80040.html</link><pubDate>Wed, 20 Mar 2013 09:01:17 GMT</pubDate></item><item><title>Re:  Modes - Necessary Construct or Syntactic Sugar</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>On Tue, 2013-03-19 at 08:58 +0000, Ihe Onwuka wrote:
&gt; Suppose there was a genuine use case for modes. By genuine I mean the
&gt; transform requires me to process the same nodes more than once and in
&gt; different ways.
&gt; 
&gt; Can I do this without using modes.

Yes, but not in he way you describe, and not easily.

For example, you can pass a parameter to every template and have the
contents of every template wrapped inside an xsl:choose. Essentially you
end up duplicating the mode mechanism of apply-templates, though, with a
lot of inconvenience. Here's a snippet of one possible approach.

&lt;xsl:template name=&quot;title&quot;&gt;
  &lt;xsl:param name=&quot;mode&quot; select=&quot; 'default' &quot; as=&quot;xs:string&quot; /&gt;
  &lt;xsl:choose test=&quot;$mode eq 'index'&gt;
    . . .
  &lt;/xsl:choose&gt;
  &lt;xsl:otherwise&gt;
    &lt;xsl:call-template name=&quot;process-contents&quot;&gt;
      &lt;xsl:with-param name=&quot;input&quot; select=&quot;node()&quot; /&gt;
      &lt;xsl:with-param name=&quot;mode&quot; select=&quot;$mode&quot; /&gt;
    &lt;/xsl:call-template&gt;
  &lt;/xsl:otherwise&gt;
&lt;/xsl:template&gt;

and so on.

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post70040.html</link><pubDate>Tue, 19 Mar 2013 21:58:19 GMT</pubDate></item><item><title> 3D XSLT - Experience and Feedback Welcome</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>   Hi,

This is an attempt to formalize my experience with a design pattern
that I call 3D XSLT, which consists in feeding an extra document to
the transformation with elements that carry no information but their
name, for the sole purpose of rule-based matching. I'd be glad to
gather feedback and alternatives to this approach.

While baking [1] a web site, generating in advance all the HTML pages
from a database of manga titles and authors in XML format, I felt the
need to introduce an extra dimension to the transformation.

What I mean by dimension is a vector that directs the flow of the data
transformation in a direction. There are typically two in rule-based
transformations:

* the select attribute of xsl:for-each and xsl:apply-templates,
associated with the match attribute of xsl:template
* the mode attribute of xsl:apply-templates, associated with the mode
attribute of xsl:template

I am used to the combination of match and mode, or 2D XSLT, to make
the input data bounce left and right multiple times until reaching the
expected output. For complex transformations, I further divide the
transformation into several steps, each step adding an extra layer of
decoration on top of the same data:

* Open Document Format Spreadsheet XML -&gt; XML -&gt; XML -&gt; XML -&gt; XHTML

For the final transformation from XML to XHTML, I chose to use
xsl:result-document to generate all the HTML pages from a single
transformation, rather than running a separate transformation to
generate each page.

I then started the development of the transformation with template rules:

- matching different parts of the input data for different types of pages

  * / for the home page,
  * mangaxml:manga for the page with the details of the manga

- using different modes to generate different parts of each page:

  * mode=&quot;uri&quot; for the relative URL of the page
  * mode=&quot;title&quot; for the title of the page
  * mode=&quot;navigation&quot; for the navigation tabs
  * mode=&quot;contents&quot; for the main contents
  * mode=&quot;preview&quot; for a short preview linking to a page with details

This approach fell short when developing the transformation further to
generate additional types of pages ; several pages would correspond to
the same input data, and thus, the type of elements was no longer
sufficient to cover all cases; an extra dimension of variability was
needed:

  * / for both home page and faq page as well as other pages with
static contents
  * mangaxml:mangas for the different pages with lists of mangas by
country, by date...

My first idea was to use modes for two dimensions, both for the types
of pages and the parts of pages, but I encountered two issues which
made it too complex to be suitable:

  * although a template can match multiple modes, xsl:apply-templates
can only select a single mode at once
  * the mode parameter does not accept an expression to change the
mode using the value of a parameter

Although impracticable, this idea lead me to the solution that I
actually implemented: I introduced an extra input document with
elements that play the role of modes for the transformation:

  * &lt;site:page name=&quot;glossary&quot; /&gt; instead of mode=&quot;glossary&quot;
  * &lt;site:page name=&quot;faq&quot; /&gt; instead of mode=&quot;faq&quot;
  * &lt;site:page name=&quot;creation-country&quot; /&gt; instead of mode=&quot;creation-country&quot;
  * &lt;site:page name=&quot;creation-date&quot; /&gt; instead of mode=&quot;creation-date&quot;
  * &lt;site:page name=&quot;manga&quot; /&gt; instead of mode=&quot;manga&quot;

and while writing these lines, it occurred to me that the following
form may have made the concept more explicit:

  * &lt;mode:glossary /&gt; instead of mode=&quot;glossary&quot;
  * &lt;mode:faq /&gt; instead of mode=&quot;faq&quot;
  * &lt;mode:creation-country /&gt; instead of mode=&quot;creation-country&quot;
  * &lt;mode:creation-date /&gt; instead of mode=&quot;creation-date&quot;
  * &lt;mode:manga /&gt; instead of mode=&quot;manga&quot;

The templates still have only two dimensions for rule-based matching,
mode and match, but they are applied either to a mode and a &quot;mode
element&quot; or to a mode and an input element, which is carried
throughout the transformations using a tunnel parameter:

&lt;!-- context: / --&gt;
&lt;xsl:template match=&quot;/&quot;&gt;
  &lt;xsl:apply-templates mode=&quot;page&quot;
select=&quot;$metaDoc/site:site/site:page[@name='glossary']&quot;&gt;
    &lt;xsl:with-param name=&quot;context&quot; select=&quot;/&quot; tunnel=&quot;yes&quot; /&gt;
  &lt;/xsl:apply-templates&gt;
  &lt;xsl:apply-templates mode=&quot;page&quot;
select=&quot;$metaDoc/site:site/site:page[@name='faq']&quot;&gt;
    &lt;xsl:with-param name=&quot;context&quot; select=&quot;/&quot; tunnel=&quot;yes&quot; /&gt;
  &lt;/xsl:apply-templates&gt;
  ...
  &lt;xsl:apply-templates /&gt;
&lt;/xsl:template&gt;

&lt;!-- context: mangaxml:author --&gt;
&lt;xsl:template match=&quot;mangaxml:author&quot;&gt;
  &lt;xsl:apply-templates mode=&quot;page&quot;
select=&quot;$metaDoc/site:site/site:page[@name='author']&quot;&gt;
    &lt;xsl:with-param name=&quot;context&quot; select=&quot;.&quot; tunnel=&quot;yes&quot; /&gt;
  &lt;/xsl:apply-templates&gt;
&lt;/xsl:template&gt;

...

&lt;!--
  mode: &quot;page&quot; + *
  context: $context (tunnel)
--&gt;
&lt;xsl:template mode=&quot;page&quot; match=&quot;site:page&quot;&gt;
  &lt;xsl:variable name=&quot;uri&quot; as=&quot;xs:string&quot;&gt;
    &lt;xsl:apply-templates mode=&quot;uri&quot; select=&quot;.&quot; /&gt;
  &lt;/xsl:variable&gt;
  &lt;!-- instructions to generate result document for each HTML page --&gt;
&lt;/xsl:template&gt;

&lt;!--
  mode: &quot;uri&quot; + &quot;glossary&quot;
  context: /
--&gt;
&lt;xsl:template mode=&quot;uri&quot; match=&quot;site:page[@name='glossary']&quot;&gt;
  &lt;!-- glossary is the home page --&gt;
  &lt;xsl:text&gt;/&lt;/xsl:text&gt;
&lt;/xsl:template&gt;

&lt;!--
  mode = &quot;uri&quot; + &quot;faq&quot;
  context: /
--&gt;
&lt;xsl:template mode=&quot;uri&quot; match=&quot;site:page[@name='faq']&quot;&gt;
  &lt;xsl:text&gt;faq/&lt;/xsl:text&gt;
&lt;/xsl:template&gt;

&lt;!--
  mode = &quot;uri&quot; + &quot;author&quot;
  context: mangaxml:author
--&gt;
&lt;xsl:template mode=&quot;uri&quot; match=&quot;site:page[@name='author']&quot;&gt;
  &lt;xsl:param name=&quot;context&quot; as=&quot;element(mangaxml:author)&quot; tunnel=&quot;yes&quot; /&gt;

  &lt;xsl:text&gt;mangas/by/author/&lt;/xsl:text&gt;
  &lt;xsl:value-of select=&quot;$context/@name&quot; /&gt;
  &lt;xsl:text&gt;/&lt;/xsl:text&gt;
&lt;/xsl:template&gt;

...

Do you have other examples of use of this pattern? Can you suggest
simpler alternatives?

Your feedback will be appreciated.

Cheers,

Eric Brichemier

--

[1] Bake, Dont Fry -  2002-07-09 by Aaron Swartz
http://www.aaronsw.com/weblog/000404

P.S. per Tommie's recommendation, please quote only the minimum amount
of my message, or reply without quoting my message, which for an
unknown reason triggers a false positive on the spam filter of the
list.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post40040.html</link><pubDate>Tue, 19 Mar 2013 12:41:55 GMT</pubDate></item><item><title>Re:  3D XSLT - Experience and Feedback Welcome</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 19/03/2013 11:41, Eric Brichemier wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>    Hi,</tt><br>
<br>
<pre style="margin: 0em;">This is an attempt to formalize my experience with a design pattern
that I call 3D XSLT, which consists in feeding an extra document to
the transformation with elements that carry no information but their
name, for the sole purpose of rule-based matching. I'd be glad to
gather feedback and alternatives to this approach.</pre><br>
<br>
</blockquote><tt><br>Interesting. It occurs to me that it isn't that dissimilar from the 
approach used by Dimitre Novatchev in building FXSL. And I think there's 
probably a point at which the mode/template model runs out of steam and 
you want to start using maps of function items - essentially XSLT 3.0's 
implementation of an Object.</tt><br>
<br>
<pre style="margin: 0em;">Michael Kay
Saxonica</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post50040.html</link><pubDate>Tue, 19 Mar 2013 12:33:46 GMT</pubDate></item><item><title>Re:  3D XSLT - Experience and Feedback Welcome</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>At 2013-03-19 12:41 +0100, Eric Brichemier wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">This is an attempt to formalize my experience with a design pattern
that I call 3D XSLT, which consists in feeding an extra document to
the transformation with elements that carry no information but their
name, for the sole purpose of rule-based matching. I'd be glad to
gather feedback and alternatives to this approach.</pre><br>
<pre style="margin: 0em;">While baking [1] a web site, generating in advance all the HTML pages
from a database of manga titles and authors in XML format, I felt the
need to introduce an extra dimension to the transformation.</pre><br>
<pre style="margin: 0em;">What I mean by dimension is a vector that directs the flow of the data
transformation in a direction.
</pre></blockquote><tt><br>I am reminded of work I did a while ago in automating the synthesis of XSLT.</tt><br>
<br>
<pre style="margin: 0em;">Back in 2002/2003 I created a couple environments
that use a prototypical result document to direct
the flow of the transformation (if I've
understood what I've read from your post).  This
environment synthesizes XSLT stylesheets by
annotating the prototypical result document with
triggers that talk about data elements that are
feeding the creation of the result.  A process
then creates the XSLT to use against the data to mimic the prototypical
result.</pre><br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>Can you suggest simpler alternatives?
</tt></blockquote><pre style="margin: 0em;"><br>Perhaps these might help in some small way ... I know they have helped
others:</pre><br>
<pre style="margin: 0em;">  http://www.CraneSoftwrights.com/resources/#literatexslt
  http://www.CraneSoftwrights.com/resources/#resultxslt</pre><br>
<tt>. . . . . . . . Ken</tt><br>
<br>
<pre style="margin: 0em;"><br>--
Public XSLT, XSL-FO, UBL and code list classes in Europe -- Apr 2013 |
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post60040.html</link><pubDate>Tue, 19 Mar 2013 09:44:12 GMT</pubDate></item><item><title>Re:  Modes - Necessary Construct or Syntactic Sugar</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 19/03/2013 08:58, Ihe Onwuka wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">Suppose there was a genuine use case for modes. By genuine I mean the
transform requires me to process the same nodes more than once and in
different ways.</pre><br>
<tt>Can I do this without using modes.</tt><br>
<br>
<pre style="margin: 0em;">The first thing that comes to mind is creating an separate stylesheet
for the &quot;2nd mode&quot; and applying it's template rules via apply-imports.
</pre></blockquote><tt>No, this doesn't work. If you only have one mode, then apply-templates 
selecting a given node N will always select the same template rule. 
Modes are the only way you can have two different rules that apply to 
the same node in different circumstances.</tt><br>
<br>
<pre style="margin: 0em;">Michael Kay
Saxonica</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post30040.html</link><pubDate>Tue, 19 Mar 2013 09:19:18 GMT</pubDate></item><item><title> Modes - Necessary Construct or Syntactic Sugar</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Suppose there was a genuine use case for modes. By genuine I mean the
transform requires me to process the same nodes more than once and in
different ways.

Can I do this without using modes.

The first thing that comes to mind is creating an separate stylesheet
for the &quot;2nd mode&quot; and applying it's template rules via apply-imports.

The next thing that comes to mind is what if some of those rules want
to apply templates from the parent stylesheet. Well importing the
importer into the importee is not allowed but the rules don't seem to
prohibit including the importee.

So is this sufficient to dispense with modes from the subset of the
language I want to use.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post20040.html</link><pubDate>Tue, 19 Mar 2013 08:58:36 GMT</pubDate></item><item><title> WorldML Filteration</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Hi, 
I have got a good clue about formatting elements for worldML. In the similar
effort we need to filter these elements. Comparison of &quot;current output&quot; and
&quot;desired output&quot; is sufficient to understand the requirement.

Input
&lt;w:r&gt;&lt;w:rPr&gt;&lt;w:i/&gt;&lt;w:i-cs/&gt;&lt;/w:rPr&gt;&lt;w:t&gt;Azienda&lt;/w:t&gt;&lt;/w:r&gt;
&lt;w:r&gt;&lt;w:rPr&gt;&lt;w:i/&gt;&lt;w:i-cs/&gt;&lt;/w:rPr&gt;&lt;w:t&gt; &lt;/w:t&gt;&lt;/w:r&gt;
&lt;w:r&gt;&lt;w:rPr&gt;&lt;w:i/&gt;&lt;w:b/&gt;&lt;w:i-cs/&gt;&lt;/w:rPr&gt;&lt;w:t&gt;Ospedaliera&lt;/w:t&gt;&lt;/w:r&gt;
&lt;w:r&gt;&lt;w:rPr&gt;&lt;w:i/&gt;&lt;w:b/&gt;&lt;w:i-cs/&gt;&lt;/w:rPr&gt;&lt;w:t&gt;, &lt;/w:t&gt;&lt;/w:r&gt;
&lt;w:r&gt;&lt;w:rPr&gt;&lt;w:i/&gt;&lt;w:i-cs/&gt;&lt;/w:rPr&gt;&lt;w:t&gt;Ospedali&lt;/w:t&gt;&lt;/w:r&gt;
&lt;w:r&gt;&lt;w:rPr&gt;&lt;w:i/&gt;&lt;w:i-cs/&gt;&lt;/w:rPr&gt;&lt;w:t&gt; &lt;/w:t&gt;&lt;/w:r&gt;
&lt;w:proofErr w:type=&quot;spellStart&quot;/&gt;
&lt;w:r&gt;&lt;w:rPr&gt;&lt;w:i/&gt;&lt;w:i-cs/&gt;&lt;/w:rPr&gt;&lt;w:t&gt;Riuniti&lt;/w:t&gt;&lt;/w:r&gt;

XSLT
&lt;!--Text run container--&gt;
 &lt;xsl:template match=&quot;w:r&quot;&gt;
  &lt;xsl:choose&gt;
   &lt;xsl:when
test=&quot;w:rPr/w:vertAlign|w:rPr/w:u|w:rPr/w:b|w:rPr/w:i|w:rPr/w:smallCaps|w:rP
r/w:highlight&quot;&gt;
    &lt;xsl:apply-templates select=&quot;w:rPr&quot; mode=&quot;styling&quot;/&gt;
   &lt;/xsl:when&gt;
   &lt;xsl:otherwise&gt;
    &lt;xsl:apply-templates/&gt;
   &lt;/xsl:otherwise&gt;
  &lt;/xsl:choose&gt;
 &lt;/xsl:template&gt;

&lt;!--Text run properties container--&gt;
 &lt;xsl:template match=&quot;w:rPr&quot; mode=&quot;styling&quot;&gt;
   &lt;xsl:for-each select=&quot;child::w:*[1]&quot;&gt;
     &lt;xsl:variable name=&quot;name&quot;&gt;
       &lt;xsl:choose&gt;
        &lt;xsl:when test=&quot;local-name() eq 'b'&quot;&gt;
         &lt;xsl:value-of select=&quot;local-name()&quot;/&gt;
        &lt;/xsl:when&gt;
        &lt;xsl:when test=&quot;local-name() eq 'i'&quot;&gt;
         &lt;xsl:value-of select=&quot;local-name()&quot;/&gt;
        &lt;/xsl:when&gt;
      &lt;/xsl:choose&gt;
     &lt;/xsl:variable&gt;
     &lt;xsl:if test=&quot;$name!=''&quot;&gt;
      &lt;xsl:element name=&quot;{$name}&quot;&gt;
       &lt;xsl:call-template name=&quot;nestedTemplate&quot;/&gt;
      &lt;/xsl:element&gt;
     &lt;/xsl:if&gt;
     &lt;xsl:if test=&quot;$name=''&quot;&gt;
       &lt;xsl:call-template name=&quot;nestedTemplate&quot;/&gt;
     &lt;/xsl:if&gt;
   &lt;/xsl:for-each&gt;  
 &lt;/xsl:template&gt;

 &lt;xsl:template name=&quot;nestedTemplate&quot;&gt;
   &lt;xsl:param name=&quot;inital&quot; select=&quot;2&quot;/&gt;
   &lt;xsl:choose&gt;
     &lt;xsl:when test=&quot;following-sibling::w:*[$inital - 1]&quot;&gt;
      &lt;xsl:variable name=&quot;name&quot;&gt;
       &lt;xsl:choose&gt;
        &lt;xsl:when test=&quot;following-sibling::w:*[$inital - 1]/local-name() eq
'b'&quot;&gt;
         &lt;xsl:value-of select=&quot;'b'&quot;/&gt;
        &lt;/xsl:when&gt;
        &lt;xsl:when test=&quot;following-sibling::w:*[$inital - 1]/local-name() eq
'i'&quot;&gt;
         &lt;xsl:value-of select=&quot;'i'&quot;/&gt;
        &lt;/xsl:when&gt;
       &lt;/xsl:choose&gt;
      &lt;/xsl:variable&gt;  
      &lt;xsl:if test=&quot;$name!=''&quot;&gt;  
       &lt;xsl:element name=&quot;{$name}&quot;&gt;
        &lt;xsl:if test=&quot;following-sibling::w:*[$inital - 1]&quot;&gt;
          &lt;xsl:call-template name=&quot;nestedTemplate&quot;&gt;
            &lt;xsl:with-param name=&quot;inital&quot; select=&quot;$inital + 1&quot;/&gt;
           &lt;/xsl:call-template&gt;
         &lt;/xsl:if&gt;                
       &lt;/xsl:element&gt;
      &lt;/xsl:if&gt;
      &lt;xsl:if test=&quot;$name=''&quot;&gt;  
       &lt;xsl:if test=&quot;following-sibling::w:*[$inital - 1]&quot;&gt;
         &lt;xsl:call-template name=&quot;nestedTemplate&quot;&gt;
           &lt;xsl:with-param name=&quot;inital&quot; select=&quot;$inital + 1&quot;/&gt;
          &lt;/xsl:call-template&gt;
        &lt;/xsl:if&gt;                
      &lt;/xsl:if&gt;
     &lt;/xsl:when&gt;
     &lt;xsl:otherwise&gt;
       &lt;xsl:apply-templates
select=&quot;parent::w:rPr/following-sibling::w:*[1][local-name()='t']&quot;/&gt;
     &lt;/xsl:otherwise&gt;
   &lt;/xsl:choose&gt;
 &lt;/xsl:template&gt;

Current output
&lt;i&gt;Azienda&lt;/i&gt;&lt;i&gt; &lt;/i&gt;&lt;i&gt;&lt;b&gt;Ospedaliera&lt;/b&gt;&lt;/i&gt;&lt;i&gt;&lt;b&gt;,
&lt;/b&gt;&lt;/i&gt;&lt;i&gt;Ospedali&lt;/i&gt;&lt;i&gt; &lt;/i&gt;&lt;i&gt;Riuniti&lt;/i&gt;

Desired output
&lt;i&gt;Azienda &lt;b&gt;Ospedaliera, &lt;/b&gt;Ospedali Riuniti&lt;/i&gt;

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post90030.html</link><pubDate>Mon, 18 Mar 2013 11:44:15 GMT</pubDate></item><item><title>Re:  WorldML Filteration</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Joga,
I try again.
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&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; xmlns:w=&quot;something&quot; xmlns:tb=&quot;something-else&quot;&gt;
    &lt;!-- function
turns the existance or not of a w:b into something the group-adjacent can use
--&gt;
    &lt;xsl:strip-space elements=&quot;*&quot;/&gt;
    &lt;xsl:function name=&quot;tb:switch-b&quot;&gt;
        &lt;xsl:param name=&quot;r&quot;/&gt;
        &lt;xsl:choose&gt;
            &lt;xsl:when
test=&quot;boolean($r/w:rPr/w:b) = true()&quot;&gt;1&lt;/xsl:when&gt;
            &lt;xsl:when
test=&quot;boolean($r/w:rPr/w:b) = false()&quot;&gt;0&lt;/xsl:when&gt;
        &lt;/xsl:choose&gt;
   
&lt;/xsl:function&gt;
   &lt;!-- start here I put a root around the sample file called
w:p --&gt;
    &lt;xsl:template match=&quot;/w:p&quot;&gt;
        &lt;xsl:result-document
href=&quot;wordml-01-output.xml&quot;&gt;
            &lt;!-- with the given sample file there
will be only one group --&gt;
            &lt;xsl:for-each-group select=&quot;w:r&quot;
group-adjacent=&quot;w:rPr/w:i&quot;&gt;
                &lt;xsl:element name=&quot;i&quot;&gt;
                    &lt;!-- group by bold and not bold --&gt;
                   
&lt;xsl:for-each-group select=&quot;current-group()/self::w:r&quot;
group-adjacent=&quot;tb:switch-b(.)&quot;&gt;
                        &lt;xsl:choose&gt;
                            &lt;xsl:when test=&quot;current-group()//w:b&quot;&gt;
                                &lt;xsl:element name=&quot;b&quot;&gt;
                                    &lt;xsl:value-of 
select=&quot;current-group()//w:t&quot;/&gt;                            
                                &lt;/xsl:element&gt;
                           
&lt;/xsl:when&gt;
                            &lt;xsl:otherwise&gt;
                                &lt;xsl:value-of  select=&quot;current-group()//w:t&quot;/&gt;
                            &lt;/xsl:otherwise&gt;
                       
&lt;/xsl:choose&gt;
                    &lt;/xsl:for-each-group&gt;
               
&lt;/xsl:element&gt;
            &lt;/xsl:for-each-group&gt;
       
&lt;/xsl:result-document&gt;
    &lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;
Terry




-----
Original Message -----
From: Joga Singh Rawat &lt;jrawat@xxxxxxxxxxxxxx&gt;
To:
xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Cc: 
Sent: Monday, March 18, 2013 2:14 AM
Subject:  WorldML Filteration

Hi, 
I have got a good clue about
formatting elements for worldML. In the similar
effort we need to filter these
elements. Comparison of &quot;current output&quot; and
&quot;desired output&quot; is sufficient to
understand the requirement.

Input
&lt;w:r&gt;&lt;w:rPr&gt;&lt;w:i/&gt;&lt;w:i-cs/&gt;&lt;/w:rPr&gt;&lt;w:t&gt;Azienda&lt;/w:t&gt;&lt;/w:r&gt;
&lt;w:r&gt;&lt;w:rPr&gt;&lt;w:i/&gt;&lt;w:i-cs/&gt;&lt;/w:rPr&gt;&lt;w:t&gt; &lt;/w:t&gt;&lt;/w:r&gt;
&lt;w:r&gt;&lt;w:rPr&gt;&lt;w:i/&gt;&lt;w:b/&gt;&lt;w:i-cs/&gt;&lt;/w:rPr&gt;&lt;w:t&gt;Ospedaliera&lt;/w:t&gt;&lt;/w:r&gt;
&lt;w:r&gt;&lt;w:rPr&gt;&lt;w:i/&gt;&lt;w:b/&gt;&lt;w:i-cs/&gt;&lt;/w:rPr&gt;&lt;w:t&gt;, &lt;/w:t&gt;&lt;/w:r&gt;
&lt;w:r&gt;&lt;w:rPr&gt;&lt;w:i/&gt;&lt;w:i-cs/&gt;&lt;/w:rPr&gt;&lt;w:t&gt;Ospedali&lt;/w:t&gt;&lt;/w:r&gt;
&lt;w:r&gt;&lt;w:rPr&gt;&lt;w:i/&gt;&lt;w:i-cs/&gt;&lt;/w:rPr&gt;&lt;w:t&gt; &lt;/w:t&gt;&lt;/w:r&gt;
&lt;w:proofErr
w:type=&quot;spellStart&quot;/&gt;
&lt;w:r&gt;&lt;w:rPr&gt;&lt;w:i/&gt;&lt;w:i-cs/&gt;&lt;/w:rPr&gt;&lt;w:t&gt;Riuniti&lt;/w:t&gt;&lt;/w:r&gt;

XSLT
&lt;!--Text run
container--&gt;
&lt;xsl:template match=&quot;w:r&quot;&gt;
  &lt;xsl:choose&gt;
   &lt;xsl:when
test=&quot;w:rPr/w:vertAlign|w:rPr/w:u|w:rPr/w:b|w:rPr/w:i|w:rPr/w:smallCaps|w:rP
r/w:highlight&quot;&gt;
    &lt;xsl:apply-templates select=&quot;w:rPr&quot; mode=&quot;styling&quot;/&gt;
 
&lt;/xsl:when&gt;
   &lt;xsl:otherwise&gt;
    &lt;xsl:apply-templates/&gt;
   &lt;/xsl:otherwise&gt;
  &lt;/xsl:choose&gt;
&lt;/xsl:template&gt;

&lt;!--Text run properties container--&gt;
&lt;xsl:template match=&quot;w:rPr&quot; mode=&quot;styling&quot;&gt;
   &lt;xsl:for-each
select=&quot;child::w:*[1]&quot;&gt;
     &lt;xsl:variable name=&quot;name&quot;&gt;
       &lt;xsl:choose&gt;
 
      &lt;xsl:when test=&quot;local-name() eq 'b'&quot;&gt;
         &lt;xsl:value-of
select=&quot;local-name()&quot;/&gt;
        &lt;/xsl:when&gt;
        &lt;xsl:when
test=&quot;local-name() eq 'i'&quot;&gt;
         &lt;xsl:value-of select=&quot;local-name()&quot;/&gt;
   
    &lt;/xsl:when&gt;
      &lt;/xsl:choose&gt;
     &lt;/xsl:variable&gt;
     &lt;xsl:if
test=&quot;$name!=''&quot;&gt;
      &lt;xsl:element name=&quot;{$name}&quot;&gt;
       &lt;xsl:call-template
name=&quot;nestedTemplate&quot;/&gt;
      &lt;/xsl:element&gt;
     &lt;/xsl:if&gt;
     &lt;xsl:if
test=&quot;$name=''&quot;&gt;
       &lt;xsl:call-template name=&quot;nestedTemplate&quot;/&gt;
   
&lt;/xsl:if&gt;
   &lt;/xsl:for-each&gt;  
&lt;/xsl:template&gt;

&lt;xsl:template
name=&quot;nestedTemplate&quot;&gt;
   &lt;xsl:param name=&quot;inital&quot; select=&quot;2&quot;/&gt;
 
&lt;xsl:choose&gt;
     &lt;xsl:when test=&quot;following-sibling::w:*[$inital - 1]&quot;&gt;
     
&lt;xsl:variable name=&quot;name&quot;&gt;
       &lt;xsl:choose&gt;
        &lt;xsl:when
test=&quot;following-sibling::w:*[$inital - 1]/local-name() eq
'b'&quot;&gt;
       
&lt;xsl:value-of select=&quot;'b'&quot;/&gt;
        &lt;/xsl:when&gt;
        &lt;xsl:when
test=&quot;following-sibling::w:*[$inital - 1]/local-name() eq
'i'&quot;&gt;
       
&lt;xsl:value-of select=&quot;'i'&quot;/&gt;
        &lt;/xsl:when&gt;
       &lt;/xsl:choose&gt;
     
&lt;/xsl:variable&gt;  
      &lt;xsl:if test=&quot;$name!=''&quot;&gt;  
       &lt;xsl:element
name=&quot;{$name}&quot;&gt;
        &lt;xsl:if test=&quot;following-sibling::w:*[$inital - 1]&quot;&gt;
 
        &lt;xsl:call-template name=&quot;nestedTemplate&quot;&gt;
            &lt;xsl:with-param
name=&quot;inital&quot; select=&quot;$inital + 1&quot;/&gt;
           &lt;/xsl:call-template&gt;
       
&lt;/xsl:if&gt;                
       &lt;/xsl:element&gt;
      &lt;/xsl:if&gt;
      &lt;xsl:if
test=&quot;$name=''&quot;&gt;  
       &lt;xsl:if test=&quot;following-sibling::w:*[$inital - 1]&quot;&gt;
         &lt;xsl:call-template name=&quot;nestedTemplate&quot;&gt;
           &lt;xsl:with-param
name=&quot;inital&quot; select=&quot;$inital + 1&quot;/&gt;
          &lt;/xsl:call-template&gt;
       
&lt;/xsl:if&gt;                
      &lt;/xsl:if&gt;
     &lt;/xsl:when&gt;
   
&lt;xsl:otherwise&gt;
       &lt;xsl:apply-templates
select=&quot;parent::w:rPr/following-sibling::w:*[1][local-name()='t']&quot;/&gt;
   
&lt;/xsl:otherwise&gt;
   &lt;/xsl:choose&gt;
&lt;/xsl:template&gt;

Current output
&lt;i&gt;Azienda&lt;/i&gt;&lt;i&gt; &lt;/i&gt;&lt;i&gt;&lt;b&gt;Ospedaliera&lt;/b&gt;&lt;/i&gt;&lt;i&gt;&lt;b&gt;,
&lt;/b&gt;&lt;/i&gt;&lt;i&gt;Ospedali&lt;/i&gt;&lt;i&gt; &lt;/i&gt;&lt;i&gt;Riuniti&lt;/i&gt;

Desired output
&lt;i&gt;Azienda
&lt;b&gt;Ospedaliera, &lt;/b&gt;Ospedali Riuniti&lt;/i&gt;

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post10040.html</link><pubDate>Mon, 18 Mar 2013 06:15:58 GMT</pubDate></item><item><title>Re:  WorldML Filteration</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Joga,
Try this - it much more fun with groups and functions and it does work
for the sample provided:
Terry&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;



From:
Joga Singh Rawat &lt;jrawat@xxxxxxxxxxxxxx&gt;
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Sent: Monday, March 18, 2013 2:14 AM
Subject:  WorldML Filteration

Hi,
I have got a good clue about formatting elements for worldML. In the similar
effort we need to filter these elements. Comparison of &quot;current output&quot; and
&quot;desired output&quot; is sufficient to understand the requirement.

Input
&lt;w:r&gt;&lt;w:rPr&gt;&lt;w:i/&gt;&lt;w:i-cs/&gt;&lt;/w:rPr&gt;&lt;w:t&gt;Azienda&lt;/w:t&gt;&lt;/w:r&gt;
&lt;w:r&gt;&lt;w:rPr&gt;&lt;w:i/&gt;&lt;w:i-cs/&gt;&lt;/w:rPr&gt;&lt;w:t&gt; &lt;/w:t&gt;&lt;/w:r&gt;
&lt;w:r&gt;&lt;w:rPr&gt;&lt;w:i/&gt;&lt;w:b/&gt;&lt;w:i-cs/&gt;&lt;/w:rPr&gt;&lt;w:t&gt;Ospedaliera&lt;/w:t&gt;&lt;/w:r&gt;
&lt;w:r&gt;&lt;w:rPr&gt;&lt;w:i/&gt;&lt;w:b/&gt;&lt;w:i-cs/&gt;&lt;/w:rPr&gt;&lt;w:t&gt;, &lt;/w:t&gt;&lt;/w:r&gt;
&lt;w:r&gt;&lt;w:rPr&gt;&lt;w:i/&gt;&lt;w:i-cs/&gt;&lt;/w:rPr&gt;&lt;w:t&gt;Ospedali&lt;/w:t&gt;&lt;/w:r&gt;
&lt;w:r&gt;&lt;w:rPr&gt;&lt;w:i/&gt;&lt;w:i-cs/&gt;&lt;/w:rPr&gt;&lt;w:t&gt; &lt;/w:t&gt;&lt;/w:r&gt;
&lt;w:proofErr
w:type=&quot;spellStart&quot;/&gt;
&lt;w:r&gt;&lt;w:rPr&gt;&lt;w:i/&gt;&lt;w:i-cs/&gt;&lt;/w:rPr&gt;&lt;w:t&gt;Riuniti&lt;/w:t&gt;&lt;/w:r&gt;

XSLT
&lt;!--Text run
container--&gt;
&lt;xsl:template match=&quot;w:r&quot;&gt;
  &lt;xsl:choose&gt;
  &lt;xsl:when
test=&quot;w:rPr/w:vertAlign|w:rPr/w:u|w:rPr/w:b|w:rPr/w:i|w:rPr/w:smallCaps|w:rP
r/w:highlight&quot;&gt;
    &lt;xsl:apply-templates select=&quot;w:rPr&quot; mode=&quot;styling&quot;/&gt;
 
&lt;/xsl:when&gt;
  &lt;xsl:otherwise&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/xsl:otherwise&gt;
 
&lt;/xsl:choose&gt;
&lt;/xsl:template&gt;

&lt;!--Text run properties container--&gt;
&lt;xsl:template match=&quot;w:rPr&quot; mode=&quot;styling&quot;&gt;
  &lt;xsl:for-each
select=&quot;child::w:*[1]&quot;&gt;
    &lt;xsl:variable name=&quot;name&quot;&gt;
      &lt;xsl:choose&gt;
   
    &lt;xsl:when test=&quot;local-name() eq 'b'&quot;&gt;
        &lt;xsl:value-of
select=&quot;local-name()&quot;/&gt;
        &lt;/xsl:when&gt;
        &lt;xsl:when
test=&quot;local-name() eq 'i'&quot;&gt;
        &lt;xsl:value-of select=&quot;local-name()&quot;/&gt;
   
    &lt;/xsl:when&gt;
      &lt;/xsl:choose&gt;
    &lt;/xsl:variable&gt;
    &lt;xsl:if
test=&quot;$name!=''&quot;&gt;
      &lt;xsl:element name=&quot;{$name}&quot;&gt;
      &lt;xsl:call-template
name=&quot;nestedTemplate&quot;/&gt;
      &lt;/xsl:element&gt;
    &lt;/xsl:if&gt;
    &lt;xsl:if
test=&quot;$name=''&quot;&gt;
      &lt;xsl:call-template name=&quot;nestedTemplate&quot;/&gt;
   
&lt;/xsl:if&gt;
  &lt;/xsl:for-each&gt;  
&lt;/xsl:template&gt;

&lt;xsl:template
name=&quot;nestedTemplate&quot;&gt;
  &lt;xsl:param name=&quot;inital&quot; select=&quot;2&quot;/&gt;
  &lt;xsl:choose&gt;
    &lt;xsl:when test=&quot;following-sibling::w:*[$inital - 1]&quot;&gt;
      &lt;xsl:variable
name=&quot;name&quot;&gt;
      &lt;xsl:choose&gt;
        &lt;xsl:when
test=&quot;following-sibling::w:*[$inital - 1]/local-name() eq
'b'&quot;&gt;
       
&lt;xsl:value-of select=&quot;'b'&quot;/&gt;
        &lt;/xsl:when&gt;
        &lt;xsl:when
test=&quot;following-sibling::w:*[$inital - 1]/local-name() eq
'i'&quot;&gt;
       
&lt;xsl:value-of select=&quot;'i'&quot;/&gt;
        &lt;/xsl:when&gt;
      &lt;/xsl:choose&gt;
     
&lt;/xsl:variable&gt;  
      &lt;xsl:if test=&quot;$name!=''&quot;&gt;  
      &lt;xsl:element
name=&quot;{$name}&quot;&gt;
        &lt;xsl:if test=&quot;following-sibling::w:*[$inital - 1]&quot;&gt;
 
        &lt;xsl:call-template name=&quot;nestedTemplate&quot;&gt;
            &lt;xsl:with-param
name=&quot;inital&quot; select=&quot;$inital + 1&quot;/&gt;
          &lt;/xsl:call-template&gt;
       
&lt;/xsl:if&gt;                
      &lt;/xsl:element&gt;
      &lt;/xsl:if&gt;
      &lt;xsl:if
test=&quot;$name=''&quot;&gt;  
      &lt;xsl:if test=&quot;following-sibling::w:*[$inital - 1]&quot;&gt;
 
      &lt;xsl:call-template name=&quot;nestedTemplate&quot;&gt;
          &lt;xsl:with-param
name=&quot;inital&quot; select=&quot;$inital + 1&quot;/&gt;
          &lt;/xsl:call-template&gt;
       
&lt;/xsl:if&gt;                
      &lt;/xsl:if&gt;
    &lt;/xsl:when&gt;
    &lt;xsl:otherwise&gt;
      &lt;xsl:apply-templates
select=&quot;parent::w:rPr/following-sibling::w:*[1][local-name()='t']&quot;/&gt;
   
&lt;/xsl:otherwise&gt;
  &lt;/xsl:choose&gt;
&lt;/xsl:template&gt;

Current output
&lt;i&gt;Azienda&lt;/i&gt;&lt;i&gt; &lt;/i&gt;&lt;i&gt;&lt;b&gt;Ospedaliera&lt;/b&gt;&lt;/i&gt;&lt;i&gt;&lt;b&gt;,
&lt;/b&gt;&lt;/i&gt;&lt;i&gt;Ospedali&lt;/i&gt;&lt;i&gt; &lt;/i&gt;&lt;i&gt;Riuniti&lt;/i&gt;

Desired output
&lt;i&gt;Azienda
&lt;b&gt;Ospedaliera, &lt;/b&gt;Ospedali Riuniti&lt;/i&gt;
&lt;xsl:stylesheetxmlns: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;xmlns:w=&quot;something&quot;xmlns:tb=&quot;somethi
ng-else&quot;&gt;
&lt;!-- function turns the existance or not of a w:b into something the
group-adjacent can use --&gt;
&lt;xsl:strip-spaceelements=&quot;*&quot;/&gt;
&lt;xsl:functionname=&quot;tb:switch-b&quot;&gt;
&lt;xsl:paramname=&quot;r&quot;/&gt;
&lt;xsl:choose&gt;
&lt;xsl:whentest=&quot;boolean($r/w:rPr/w:b) = true()&quot;&gt;1&lt;/xsl:when&gt;
&lt;xsl:whentest=&quot;boolean($r/w:rPr/w:b) = false()&quot;&gt;0&lt;/xsl:when&gt;
&lt;/xsl:choose&gt;
&lt;/xsl:function&gt;
&lt;!-- start here I put a root around the sample file called w:p
--&gt;
&lt;xsl:templatematch=&quot;/w:p&quot;&gt;
&lt;xsl:result-documenthref=&quot;wordml-01-output.xml&quot;&gt;
&lt;!-- with the given sample
file there will be only one group --&gt;
&lt;xsl:for-each-groupselect=&quot;w:r&quot;group-adjacent=&quot;w:rPr/w:i&quot;&gt;
&lt;xsl:elementname=&quot;i&quot;&gt;
&lt;!-- group by bold and not bold --&gt;
&lt;xsl:for-each-groupselect=&quot;current-group()/self::w:r&quot;group-adjacent=&quot;tb:switc
h-b(.)&quot;&gt;
&lt;xsl:choose&gt;
&lt;xsl:whentest=&quot;current-group()//w:b&quot;&gt;
&lt;xsl:elementname=&quot;b&quot;&gt;
&lt;xsl:value-ofselect=&quot;current-group()//w:t&quot;/&gt;
&lt;/xsl:element&gt;
&lt;/xsl:when&gt;
&lt;xsl:otherwise&gt;
&lt;xsl:value-ofselect=&quot;current-group()//w:t&quot;/&gt;
&lt;/xsl:otherwise&gt;
&lt;/xsl:choose&gt;
&lt;/xsl:for-each-group&gt;
&lt;/xsl:element&gt;
&lt;/xsl:for-each-group&gt;
&lt;/xsl:result-document&gt;
&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post00040.html</link><pubDate>Mon, 18 Mar 2013 06:10:02 GMT</pubDate></item><item><title>Re:  Hierarchy to Flat Structure</title><description><![CDATA[<!--X-Body-of-Message-->
<pre style="margin: 0em;">And you will love this,
the XSLT2 solution... worth considering, no?</pre><br>
<pre style="margin: 0em;">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;xsl:stylesheet version=&quot;2.0&quot;
    xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt;</pre><br>
<tt>    &lt;xsl:output indent=&quot;yes&quot; /&gt;</tt><br>
<br>
<pre style="margin: 0em;">    &lt;xsl:template match=&quot;Cases/Cases&quot;&gt;
        &lt;Cases&gt;
            &lt;xsl:for-each-group select=&quot;*&quot; group-starting-with=&quot;Category&quot;&gt;
                &lt;Case&gt;
                    &lt;xsl:copy-of select=&quot;current-group()&quot;&gt;&lt;/xsl:copy-of&gt;
                &lt;/Case&gt;
            &lt;/xsl:for-each-group&gt;
        &lt;/Cases&gt;
    &lt;/xsl:template&gt;</pre><br>
<tt> &lt;/xsl:stylesheet&gt;</tt><br>
<br>
<tt></tt><br>
<br>
<tt>At 02:57 17/03/2013, Rick Quatro wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">I am trying to add hierarchy to a flat structure and have it basically
working. But I am wondering if there is a way to generalize the children
that I am adding. Hopefully an example will help illustrate what I am doing.</pre><br>
<tt>Input:</tt><br>
<br>
<pre style="margin: 0em;">&lt;Cases&gt;
        &lt;Cases&gt;
                &lt;Category&gt;Category One&lt;/Category&gt;
                &lt;CaseTitle&gt;Category One Title&lt;/CaseTitle&gt;
                &lt;Institution&gt;Category One Institution&lt;/Institution &gt;
                &lt;Author&gt;Category One Author&lt;/Author&gt;
                &lt;History&gt;Category One History&lt;/History&gt;
                &lt;Category&gt;Category Two&lt;/Category&gt;
                &lt;CaseTitle&gt;Category Two Title&lt;/CaseTitle&gt;
                &lt;Institution&gt;Category Two Institution&lt;/Institution &gt;
                &lt;Author&gt;Category Two Author&lt;/Author&gt;
                &lt;History&gt;Category Two History&lt;/History&gt;
        &lt;/Cases&gt;
&lt;/Cases&gt;</pre><br>
<tt>Output:</tt><br>
<br>
<pre style="margin: 0em;">&lt;Cases&gt;
        &lt;Case&gt;
                &lt;Category&gt;Category One&lt;/Category&gt;
                &lt;CaseTitle&gt;Category One Title&lt;/CaseTitle&gt;
                &lt;Institution&gt;Category One Institution&lt;/Institution &gt;
        &lt;/Case&gt;
        &lt;Case&gt;
                &lt;Category&gt;Category Two&lt;/Category&gt;
                &lt;CaseTitle&gt;Category Two Title&lt;/CaseTitle&gt;
                &lt;Institution&gt;Category Two Institution&lt;/Institution &gt;
        &lt;/Case&gt;
&lt;/Cases&gt;</pre><br>
<tt>Stylesheet:</tt><br>
<br>
<pre style="margin: 0em;">&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;&gt;</pre><br>
<tt>    &lt;xsl:output indent=&quot;yes&quot; /&gt;</tt><br>
<br>
<pre style="margin: 0em;">    &lt;xsl:template match=&quot;Cases/Cases&quot;&gt;
    &lt;Cases&gt;
        &lt;xsl:apply-templates select=&quot;Category&quot; /&gt;
    &lt;/Cases&gt;
    &lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">    &lt;xsl:template match=&quot;Category&quot;&gt;
        &lt;Case&gt;
            &lt;Category&gt;&lt;xsl:value-of select=&quot;.&quot; /&gt;&lt;/Category&gt;
            &lt;xsl:apply-templates
                select=&quot;following-sibling::CaseTitle
                [generate-id(preceding-sibling::Category[1])
                = generate-id(current())]&quot; /&gt;
            &lt;xsl:apply-templates
                select=&quot;following-sibling::Institution
                [generate-id(preceding-sibling::Category[1])
                = generate-id(current())]&quot; /&gt;
        &lt;/Case&gt;
    &lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">    &lt;xsl:template match=&quot;CaseTitle&quot;&gt;
        &lt;xsl:copy-of select=&quot;.&quot; /&gt;
    &lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">    &lt;xsl:template match=&quot;Institution&quot;&gt;
        &lt;xsl:copy-of select=&quot;.&quot; /&gt;
    &lt;/xsl:template&gt;</pre><br>
<tt>&lt;/xsl:stylesheet&gt;</tt><br>
<br>
<pre style="margin: 0em;">I have template rules for each of the following siblings of Category and I
can add more for Author, etc., but it seems like there should be a way to
generalize this for any number of elements. Any help would be appreciated.</pre><br>
<tt>Rick
</tt></blockquote><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post70030.html</link><pubDate>Sun, 17 Mar 2013 11:14:17 GMT</pubDate></item><item><title>Re:  Hierarchy to Flat Structure</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>Hi Rick,</tt><br>
<br>
<tt>As I said, I would use sibling recursion.</tt><br>
<br>
<tt>Start at the first Category element and walk the following-sibling 
axis, like this</tt><br>
<br>
<pre style="margin: 0em;">&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;&gt;</pre><br>
<tt>    &lt;xsl:output indent=&quot;yes&quot; /&gt;</tt><br>
<br>
<pre style="margin: 0em;">    &lt;xsl:template match=&quot;Cases/Cases&quot;&gt;
        &lt;Cases&gt;
            &lt;xsl:apply-templates select=&quot;Category[1]&quot; /&gt;
        &lt;/Cases&gt;
    &lt;/xsl:template&gt;</pre><br>
<tt>    &lt;xsl:template match=&quot;Category&quot;&gt;<br>
        &lt;Case&gt;<br>
            &lt;xsl:copy-of select=&quot;.&quot; /&gt;<br>
            &lt;xsl:apply-templates 
select=&quot;following-sibling::*[1][not(self::Category)]&quot; mode=&quot;in-case-siblings&quot;/&gt;<br>
        &lt;/Case&gt;<br>
        &lt;xsl:apply-templates select=&quot;following-sibling::Category[1]&quot;/&gt;<br>
    &lt;/xsl:template&gt;</tt><br>
<br>
<tt>    &lt;xsl:template match=&quot;*&quot; mode=&quot;in-case-siblings&quot;&gt;<br>
        &lt;xsl:copy-of select=&quot;.&quot; /&gt;<br>
        &lt;xsl:apply-templates 
select=&quot;following-sibling::*[1][not(self::Category)]&quot; mode=&quot;in-case-siblings&quot;/&gt;<br>
    &lt;/xsl:template&gt;</tt><br>
<br>
<tt>    &lt;xsl:template match=&quot;Category&quot; mode=&quot;in-case-siblings&quot;/&gt;</tt><br>
<br>
<tt> &lt;/xsl:stylesheet&gt;</tt><br>
<br>
<tt>Cheers</tt><br>
<br>
<tt>Geert</tt><br>
<br>
<tt></tt><br>
<br>
<tt></tt><br>
<br>
<tt>At 02:57 17/03/2013, you wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">I am trying to add hierarchy to a flat structure and have it basically
working. But I am wondering if there is a way to generalize the children
that I am adding. Hopefully an example will help illustrate what I am doing.</pre><br>
<tt>Input:</tt><br>
<br>
<pre style="margin: 0em;">&lt;Cases&gt;
        &lt;Cases&gt;
                &lt;Category&gt;Category One&lt;/Category&gt;
                &lt;CaseTitle&gt;Category One Title&lt;/CaseTitle&gt;
                &lt;Institution&gt;Category One Institution&lt;/Institution &gt;
                &lt;Author&gt;Category One Author&lt;/Author&gt;
                &lt;History&gt;Category One History&lt;/History&gt;
                &lt;Category&gt;Category Two&lt;/Category&gt;
                &lt;CaseTitle&gt;Category Two Title&lt;/CaseTitle&gt;
                &lt;Institution&gt;Category Two Institution&lt;/Institution &gt;
                &lt;Author&gt;Category Two Author&lt;/Author&gt;
                &lt;History&gt;Category Two History&lt;/History&gt;
        &lt;/Cases&gt;
&lt;/Cases&gt;</pre><br>
<tt>Output:</tt><br>
<br>
<pre style="margin: 0em;">&lt;Cases&gt;
        &lt;Case&gt;
                &lt;Category&gt;Category One&lt;/Category&gt;
                &lt;CaseTitle&gt;Category One Title&lt;/CaseTitle&gt;
                &lt;Institution&gt;Category One Institution&lt;/Institution &gt;
        &lt;/Case&gt;
        &lt;Case&gt;
                &lt;Category&gt;Category Two&lt;/Category&gt;
                &lt;CaseTitle&gt;Category Two Title&lt;/CaseTitle&gt;
                &lt;Institution&gt;Category Two Institution&lt;/Institution &gt;
        &lt;/Case&gt;
&lt;/Cases&gt;</pre><br>
<tt>Stylesheet:</tt><br>
<br>
<pre style="margin: 0em;">&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;&gt;</pre><br>
<tt>    &lt;xsl:output indent=&quot;yes&quot; /&gt;</tt><br>
<br>
<pre style="margin: 0em;">    &lt;xsl:template match=&quot;Cases/Cases&quot;&gt;
    &lt;Cases&gt;
        &lt;xsl:apply-templates select=&quot;Category&quot; /&gt;
    &lt;/Cases&gt;
    &lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">    &lt;xsl:template match=&quot;Category&quot;&gt;
        &lt;Case&gt;
            &lt;Category&gt;&lt;xsl:value-of select=&quot;.&quot; /&gt;&lt;/Category&gt;
            &lt;xsl:apply-templates
                select=&quot;following-sibling::CaseTitle
                [generate-id(preceding-sibling::Category[1])
                = generate-id(current())]&quot; /&gt;
            &lt;xsl:apply-templates
                select=&quot;following-sibling::Institution
                [generate-id(preceding-sibling::Category[1])
                = generate-id(current())]&quot; /&gt;
        &lt;/Case&gt;
    &lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">    &lt;xsl:template match=&quot;CaseTitle&quot;&gt;
        &lt;xsl:copy-of select=&quot;.&quot; /&gt;
    &lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">    &lt;xsl:template match=&quot;Institution&quot;&gt;
        &lt;xsl:copy-of select=&quot;.&quot; /&gt;
    &lt;/xsl:template&gt;</pre><br>
<tt>&lt;/xsl:stylesheet&gt;</tt><br>
<br>
<pre style="margin: 0em;">I have template rules for each of the following siblings of Category and I
can add more for Author, etc., but it seems like there should be a way to
generalize this for any number of elements. Any help would be appreciated.</pre><br>
<tt>Rick
</tt></blockquote><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post60030.html</link><pubDate>Sun, 17 Mar 2013 11:10:39 GMT</pubDate></item><item><title>Re:  Hierarchy to Flat Structure</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>addendum</tt><br>
<br>
<tt>A more general and safer template would likely be this</tt><br>
<br>
<pre style="margin: 0em;">    &lt;xsl:template match=&quot;Cases/Cases/*[not(self::Category)]&quot;&gt;
        &lt;xsl:copy-of select=&quot;.&quot; /&gt;
    &lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">as a simple replacement for all the sibling templates
then you don't need to add the root template I suggested</pre><br>
<tt></tt><br>
<br>
<tt>At 02:57 17/03/2013, you wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">I am trying to add hierarchy to a flat structure and have it basically
working. But I am wondering if there is a way to generalize the children
that I am adding. Hopefully an example will help illustrate what I am doing.</pre><br>
<tt>Input:</tt><br>
<br>
<pre style="margin: 0em;">&lt;Cases&gt;
        &lt;Cases&gt;
                &lt;Category&gt;Category One&lt;/Category&gt;
                &lt;CaseTitle&gt;Category One Title&lt;/CaseTitle&gt;
                &lt;Institution&gt;Category One Institution&lt;/Institution &gt;
                &lt;Author&gt;Category One Author&lt;/Author&gt;
                &lt;History&gt;Category One History&lt;/History&gt;
                &lt;Category&gt;Category Two&lt;/Category&gt;
                &lt;CaseTitle&gt;Category Two Title&lt;/CaseTitle&gt;
                &lt;Institution&gt;Category Two Institution&lt;/Institution &gt;
                &lt;Author&gt;Category Two Author&lt;/Author&gt;
                &lt;History&gt;Category Two History&lt;/History&gt;
        &lt;/Cases&gt;
&lt;/Cases&gt;</pre><br>
<tt>Output:</tt><br>
<br>
<pre style="margin: 0em;">&lt;Cases&gt;
        &lt;Case&gt;
                &lt;Category&gt;Category One&lt;/Category&gt;
                &lt;CaseTitle&gt;Category One Title&lt;/CaseTitle&gt;
                &lt;Institution&gt;Category One Institution&lt;/Institution &gt;
        &lt;/Case&gt;
        &lt;Case&gt;
                &lt;Category&gt;Category Two&lt;/Category&gt;
                &lt;CaseTitle&gt;Category Two Title&lt;/CaseTitle&gt;
                &lt;Institution&gt;Category Two Institution&lt;/Institution &gt;
        &lt;/Case&gt;
&lt;/Cases&gt;</pre><br>
<tt>Stylesheet:</tt><br>
<br>
<pre style="margin: 0em;">&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;&gt;</pre><br>
<tt>    &lt;xsl:output indent=&quot;yes&quot; /&gt;</tt><br>
<br>
<pre style="margin: 0em;">    &lt;xsl:template match=&quot;Cases/Cases&quot;&gt;
    &lt;Cases&gt;
        &lt;xsl:apply-templates select=&quot;Category&quot; /&gt;
    &lt;/Cases&gt;
    &lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">    &lt;xsl:template match=&quot;Category&quot;&gt;
        &lt;Case&gt;
            &lt;Category&gt;&lt;xsl:value-of select=&quot;.&quot; /&gt;&lt;/Category&gt;
            &lt;xsl:apply-templates
                select=&quot;following-sibling::CaseTitle
                [generate-id(preceding-sibling::Category[1])
                = generate-id(current())]&quot; /&gt;
            &lt;xsl:apply-templates
                select=&quot;following-sibling::Institution
                [generate-id(preceding-sibling::Category[1])
                = generate-id(current())]&quot; /&gt;
        &lt;/Case&gt;
    &lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">    &lt;xsl:template match=&quot;CaseTitle&quot;&gt;
        &lt;xsl:copy-of select=&quot;.&quot; /&gt;
    &lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">    &lt;xsl:template match=&quot;Institution&quot;&gt;
        &lt;xsl:copy-of select=&quot;.&quot; /&gt;
    &lt;/xsl:template&gt;</pre><br>
<tt>&lt;/xsl:stylesheet&gt;</tt><br>
<br>
<pre style="margin: 0em;">I have template rules for each of the following siblings of Category and I
can add more for Author, etc., but it seems like there should be a way to
generalize this for any number of elements. Any help would be appreciated.</pre><br>
<tt>Rick
</tt></blockquote><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post50030.html</link><pubDate>Sun, 17 Mar 2013 11:03:15 GMT</pubDate></item><item><title>Re:  Hierarchy to Flat Structure</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>Hi Rick,</tt><br>
<br>
<tt>If you add a template for your root</tt><br>
<br>
<pre style="margin: 0em;">   &lt;xsl:template match=&quot;/Cases&quot;&gt;
            &lt;xsl:apply-templates /&gt;
    &lt;/xsl:template&gt;</pre><br>
<tt> you could simply do this</tt><br>
<br>
<pre style="margin: 0em;">   &lt;xsl:template match=&quot;*&quot;&gt;
        &lt;xsl:copy-of select=&quot;.&quot; /&gt;
    &lt;/xsl:template&gt;</pre><br>
<tt>for covering all the sibling notes</tt><br>
<br>
<tt>I have two observations however.</tt><br>
<br>
<tt>- it is worth looking into so called &quot;sibling recursion&quot; for doing 
such a task in XSLT1.<br>
I will post an example in a minute</tt><br>
<br>
<tt>- it is worth considering XSLT2 for this task. Let me know if that is 
a viable path.<br>
It has grouping functionality built in for a task like this</tt><br>
<br>
<tt>Cheers</tt><br>
<br>
<tt>Geert</tt><br>
<br>
<tt></tt><br>
<br>
<tt><br>At 02:57 17/03/2013, you wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">&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;&gt;</pre><br>
<tt>    &lt;xsl:output indent=&quot;yes&quot; /&gt;</tt><br>
<br>
<pre style="margin: 0em;">    &lt;xsl:template match=&quot;Cases/Cases&quot;&gt;
    &lt;Cases&gt;
        &lt;xsl:apply-templates select=&quot;Category&quot; /&gt;
    &lt;/Cases&gt;
    &lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">    &lt;xsl:template match=&quot;Category&quot;&gt;
        &lt;Case&gt;
            &lt;Category&gt;&lt;xsl:value-of select=&quot;.&quot; /&gt;&lt;/Category&gt;
            &lt;xsl:apply-templates
                select=&quot;following-sibling::CaseTitle
                [generate-id(preceding-sibling::Category[1])
                = generate-id(current())]&quot; /&gt;
            &lt;xsl:apply-templates
                select=&quot;following-sibling::Institution
                [generate-id(preceding-sibling::Category[1])
                = generate-id(current())]&quot; /&gt;
        &lt;/Case&gt;
    &lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">    &lt;xsl:template match=&quot;CaseTitle&quot;&gt;
        &lt;xsl:copy-of select=&quot;.&quot; /&gt;
    &lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">    &lt;xsl:template match=&quot;Institution&quot;&gt;
        &lt;xsl:copy-of select=&quot;.&quot; /&gt;
    &lt;/xsl:template&gt;</pre><br>
<tt>&lt;/xsl:stylesheet&gt;
</tt></blockquote><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post40030.html</link><pubDate>Sun, 17 Mar 2013 10:59:36 GMT</pubDate></item><item><title>RE:  Hierarchy to Flat Structure</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Hi Geert,

Thank you very much for all your efforts with this. The sibling recursion
works fine. I tried the XSLT 2 solution, but it doesn't work in my
environment. I am saving XML from Windows InDesign CS6 and I am not sure
what kind of processor it uses. But your solution below is excellent. Thanks
again for your help.

Rick

-----Original Message-----
From: Geert Bormans [<a  href="mailto:geert@xxxxxxxxxxxxxxxxxxx">mailto:geert@xxxxxxxxxxxxxxxxxxx</a>] 
Sent: Sunday, March 17, 2013 6:11 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Hierarchy to Flat Structure

Hi Rick,

As I said, I would use sibling recursion.

Start at the first Category element and walk the following-sibling axis,
like this

&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;&gt;

     &lt;xsl:output indent=&quot;yes&quot; /&gt;

     &lt;xsl:template match=&quot;Cases/Cases&quot;&gt;
         &lt;Cases&gt;
             &lt;xsl:apply-templates select=&quot;Category[1]&quot; /&gt;
         &lt;/Cases&gt;
     &lt;/xsl:template&gt;

     &lt;xsl:template match=&quot;Category&quot;&gt;
         &lt;Case&gt;
             &lt;xsl:copy-of select=&quot;.&quot; /&gt;
             &lt;xsl:apply-templates
select=&quot;following-sibling::*[1][not(self::Category)]&quot;
mode=&quot;in-case-siblings&quot;/&gt;
         &lt;/Case&gt;
         &lt;xsl:apply-templates select=&quot;following-sibling::Category[1]&quot;/&gt;
     &lt;/xsl:template&gt;

     &lt;xsl:template match=&quot;*&quot; mode=&quot;in-case-siblings&quot;&gt;
         &lt;xsl:copy-of select=&quot;.&quot; /&gt;
         &lt;xsl:apply-templates
select=&quot;following-sibling::*[1][not(self::Category)]&quot;
mode=&quot;in-case-siblings&quot;/&gt;
     &lt;/xsl:template&gt;

     &lt;xsl:template match=&quot;Category&quot; mode=&quot;in-case-siblings&quot;/&gt;

  &lt;/xsl:stylesheet&gt;

Cheers

Geert





At 02:57 17/03/2013, you wrote:
&gt;I am trying to add hierarchy to a flat structure and have it basically 
&gt;working. But I am wondering if there is a way to generalize the 
&gt;children that I am adding. Hopefully an example will help illustrate what I
am doing.
&gt;
&gt;Input:
&gt;
&gt;&lt;Cases&gt;
&gt;         &lt;Cases&gt;
&gt;                 &lt;Category&gt;Category One&lt;/Category&gt;
&gt;                 &lt;CaseTitle&gt;Category One Title&lt;/CaseTitle&gt;
&gt;                 &lt;Institution&gt;Category One Institution&lt;/Institution &gt;
&gt;                 &lt;Author&gt;Category One Author&lt;/Author&gt;
&gt;                 &lt;History&gt;Category One History&lt;/History&gt;
&gt;                 &lt;Category&gt;Category Two&lt;/Category&gt;
&gt;                 &lt;CaseTitle&gt;Category Two Title&lt;/CaseTitle&gt;
&gt;                 &lt;Institution&gt;Category Two Institution&lt;/Institution &gt;
&gt;                 &lt;Author&gt;Category Two Author&lt;/Author&gt;
&gt;                 &lt;History&gt;Category Two History&lt;/History&gt;
&gt;         &lt;/Cases&gt;
&gt;&lt;/Cases&gt;
&gt;
&gt;Output:
&gt;
&gt;&lt;Cases&gt;
&gt;         &lt;Case&gt;
&gt;                 &lt;Category&gt;Category One&lt;/Category&gt;
&gt;                 &lt;CaseTitle&gt;Category One Title&lt;/CaseTitle&gt;
&gt;                 &lt;Institution&gt;Category One Institution&lt;/Institution &gt;
&gt;         &lt;/Case&gt;
&gt;         &lt;Case&gt;
&gt;                 &lt;Category&gt;Category Two&lt;/Category&gt;
&gt;                 &lt;CaseTitle&gt;Category Two Title&lt;/CaseTitle&gt;
&gt;                 &lt;Institution&gt;Category Two Institution&lt;/Institution &gt;
&gt;         &lt;/Case&gt;
&gt;&lt;/Cases&gt;
&gt;
&gt;Stylesheet:
&gt;
&gt;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt;&lt;xsl:stylesheet version=&quot;1.0&quot;
&gt;     xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt;
&gt;
&gt;     &lt;xsl:output indent=&quot;yes&quot; /&gt;
&gt;
&gt;     &lt;xsl:template match=&quot;Cases/Cases&quot;&gt;
&gt;     &lt;Cases&gt;
&gt;         &lt;xsl:apply-templates select=&quot;Category&quot; /&gt;
&gt;     &lt;/Cases&gt;
&gt;     &lt;/xsl:template&gt;
&gt;
&gt;     &lt;xsl:template match=&quot;Category&quot;&gt;
&gt;         &lt;Case&gt;
&gt;             &lt;Category&gt;&lt;xsl:value-of select=&quot;.&quot; /&gt;&lt;/Category&gt;
&gt;             &lt;xsl:apply-templates
&gt;                 select=&quot;following-sibling::CaseTitle
&gt;                 [generate-id(preceding-sibling::Category[1])
&gt;                 = generate-id(current())]&quot; /&gt;
&gt;             &lt;xsl:apply-templates
&gt;                 select=&quot;following-sibling::Institution
&gt;                 [generate-id(preceding-sibling::Category[1])
&gt;                 = generate-id(current())]&quot; /&gt;
&gt;         &lt;/Case&gt;
&gt;     &lt;/xsl:template&gt;
&gt;
&gt;     &lt;xsl:template match=&quot;CaseTitle&quot;&gt;
&gt;         &lt;xsl:copy-of select=&quot;.&quot; /&gt;
&gt;     &lt;/xsl:template&gt;
&gt;
&gt;     &lt;xsl:template match=&quot;Institution&quot;&gt;
&gt;         &lt;xsl:copy-of select=&quot;.&quot; /&gt;
&gt;     &lt;/xsl:template&gt;
&gt;
&gt;&lt;/xsl:stylesheet&gt;
&gt;
&gt;I have template rules for each of the following siblings of Category 
&gt;and I can add more for Author, etc., but it seems like there should be 
&gt;a way to generalize this for any number of elements. Any help would be
appreciated.
&gt;
&gt;Rick

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post80030.html</link><pubDate>Sun, 17 Mar 2013 08:02:12 GMT</pubDate></item><item><title> Hierarchy to Flat Structure</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>I am trying to add hierarchy to a flat structure and have it basically
working. But I am wondering if there is a way to generalize the children
that I am adding. Hopefully an example will help illustrate what I am doing.

Input: 

&lt;Cases&gt;
	&lt;Cases&gt;
		&lt;Category&gt;Category One&lt;/Category&gt;
		&lt;CaseTitle&gt;Category One Title&lt;/CaseTitle&gt;
		&lt;Institution&gt;Category One Institution&lt;/Institution &gt;
		&lt;Author&gt;Category One Author&lt;/Author&gt;
		&lt;History&gt;Category One History&lt;/History&gt;
		&lt;Category&gt;Category Two&lt;/Category&gt;
		&lt;CaseTitle&gt;Category Two Title&lt;/CaseTitle&gt;
		&lt;Institution&gt;Category Two Institution&lt;/Institution &gt;
		&lt;Author&gt;Category Two Author&lt;/Author&gt;
		&lt;History&gt;Category Two History&lt;/History&gt;
	&lt;/Cases&gt;
&lt;/Cases&gt;

Output:

&lt;Cases&gt;
	&lt;Case&gt;
		&lt;Category&gt;Category One&lt;/Category&gt;
		&lt;CaseTitle&gt;Category One Title&lt;/CaseTitle&gt;
		&lt;Institution&gt;Category One Institution&lt;/Institution &gt;
	&lt;/Case&gt;
	&lt;Case&gt;
		&lt;Category&gt;Category Two&lt;/Category&gt;
		&lt;CaseTitle&gt;Category Two Title&lt;/CaseTitle&gt;
		&lt;Institution&gt;Category Two Institution&lt;/Institution &gt;
	&lt;/Case&gt;
&lt;/Cases&gt;

Stylesheet:

&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;&gt;
    
    &lt;xsl:output indent=&quot;yes&quot; /&gt;
    
    &lt;xsl:template match=&quot;Cases/Cases&quot;&gt;
    &lt;Cases&gt;
        &lt;xsl:apply-templates select=&quot;Category&quot; /&gt;
    &lt;/Cases&gt;
    &lt;/xsl:template&gt;
    
    &lt;xsl:template match=&quot;Category&quot;&gt;
        &lt;Case&gt;
            &lt;Category&gt;&lt;xsl:value-of select=&quot;.&quot; /&gt;&lt;/Category&gt;
            &lt;xsl:apply-templates
                select=&quot;following-sibling::CaseTitle
                [generate-id(preceding-sibling::Category[1])
                = generate-id(current())]&quot; /&gt;
            &lt;xsl:apply-templates
                select=&quot;following-sibling::Institution
                [generate-id(preceding-sibling::Category[1])
                = generate-id(current())]&quot; /&gt;
        &lt;/Case&gt;
    &lt;/xsl:template&gt;
    
    &lt;xsl:template match=&quot;CaseTitle&quot;&gt;
        &lt;xsl:copy-of select=&quot;.&quot; /&gt;
    &lt;/xsl:template&gt;

    &lt;xsl:template match=&quot;Institution&quot;&gt;
        &lt;xsl:copy-of select=&quot;.&quot; /&gt;
    &lt;/xsl:template&gt;
    
&lt;/xsl:stylesheet&gt;

I have template rules for each of the following siblings of Category and I
can add more for Author, etc., but it seems like there should be a way to
generalize this for any number of elements. Any help would be appreciated.

Rick

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post30030.html</link><pubDate>Sat, 16 Mar 2013 21:57:33 GMT</pubDate></item><item><title> wordml to xml (formatting) using loop</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Hi Team,
Anybody who have an idea to handle it in the best way. I don't have any
idea, how to handling it using loop in xslt 2.0. Right now I am getting
duplicate texts

Input
  &lt;w:r&gt;
    &lt;w:rPr&gt;
      &lt;w:b/&gt;
      &lt;w:i/&gt;
      &lt;w:u/&gt;
    &lt;/w:rPr&gt;
    &lt;w:t&gt;bold italics underline text&lt;/w:t&gt;
  &lt;/w:r&gt;
Output should be: &lt;b&gt;&lt;i&gt;&lt;u&gt;bold italics underline text&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;

  &lt;w:r&gt;
    &lt;w:rPr&gt;
      &lt;w:i/&gt;
      &lt;w:b/&gt;
      &lt;w:u/&gt;
    &lt;/w:rPr&gt;
    &lt;w:t&gt;italics bold  underline text&lt;/w:t&gt;
  &lt;/w:r&gt;

Output should be: &lt;i&gt;&lt;b&gt;&lt;u&gt;italics bold  underline text&lt;/u&gt;&lt;/b&gt;&lt;/i&gt;

XLSLT
&lt;!--Text run container--&gt;
 &lt;xsl:template match=&quot;w:r&quot;&gt;
  &lt;xsl:choose&gt;
   &lt;xsl:when
test=&quot;w:rPr/w:vertAlign|w:rPr/w:u|w:rPr/w:b|w:rPr/w:i|w:rPr/w:smallCaps|w:rP
r/w:highlight&quot;&gt;
    &lt;xsl:apply-templates select=&quot;w:rPr&quot; mode=&quot;styling&quot;/&gt;
   &lt;/xsl:when&gt;
   &lt;xsl:otherwise&gt;
    &lt;xsl:apply-templates/&gt;
   &lt;/xsl:otherwise&gt;
  &lt;/xsl:choose&gt;
 &lt;/xsl:template&gt;

 &lt;!--Text run properties container--&gt;
 &lt;xsl:template match=&quot;w:rPr&quot; mode=&quot;styling&quot;&gt;
  &lt;xsl:for-each select=&quot;w:vertAlign|w:u|w:b|w:i|w:smallCaps|w:highlight&quot;&gt;
   &lt;xsl:element name=&quot;{local-name()}&quot;&gt;
     &lt;xsl:apply-templates select=&quot;../../w:t&quot;/&gt;
    &lt;/xsl:element&gt;
  &lt;/xsl:for-each&gt;
 &lt;/xsl:template&gt;

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post10030.html</link><pubDate>Fri, 15 Mar 2013 12:48:54 GMT</pubDate></item><item><title>Re:  wordml to xml (formatting) using loop</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>Joga,</tt><br>
<br>
<tt>Id recursively call a named template that creates the wrapping 
elements. With each recursion, the stack of formatting instructions will 
shrink by one, until ultimately the stack is empty and w:t will be 
processed.</tt><br>
<br>
<tt>See this ShareXML paste: http://www.sharexml.com:80/x/get?k=LLUgPpFyiAk1</tt><br>
<br>
<tt>Please note that according to the OOXML schema, the formatting 
instructions may only occur in what seems like an alphabetical order, 
that is, w:b, w:i, w:u. So your second example should not happen in 
practice. It will, however, be handled by the stylesheet nonetheless.</tt><br>
<br>
<tt>Gerrit</tt><br>
<br>
<tt><br>On 15.03.2013 08:18, Joga Singh Rawat wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">Hi Team,
Anybody who have an idea to handle it in the best way. I don't have any
idea, how to handling it using loop in xslt 2.0. Right now I am getting
duplicate texts</pre><br>
<pre style="margin: 0em;">Input
   &lt;w:r&gt;
     &lt;w:rPr&gt;
       &lt;w:b/&gt;
       &lt;w:i/&gt;
       &lt;w:u/&gt;
     &lt;/w:rPr&gt;
     &lt;w:t&gt;bold italics underline text&lt;/w:t&gt;
   &lt;/w:r&gt;
Output should be: &lt;b&gt;&lt;i&gt;&lt;u&gt;bold italics underline text&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;</pre><br>
<pre style="margin: 0em;">   &lt;w:r&gt;
     &lt;w:rPr&gt;
       &lt;w:i/&gt;
       &lt;w:b/&gt;
       &lt;w:u/&gt;
     &lt;/w:rPr&gt;
     &lt;w:t&gt;italics bold  underline text&lt;/w:t&gt;
   &lt;/w:r&gt;</pre><br>
<tt>Output should be: &lt;i&gt;&lt;b&gt;&lt;u&gt;italics bold  underline text&lt;/u&gt;&lt;/b&gt;&lt;/i&gt;</tt><br>
<br>
<pre style="margin: 0em;">XLSLT
&lt;!--Text run container--&gt;
  &lt;xsl:template match=&quot;w:r&quot;&gt;
   &lt;xsl:choose&gt;
    &lt;xsl:when
test=&quot;w:rPr/w:vertAlign|w:rPr/w:u|w:rPr/w:b|w:rPr/w:i|w:rPr/w:smallCaps|w:rP
r/w:highlight&quot;&gt;
     &lt;xsl:apply-templates select=&quot;w:rPr&quot; mode=&quot;styling&quot;/&gt;
    &lt;/xsl:when&gt;
    &lt;xsl:otherwise&gt;
     &lt;xsl:apply-templates/&gt;
    &lt;/xsl:otherwise&gt;
   &lt;/xsl:choose&gt;
  &lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">  &lt;!--Text run properties container--&gt;
  &lt;xsl:template match=&quot;w:rPr&quot; mode=&quot;styling&quot;&gt;
   &lt;xsl:for-each select=&quot;w:vertAlign|w:u|w:b|w:i|w:smallCaps|w:highlight&quot;&gt;
    &lt;xsl:element name=&quot;{local-name()}&quot;&gt;
      &lt;xsl:apply-templates select=&quot;../../w:t&quot;/&gt;
     &lt;/xsl:element&gt;
   &lt;/xsl:for-each&gt;
  &lt;/xsl:template&gt;</pre><br>
</blockquote><pre style="margin: 0em;"><br>--
Gerrit Imsieke
Geschdftsf|hrer / Managing Director
le-tex publishing services GmbH
Weissenfelser Str. 84, 04229 Leipzig, Germany
Phone +49 341 355356 110, Fax +49 341 355356 510
gerrit.imsieke@xxxxxxxxx, http://www.le-tex.de</pre><br>
<pre style="margin: 0em;">Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930</pre><br>
<pre style="margin: 0em;">Geschdftsf|hrer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard Vvckler</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post20030.html</link><pubDate>Fri, 15 Mar 2013 10:43:37 GMT</pubDate></item><item><title>Re:  How can one get the name of a template or function</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Hi,

This approach is also explored (independently) in these two articles:

http://balisage.net/Proceedings/vol8/html/Clark01/BalisageVol8-Clark01.html
http://jtei.revues.org/722

Cheers, Wendell


On Tue, Mar 12, 2013 at 5:27 PM, Philip Fearon &lt;pgfearo@xxxxxxxxxxxxxx&gt; wrote:
&gt; A crude approach for collecting data on invoked templates, is to use a
&gt; 'meta' XSLT stylesheet that modifies the XSLT you're interested in
&gt; collecting data on. This could insert xsl:message instructions in each
&gt; target template. You then just need to use this modified stylesheet on
&gt; sample data.
&gt;
&gt; The XSLT might look something like this (this version not tested):
&gt;
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&gt; &lt;xsl:stylesheet version=&quot;2.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
&gt; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;
&gt; xmlns:pxsl=&quot;http://qutoric.com/proxy-for-xsl&quot;&gt;
&gt;
&gt; &lt;xsl:namespace-alias stylesheet-prefix=&quot;pxsl&quot; result-prefix=&quot;xsl&quot;/&gt;
&gt;
&gt; &lt;xsl:output method=&quot;xml&quot; indent=&quot;no&quot;/&gt;
&gt;
&gt; &lt;xsl:template match=&quot;@* | node()&quot;&gt;
&gt; &lt;xsl:copy&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
&gt;
&gt; match=&quot;xsl:template&quot;&gt;
&gt; &lt;xsl:choose&gt;
&gt; &lt;xsl:when test=&quot;empty(*)&quot;&gt;
&gt; &lt;xsl:copy-of select=&quot;.&quot;/&gt;
&gt; &lt;/xsl:when&gt;
&gt; &lt;xsl:otherwise&gt;
&gt;
&gt; &lt;xsl:copy&gt;
&gt; &lt;xsl:apply-templates select=&quot;@*| xsl:param&quot;/&gt;
&gt;
&gt; &lt;xsl:apply-templates select=&quot;node() except xsl:param&quot;/&gt;
&gt; &lt;xsl:variable name=&quot;msg&quot; as=&quot;xs:string*&quot;&gt;
&gt; &lt;xsl:for-each select=&quot;@*&quot;&gt;
&gt; &lt;xsl:if test=&quot;name(.) = ('match','mode','name')&quot;&gt;
&gt; &lt;xsl:value-of select=&quot;concat(' ', name(.),': ',.)&quot;/&gt;
&gt; &lt;/xsl:if&gt;
&gt; &lt;/xsl:for-each&gt;
&gt; &lt;/xsl:variable&gt;
&gt; &lt;xsl:text&gt;&amp;#10;&lt;/xsl:text&gt;
&gt; &lt;pxsl:message&gt;Template-Signature: &lt;xsl:value-of select=&quot;msg&quot;/&gt;&lt;/pxsl:message&gt;
&gt; &lt;xsl:text&gt;&amp;#10;&lt;/xsl:text&gt;
&gt;
&gt; &lt;/xsl:copy&gt;
&gt; &lt;/xsl:otherwise&gt;
&gt; &lt;/xsl:choose&gt;
&gt;
&gt; &lt;/xsl:template&gt;
&gt;
&gt; &lt;/xsl:stylesheet&gt;
&gt;
&gt; -------------
&gt;
&gt; Phil Fearon
&gt;
&gt; On Fri, Mar 1, 2013 at 3:50 AM, John Laurence Poole &lt;jlpoole56@xxxxxxxxx&gt; wrote:
&gt;&gt; I'm resurrecting an old 2009 topic regarding
&gt;&gt; getting the name of a template.
&gt;&gt;
&gt;&gt; I followed Michael's suggestion below and have
&gt;&gt; successfully written an extension function that
&gt;&gt; produces the names of the template in instances
&gt;&gt; where the template is invoke through the
&gt;&gt; xsl:call-template mechanism.
&gt;&gt;
&gt;&gt; I'd be happy to provide a how-to on how I accomplished this along with
&gt;&gt; demonstration files if someone would like them; I suspect this is a
&gt;&gt; very esoteric area and there would not be any takers on my offer.
&gt;&gt;
&gt;&gt; What I would like to have is the ability to get
&gt;&gt; the name of a template in instances where the
&gt;&gt; template is invoked via the match mechanism:
&gt;&gt; xsl:apply-templates.  This would be for instances where
&gt;&gt; the template has a name attribute, e.g. name=&quot;template_ABC&quot;.  I tried
&gt;&gt; invoking my function similar to that below in a match situation and
&gt;&gt; null was returned despite the fact that the template that matched had
&gt;&gt; a name attribute.
&gt;&gt;
&gt;&gt; Any suggestions on how to approach this?  I'm new to studying the
&gt;&gt; internals of Saxon, but believe there must be some place where
&gt;&gt; information about the templates is stored to be accessed by the parser
&gt;&gt; for the match facility and that extending the properties of the
&gt;&gt; storage model to include a name attribute in instances where a
&gt;&gt; template does have a name attribute would be the way toapproach this.
&gt;&gt; Maybe I'm barking up the wrong tree and the matching mechanism is not
&gt;&gt; what I'm imagining?
&gt;&gt;
&gt;&gt; Thanks,
&gt;&gt;
&gt;&gt; John Poole
&gt;&gt;
&gt;&gt;
&gt;&gt; here's the message I'm following up on:
&gt;&gt;
&gt;&gt; On 2009-02-11 11:57:49  Michael Kay posted to this list:
&gt;&gt;
&gt;&gt; If you're prepared to grovel around the depths of Saxon internals, you can
&gt;&gt; write an extension function
&gt;&gt;
&gt;&gt;
&gt;&gt; public static String getTemplateName(net.sf.saxon.expr XPathContext context)
&gt;&gt; {
&gt;&gt;      try {
&gt;&gt;         return context.getOrigin().getObjectName().getDisplayName();
&gt;&gt;      } catch (Exception err) {
&gt;&gt;         return null;
&gt;&gt;      }
&gt;&gt; }
&gt;&gt;
&gt;&gt; and call it without any arguments as xx:getTemplateName(). Not tested. It
&gt;&gt; will only give the template name if it was invoked using call-template.
&gt;&gt; Should probably work for function calls as well.
&gt;&gt;
&gt;&gt; Michael Kay
&gt;&gt; http://www.saxonica.com/
&gt;



--
Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables
_____oo_________o_o___ooooo____ooooooo_^

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post00030.html</link><pubDate>Wed, 13 Mar 2013 10:06:45 GMT</pubDate></item><item><title>Re:  How can one get the name of a template or function</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>This is one of the joys of XSLT being a homoiconic language. It can be 
comparatively trivial to consistently modify an XSLT program with XLST - 
in this case to add some tracing activities. Another example arose 
recently for me where in SaxonCE, the DOM element tree doesn't have 
namespaces, but does have QNames. So @z:attr won't be recognised, but 
@*[name()='z:attr'] will be. So a simple XSLT preprocessor containing a 
match:</tt><br>
<br>
<tt>     &lt;xsl:template match=&quot;xsl:*/@select&quot;&gt;<br>
        &lt;xsl:attribute name=&quot;{name()}&quot; 
select=&quot;replace(.,'@(\i\c*:\i\c*)','@*[name()=''$1'']')&quot;/&gt;<br>
     &lt;/xsl:template&gt;</tt><br>
<br>
<tt>should be able to consistently change the source.</tt><br>
<br>
<tt>Another  On 12/03/2013 21:27, Philip Fearon wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">A crude approach for collecting data on invoked templates, is to use a
'meta' XSLT stylesheet that modifies the XSLT you're interested in
collecting data on. This could insert xsl:message instructions in each
target template. You then just need to use this modified stylesheet on
sample data.</pre><br>
<tt>The XSLT might look something like this (this version not tested):</tt><br>
<br>
<pre style="margin: 0em;">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;xsl:stylesheet version=&quot;2.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;
xmlns:pxsl=&quot;http://qutoric.com/proxy-for-xsl&quot;&gt;</pre><br>
<tt>&lt;xsl:namespace-alias stylesheet-prefix=&quot;pxsl&quot; result-prefix=&quot;xsl&quot;/&gt;</tt><br>
<br>
<tt>&lt;xsl:output method=&quot;xml&quot; indent=&quot;no&quot;/&gt;</tt><br>
<br>
<pre style="margin: 0em;">&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;</pre><br>
<tt>&lt;xsl:template</tt><br>
<br>
<pre style="margin: 0em;">match=&quot;xsl:template&quot;&gt;
&lt;xsl:choose&gt;
&lt;xsl:when test=&quot;empty(*)&quot;&gt;
&lt;xsl:copy-of select=&quot;.&quot;/&gt;
&lt;/xsl:when&gt;
&lt;xsl:otherwise&gt;</pre><br>
<pre style="margin: 0em;">&lt;xsl:copy&gt;
&lt;xsl:apply-templates select=&quot;@*| xsl:param&quot;/&gt;</pre><br>
<pre style="margin: 0em;">&lt;xsl:apply-templates select=&quot;node() except xsl:param&quot;/&gt;
&lt;xsl:variable name=&quot;msg&quot; as=&quot;xs:string*&quot;&gt;
&lt;xsl:for-each select=&quot;@*&quot;&gt;
&lt;xsl:if test=&quot;name(.) = ('match','mode','name')&quot;&gt;
&lt;xsl:value-of select=&quot;concat(' ', name(.),': ',.)&quot;/&gt;
&lt;/xsl:if&gt;
&lt;/xsl:for-each&gt;
&lt;/xsl:variable&gt;
&lt;xsl:text&gt;&amp;#10;&lt;/xsl:text&gt;
&lt;pxsl:message&gt;Template-Signature: &lt;xsl:value-of select=&quot;msg&quot;/&gt;&lt;/pxsl:message&gt;
&lt;xsl:text&gt;&amp;#10;&lt;/xsl:text&gt;</pre><br>
<pre style="margin: 0em;">&lt;/xsl:copy&gt;
&lt;/xsl:otherwise&gt;
&lt;/xsl:choose&gt;</pre><br>
<tt>&lt;/xsl:template&gt;</tt><br>
<br>
<tt>&lt;/xsl:stylesheet&gt;</tt><br>
<br>
<tt>-------------</tt><br>
<br>
<tt>Phil Fearon</tt><br>
<br>
<tt>On Fri, Mar 1, 2013 at 3:50 AM, John Laurence Poole&lt;jlpoole56@xxxxxxxxx&gt;  wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">I'm resurrecting an old 2009 topic regarding
getting the name of a template.</pre><br>
<pre style="margin: 0em;">I followed Michael's suggestion below and have
successfully written an extension function that
produces the names of the template in instances
where the template is invoke through the
xsl:call-template mechanism.</pre><br>
<pre style="margin: 0em;">I'd be happy to provide a how-to on how I accomplished this along with
demonstration files if someone would like them; I suspect this is a
very esoteric area and there would not be any takers on my offer.</pre><br>
<pre style="margin: 0em;">What I would like to have is the ability to get
the name of a template in instances where the
template is invoked via the match mechanism:
xsl:apply-templates.  This would be for instances where
the template has a name attribute, e.g. name=&quot;template_ABC&quot;.  I tried
invoking my function similar to that below in a match situation and
null was returned despite the fact that the template that matched had
a name attribute.</pre><br>
<pre style="margin: 0em;">Any suggestions on how to approach this?  I'm new to studying the
internals of Saxon, but believe there must be some place where
information about the templates is stored to be accessed by the parser
for the match facility and that extending the properties of the
storage model to include a name attribute in instances where a
template does have a name attribute would be the way toapproach this.
Maybe I'm barking up the wrong tree and the matching mechanism is not
what I'm imagining?</pre><br>
<tt>Thanks,</tt><br>
<br>
<tt>John Poole</tt><br>
<br>
<tt><br>here's the message I'm following up on:</tt><br>
<br>
<tt>On 2009-02-11 11:57:49  Michael Kay posted to this list:</tt><br>
<br>
<pre style="margin: 0em;">If you're prepared to grovel around the depths of Saxon internals, you can
write an extension function</pre><br>
<pre style="margin: 0em;"><br>public static String getTemplateName(net.sf.saxon.expr XPathContext context)
{
      try {
         return context.getOrigin().getObjectName().getDisplayName();
      } catch (Exception err) {
         return null;
      }
}</pre><br>
<pre style="margin: 0em;">and call it without any arguments as xx:getTemplateName(). Not tested. It
will only give the template name if it was invoked using call-template.
Should probably work for function calls as well.</pre><br>
<pre style="margin: 0em;">Michael Kay
http://www.saxonica.com/
</pre></blockquote><tt></tt><br>
<br>
<br>
</blockquote><tt></tt><br>
<br>
<pre style="margin: 0em;">--
John Lumley MA PhD CEng FIEE
john@xxxxxxxxxxxxxx</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post90020.html</link><pubDate>Tue, 12 Mar 2013 21:53:57 GMT</pubDate></item><item><title>Re:  How can one get the name of a template or function</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>A crude approach for collecting data on invoked templates, is to use a
'meta' XSLT stylesheet that modifies the XSLT you're interested in
collecting data on. This could insert xsl:message instructions in each
target template. You then just need to use this modified stylesheet on
sample data.

The XSLT might look something like this (this version not tested):

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;xsl:stylesheet version=&quot;2.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;
xmlns:pxsl=&quot;http://qutoric.com/proxy-for-xsl&quot;&gt;

&lt;xsl:namespace-alias stylesheet-prefix=&quot;pxsl&quot; result-prefix=&quot;xsl&quot;/&gt;

&lt;xsl:output method=&quot;xml&quot; indent=&quot;no&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;xsl:template&quot;&gt;
&lt;xsl:choose&gt;
&lt;xsl:when test=&quot;empty(*)&quot;&gt;
&lt;xsl:copy-of select=&quot;.&quot;/&gt;
&lt;/xsl:when&gt;
&lt;xsl:otherwise&gt;

&lt;xsl:copy&gt;
&lt;xsl:apply-templates select=&quot;@*| xsl:param&quot;/&gt;

&lt;xsl:apply-templates select=&quot;node() except xsl:param&quot;/&gt;
&lt;xsl:variable name=&quot;msg&quot; as=&quot;xs:string*&quot;&gt;
&lt;xsl:for-each select=&quot;@*&quot;&gt;
&lt;xsl:if test=&quot;name(.) = ('match','mode','name')&quot;&gt;
&lt;xsl:value-of select=&quot;concat(' ', name(.),': ',.)&quot;/&gt;
&lt;/xsl:if&gt;
&lt;/xsl:for-each&gt;
&lt;/xsl:variable&gt;
&lt;xsl:text&gt;&amp;#10;&lt;/xsl:text&gt;
&lt;pxsl:message&gt;Template-Signature: &lt;xsl:value-of select=&quot;msg&quot;/&gt;&lt;/pxsl:message&gt;
&lt;xsl:text&gt;&amp;#10;&lt;/xsl:text&gt;

&lt;/xsl:copy&gt;
&lt;/xsl:otherwise&gt;
&lt;/xsl:choose&gt;

&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;

-------------

Phil Fearon

On Fri, Mar 1, 2013 at 3:50 AM, John Laurence Poole &lt;jlpoole56@xxxxxxxxx&gt; wrote:
&gt; I'm resurrecting an old 2009 topic regarding
&gt; getting the name of a template.
&gt;
&gt; I followed Michael's suggestion below and have
&gt; successfully written an extension function that
&gt; produces the names of the template in instances
&gt; where the template is invoke through the
&gt; xsl:call-template mechanism.
&gt;
&gt; I'd be happy to provide a how-to on how I accomplished this along with
&gt; demonstration files if someone would like them; I suspect this is a
&gt; very esoteric area and there would not be any takers on my offer.
&gt;
&gt; What I would like to have is the ability to get
&gt; the name of a template in instances where the
&gt; template is invoked via the match mechanism:
&gt; xsl:apply-templates.  This would be for instances where
&gt; the template has a name attribute, e.g. name=&quot;template_ABC&quot;.  I tried
&gt; invoking my function similar to that below in a match situation and
&gt; null was returned despite the fact that the template that matched had
&gt; a name attribute.
&gt;
&gt; Any suggestions on how to approach this?  I'm new to studying the
&gt; internals of Saxon, but believe there must be some place where
&gt; information about the templates is stored to be accessed by the parser
&gt; for the match facility and that extending the properties of the
&gt; storage model to include a name attribute in instances where a
&gt; template does have a name attribute would be the way toapproach this.
&gt; Maybe I'm barking up the wrong tree and the matching mechanism is not
&gt; what I'm imagining?
&gt;
&gt; Thanks,
&gt;
&gt; John Poole
&gt;
&gt;
&gt; here's the message I'm following up on:
&gt;
&gt; On 2009-02-11 11:57:49  Michael Kay posted to this list:
&gt;
&gt; If you're prepared to grovel around the depths of Saxon internals, you can
&gt; write an extension function
&gt;
&gt;
&gt; public static String getTemplateName(net.sf.saxon.expr XPathContext context)
&gt; {
&gt;      try {
&gt;         return context.getOrigin().getObjectName().getDisplayName();
&gt;      } catch (Exception err) {
&gt;         return null;
&gt;      }
&gt; }
&gt;
&gt; and call it without any arguments as xx:getTemplateName(). Not tested. It
&gt; will only give the template name if it was invoked using call-template.
&gt; Should probably work for function calls as well.
&gt;
&gt; Michael Kay
&gt; http://www.saxonica.com/

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post80020.html</link><pubDate>Tue, 12 Mar 2013 21:27:31 GMT</pubDate></item><item><title>Re:  Determining the type of items in a sequence</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Ken,

Thanks! Indeed, the little voice in my head whispered &quot;instance of&quot;,
but that was about 10pm my time (later than you posted) so maybe it
was reading the list.

Cheers,
Wendell


On Mon, Mar 11, 2013 at 6:36 PM, G. Ken Holman
&lt;gkholman@xxxxxxxxxxxxxxxxxxxx&gt; wrote:
&gt; At 2013-03-11 18:31 -0400, Wendell Piez wrote:
&gt;&gt;
&gt;&gt; Could someone please remind me the most graceful way in XPath 2.0 of
&gt;&gt; determining dynamically whether any arbitrary $n is bound to a node or
&gt;&gt; sequence of nodes (i.e., no atomic values)?
&gt;
&gt;
&gt; instance of node()*
&gt;
&gt;
&gt;&gt; There's some furious parameterization going on and I just can't
&gt;&gt; remember this. (It's not the kind of thing easy to search for either.)
&gt;
&gt;
&gt; Not sure what you are referring to regarding parameterization.
&gt;
&gt; I hope the illustration below helps.
&gt;
&gt; . . . . . . . . Ken
&gt;
&gt; t:\ftemp&gt;type wendell.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;                 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;   &lt;xsl:variable name=&quot;test1&quot; select=&quot;doc(''),doc('')/*/xsl:*&quot;/&gt;
&gt;   &lt;xsl:value-of select=&quot;count($test1),$test1 instance of node()*,'&amp;#xa;'&quot;/&gt;
&gt;   &lt;xsl:variable name=&quot;test2&quot; select=&quot;$test1,'hello',$test1&quot;/&gt;
&gt;   &lt;xsl:value-of select=&quot;count($test2),$test2 instance of node()*,'&amp;#xa;'&quot;/&gt;
&gt; &lt;/xsl:template&gt;
&gt;
&gt; &lt;/xsl:stylesheet&gt;
&gt; t:\ftemp&gt;xslt2 wendell.xsl wendell.xsl
&gt; 3 true
&gt; 7 false
&gt;
&gt; t:\ftemp&gt;
&gt;
&gt;
&gt; --
&gt; Public XSLT, XSL-FO, UBL and code list classes in Europe -- Apr 2013 |
&gt; Contact us for world-wide XML consulting and instructor-led training |
&gt; Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
&gt; Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
&gt; G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
&gt; Google+ profile: https://plus.google.com/116832879756988317389/about |
&gt; Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |
&gt;



--
Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables
_____oo_________o_o___ooooo____ooooooo_^

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post70020.html</link><pubDate>Tue, 12 Mar 2013 09:03:22 GMT</pubDate></item><item><title>Re:  Determining the type of items in a sequence</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>Actually, to ensure there is at least one node it would be:</tt><br>
<br>
<tt>  instance of node()+</tt><br>
<br>
<tt>. . . . . .  Ken</tt><br>
<br>
<tt>At 2013-03-11 18:36 -0400, I wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>At 2013-03-11 18:31 -0400, Wendell Piez wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">Could someone please remind me the most graceful way in XPath 2.0 of
determining dynamically whether any arbitrary $n is bound to a node or
sequence of nodes (i.e., no atomic values)?
</pre></blockquote><tt><br>instance of node()*</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">There's some furious parameterization going on and I just can't
remember this. (It's not the kind of thing easy to search for either.)
</pre></blockquote><tt><br>Not sure what you are referring to regarding parameterization.</tt><br>
<br>
<tt>I hope the illustration below helps.</tt><br>
<br>
<tt>. . . . . . . . Ken</tt><br>
<br>
<pre style="margin: 0em;">t:\ftemp&gt;type wendell.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;</pre><br>
<tt>&lt;xsl:output method=&quot;text&quot;/&gt;</tt><br>
<br>
<pre style="margin: 0em;">&lt;xsl:template match=&quot;/&quot;&gt;
  &lt;xsl:variable name=&quot;test1&quot; select=&quot;doc(''),doc('')/*/xsl:*&quot;/&gt;
  &lt;xsl:value-of select=&quot;count($test1),$test1 instance of node()*,'&amp;#xa;'&quot;/&gt;
  &lt;xsl:variable name=&quot;test2&quot; select=&quot;$test1,'hello',$test1&quot;/&gt;
  &lt;xsl:value-of select=&quot;count($test2),$test2 instance of node()*,'&amp;#xa;'&quot;/&gt;
&lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">&lt;/xsl:stylesheet&gt;
t:\ftemp&gt;xslt2 wendell.xsl wendell.xsl
3 true
7 false</pre><br>
<tt>t:\ftemp&gt;
</tt></blockquote><tt></tt><br>
<br>
<pre style="margin: 0em;">--
Public XSLT, XSL-FO, UBL and code list classes in Europe -- Apr 2013 |
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post60020.html</link><pubDate>Mon, 11 Mar 2013 18:40:08 GMT</pubDate></item><item><title>Re:  Determining the type of items in a sequence</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>At 2013-03-11 18:31 -0400, Wendell Piez wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">Could someone please remind me the most graceful way in XPath 2.0 of
determining dynamically whether any arbitrary $n is bound to a node or
sequence of nodes (i.e., no atomic values)?
</pre></blockquote><tt><br>instance of node()*</tt><br>
<br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">There's some furious parameterization going on and I just can't
remember this. (It's not the kind of thing easy to search for either.)
</pre></blockquote><tt><br>Not sure what you are referring to regarding parameterization.</tt><br>
<br>
<tt>I hope the illustration below helps.</tt><br>
<br>
<tt>. . . . . . . . Ken</tt><br>
<br>
<pre style="margin: 0em;">t:\ftemp&gt;type wendell.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;</pre><br>
<tt>&lt;xsl:output method=&quot;text&quot;/&gt;</tt><br>
<br>
<pre style="margin: 0em;">&lt;xsl:template match=&quot;/&quot;&gt;
  &lt;xsl:variable name=&quot;test1&quot; select=&quot;doc(''),doc('')/*/xsl:*&quot;/&gt;
  &lt;xsl:value-of select=&quot;count($test1),$test1 instance of node()*,'&amp;#xa;'&quot;/&gt;
  &lt;xsl:variable name=&quot;test2&quot; select=&quot;$test1,'hello',$test1&quot;/&gt;
  &lt;xsl:value-of select=&quot;count($test2),$test2 instance of node()*,'&amp;#xa;'&quot;/&gt;
&lt;/xsl:template&gt;</pre><br>
<pre style="margin: 0em;">&lt;/xsl:stylesheet&gt;
t:\ftemp&gt;xslt2 wendell.xsl wendell.xsl
3 true
7 false</pre><br>
<tt>t:\ftemp&gt;</tt><br>
<br>
<pre style="margin: 0em;"><br>--
Public XSLT, XSL-FO, UBL and code list classes in Europe -- Apr 2013 |
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post50020.html</link><pubDate>Mon, 11 Mar 2013 18:36:21 GMT</pubDate></item><item><title> Determining the type of items in a sequence</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Friends,

Could someone please remind me the most graceful way in XPath 2.0 of
determining dynamically whether any arbitrary $n is bound to a node or
sequence of nodes (i.e., no atomic values)?

There's some furious parameterization going on and I just can't
remember this. (It's not the kind of thing easy to search for either.)

Cheers,
Wendell

-- 
Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables
_____oo_________o_o___ooooo____ooooooo_^

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post40020.html</link><pubDate>Mon, 11 Mar 2013 18:31:15 GMT</pubDate></item><item><title> XML and JSON browser performance</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>I am conducting research on real-world JSON and XML browser performance.
This is the first public beta of the test and I would appreciate anyone with a
few minutes to give it a try and send me comments.
( Note: This test is NOT intended to test everything  ... it's a focused test
with a few controlled variables).

What You Do

Go to
   http://speedtest.xmlsh.org

Click &quot;Run Tests And Submit...&quot;
Test takes about 1 - 3 minutes depending on your internet and device speed.

Repeat as often as have patience on as many difference OS's, machines, browser
vendors and versions and devices.
I am particularly interested in mobile devices as these have had much less
coverage in these kinds of experiments, but anything you can try is valuable.

Please feel free to pass this link on ... I will be updating the tests pending
comments of this initial public beta and then intend on distributing the test
to a wider audience (including full source).

The results are intended to be published publicly after enough data collection
and analysis has been completed.

Thank you for any assistance and comments.



----------------------------------------
David A. Lee
dlee@xxxxxxxxxxx
http://www.xmlsh.org


----------------------------------------
David A. Lee
dlee@xxxxxxxxxxx
http://www.xmlsh.org

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post30020.html</link><pubDate>Sat, 09 Mar 2013 17:32:11 GMT</pubDate></item><item><title>Re:  creating a temporary document from multiple inputs</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>See inline.

On 09/03/2013, Graydon &lt;graydon@xxxxxxxxx&gt; wrote:
&gt; On Sat, Mar 09, 2013 at 05:02:19PM +0100, Wolfgang Laun scripsit:
&gt;&gt; XSLT 2.0.
&gt;&gt;
&gt;&gt; I had to create a single document from several inputs (so that a key
&gt;&gt; lookup could access them all with a single call):
&gt;&gt;
&gt;&gt; &lt;xsl:variable name=&quot;doc&quot; as=&quot;document-node()&quot;&gt;
&gt;&gt;  &lt;xsl:document&gt;
&gt;&gt;    &lt;xsl:sequence select=&quot;document($paths)/*&quot;/&gt;
&gt;&gt;  &lt;/xsl:document&gt;
&gt;&gt; &lt;/xsl:variable&gt;
&gt;&gt;  &lt;xsl:key name=&quot;kSkips&quot;
&gt;&gt;          match=&quot;element()[@omc:ilp='0']&quot;
&gt;&gt;          use=&quot;@name&quot;/&gt;
&gt;&gt;
&gt;&gt;  &lt;xsl:variable name=&quot;look&quot; select=&quot;key('kSkips',$name,$doc)&quot;/&gt;
&gt;&gt;
&gt;&gt; What surprised me was that I could use
&gt;&gt;  &lt;xsl:sequence select=&quot;document($paths)&quot;/&gt;
&gt;&gt; without an error, which would make the document-nodes of the inputs
&gt;&gt; children of the temporary document-node. Is the XSL processor clever
&gt;
&gt; Betcha you can't.
What, exactly? Both forms - with and without '/*' - appear to work
correctly - at least the key() function delivers.

&gt;
&gt; Once you've gone
&gt;
&gt; &lt;xsl:sequence select=&quot;document($paths)/*&quot;/&gt;
&gt;
&gt; It's not document nodes anymore.

That I realized and thought advisable while I put them under the new
temporary document-node.

I just wondered why I don't have to select the document-nodes' *children*.

-W

&gt; -- Graydon

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post10020.html</link><pubDate>Sat, 09 Mar 2013 17:30:11 GMT</pubDate></item><item><title> creating a temporary document from multiple inputs</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>XSLT 2.0.

I had to create a single document from several inputs (so that a key
lookup could access them all with a single call):

&lt;xsl:variable name=&quot;doc&quot; as=&quot;document-node()&quot;&gt;
 &lt;xsl:document&gt;
   &lt;xsl:sequence select=&quot;document($paths)/*&quot;/&gt;
 &lt;/xsl:document&gt;
&lt;/xsl:variable&gt;
 &lt;xsl:key name=&quot;kSkips&quot;
         match=&quot;element()[@omc:ilp='0']&quot;
         use=&quot;@name&quot;/&gt;

 &lt;xsl:variable name=&quot;look&quot; select=&quot;key('kSkips',$name,$doc)&quot;/&gt;

What surprised me was that I could use
 &lt;xsl:sequence select=&quot;document($paths)&quot;/&gt;
without an error, which would make the document-nodes of the inputs
children of the temporary document-node. Is the XSL processor clever
enough to handle this? Where can I find more information about this?

Thanks for enhancing my education ;-)
Wolfgang

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post90010.html</link><pubDate>Sat, 09 Mar 2013 17:02:19 GMT</pubDate></item><item><title>Re:  creating a temporary document from multiple inputs</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>On Sat, Mar 09, 2013 at 05:30:11PM +0100, Wolfgang Laun scripsit:
&gt; See inline.
&gt; On 09/03/2013, Graydon &lt;graydon@xxxxxxxxx&gt; wrote:
&gt; &gt; On Sat, Mar 09, 2013 at 05:02:19PM +0100, Wolfgang Laun scripsit:
[snip]
&gt; &gt;&gt; What surprised me was that I could use
&gt; &gt;&gt;  &lt;xsl:sequence select=&quot;document($paths)&quot;/&gt;
&gt; &gt;&gt; without an error, which would make the document-nodes of the inputs
&gt; &gt;&gt; children of the temporary document-node. Is the XSL processor clever
&gt; &gt;
&gt; &gt; Betcha you can't.
&gt; What, exactly? Both forms - with and without '/*' - appear to work
&gt; correctly - at least the key() function delivers.

Which surprised me, because I wouldn't have expected 

&lt;xsl:sequence select=&quot;document($paths)&quot;/&gt;

to work, then I went and looked at the spec for the surrounding
xsl:document, an instruction I don't think I've ever used.

&gt; I just wondered why I don't have to select the document-nodes' *children*.

Sequence constructor rules, item 4 -- 

http://www.w3.org/TR/xslt20/#constructing-complex-content

&quot;Any document node within the result sequence is replaced by a sequence
containing each of its children, in document order.&quot;

So you just can't put a document node in a document node via any
sequence constructor, which makes sense.

So, yes, processor _has_ to be clever enough, it's in the spec. :)

-- Graydon

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post20020.html</link><pubDate>Sat, 09 Mar 2013 11:58:16 GMT</pubDate></item><item><title>Re:  creating a temporary document from multiple inputs</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>On Sat, Mar 09, 2013 at 05:02:19PM +0100, Wolfgang Laun scripsit:
&gt; XSLT 2.0.
&gt; 
&gt; I had to create a single document from several inputs (so that a key
&gt; lookup could access them all with a single call):
&gt; 
&gt; &lt;xsl:variable name=&quot;doc&quot; as=&quot;document-node()&quot;&gt;
&gt;  &lt;xsl:document&gt;
&gt;    &lt;xsl:sequence select=&quot;document($paths)/*&quot;/&gt;
&gt;  &lt;/xsl:document&gt;
&gt; &lt;/xsl:variable&gt;
&gt;  &lt;xsl:key name=&quot;kSkips&quot;
&gt;          match=&quot;element()[@omc:ilp='0']&quot;
&gt;          use=&quot;@name&quot;/&gt;
&gt; 
&gt;  &lt;xsl:variable name=&quot;look&quot; select=&quot;key('kSkips',$name,$doc)&quot;/&gt;
&gt; 
&gt; What surprised me was that I could use
&gt;  &lt;xsl:sequence select=&quot;document($paths)&quot;/&gt;
&gt; without an error, which would make the document-nodes of the inputs
&gt; children of the temporary document-node. Is the XSL processor clever

Betcha you can't.

Once you've gone

&lt;xsl:sequence select=&quot;document($paths)/*&quot;/&gt;

It's not document nodes anymore.  Same as 

&lt;xsl:for-each select=&quot;collection()/*&quot;&gt;

doesn't give the document nodes and

&lt;xsl:for-each select=&quot;collection()&quot;&gt;

does.

-- Graydon

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post00020.html</link><pubDate>Sat, 09 Mar 2013 11:23:06 GMT</pubDate></item><item><title>Re:  Re: Getting info of runtime failure in saxon  envi</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Karl,

I think we managed to stick close enough to XSL to make it count.

It's understandable that the database guys feel that the system should
guard against bad data in the front. But this becomes a UI issue and
(when it comes to database front ends) that can be sticky.

Notepad++ has been recommended to me by a number of happy users. And
you've probably found the XML support available for it.

Cheers, Wendell


On Tue, Mar 5, 2013 at 5:13 PM, Karlmarx R &lt;karlmarxr@xxxxxxxxx&gt; wrote:
&gt; Hi Wendell,
&gt;
&gt; Thanks again for the additional information. Sorry for my delayed response.
I tried to get additional info, but unable to obtain so far. So, to answer
some of questions:
&gt;&gt;are they really not &quot;technical&quot;?
&gt; Not exactly. Mixed lot. But XML and its technology are new to them and
moreover I found a resistance to learn or look beyond their own technology and
hence I mentioned non-tech to make it easy to the list.
&gt;
&gt;&gt;What sorts of applications do your non-technical users already know and like
to use? What operating systems are they running?
&gt; Some are from academic background who adds details to via UI - the db being
oracle but they don't have to worry about db. I know these people often copy
paste things from word doc etc., that include bullet points etc. and so
whatever diff sort of stuffs go into the db. There are two tech people who
look into oracle, running in UNIX server. I was told that they use some oracle
function to specify what fields are to be extracted (as XML) and that internal
function delivers the XML output - in tech terms this turned out  &quot;not to be
an XML&quot; due to content issues..
&gt;
&gt; Regarding editors, I think they are now happy with notepad++ and I have
anyway suggested other options discussed in the earlier threads, incl your
last one.
&gt;
&gt; I think their problem seems more of internal issue. The oracle guys want the
academics to enter correct data and take ownership. But everyone (except the
oracle guys!) understands that that is not going to happen anytime soon, if at
all it happens. So, the internal clash of who take data cleaning
responsibility somehow ended up with &quot;XML-XSL&quot; as the target. But I think they
now had consensus to look from all front, mainly oracle side to see a way to
filter out unwanted entities and chars. So, pretty much resolved I would say.
And you are right that the discussion did resulted in some interesting
informations.
&gt;
&gt;
&gt; Thanks again. Kind regards.
&gt;



--
Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables
_____oo_________o_o___ooooo____ooooooo_^

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post80010.html</link><pubDate>Wed, 06 Mar 2013 16:54:18 GMT</pubDate></item><item><title> Re: Getting info of runtime failure in saxon environme</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Hi Wendell, 

Thanks again for the additional information. Sorry for my
delayed response. I tried to get additional info, but unable to obtain so far.
So, to answer some of questions:
&gt;are they really not &quot;technical&quot;?
Not
exactly. Mixed lot. But XML and its technology are new to them and moreover I
found a resistance to learn or look beyond their own technology and hence I
mentioned non-tech to make it easy to the list.

&gt;What sorts of applications
do your non-technical users already know and like to use? What operating
systems are they running?
Some are from academic background who adds details
to via UI - the db being oracle but they don't have to worry about db. I know
these people often copy paste things from word doc etc., that include bullet
points etc. and so whatever diff sort of stuffs go into the db. There are two
tech people who look into oracle, running in UNIX server. I was told that they
use some oracle function to specify what fields are to be extracted (as XML)
and that internal function delivers the XML output - in tech terms this turned
out  &quot;not to be an XML&quot; due to content issues.. 

Regarding editors, I think
they are now happy with notepad++ and I have anyway suggested other options
discussed in the earlier threads, incl your last one.

I think their problem
seems more of internal issue. The oracle guys want the academics to enter
correct data and take ownership. But everyone (except the oracle guys!)
understands that that is not going to happen anytime soon, if at all it
happens. So, the internal clash of who take data cleaning responsibility
somehow ended up with &quot;XML-XSL&quot; as the target. But I think they now had
consensus to look from all front, mainly oracle side to see a way to filter
out unwanted entities and chars. So, pretty much resolved I would say. And you
are right that the discussion did resulted in some interesting informations.
Thanks again. Kind regards.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post70010.html</link><pubDate>Wed, 06 Mar 2013 06:13:21 GMT</pubDate></item><item><title> conflicting attribute specification</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>I have just encountered a stylesheet

&lt;element url='bob'&gt;
   &lt;xsl:attribute name=&quot;url&quot; select=&quot;'somethingotherthanbob'&quot;&gt;
&lt;/element&gt;

which should take precedence?

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post50010.html</link><pubDate>Tue, 05 Mar 2013 15:41:36 GMT</pubDate></item><item><title>Re:  conflicting attribute specification</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>At 2013-03-05 15:41 +0000, Ihe Onwuka wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>I have just encountered a stylesheet</tt><br>
<br>
<pre style="margin: 0em;">&lt;element url='bob'&gt;
   &lt;xsl:attribute name=&quot;url&quot; select=&quot;'somethingotherthanbob'&quot;&gt;
&lt;/element&gt;</pre><br>
<tt>which should take precedence?
</tt></blockquote><tt><br>The last &lt;xsl:attribute&gt; instruction to be executed.</tt><br>
<br>
<tt>There are many sources of attributes, and the order applied to the 
result element node is:</tt><br>
<br>
<pre style="margin: 0em;">  - first any xsl:use-attribute-sets= references
  - then any specified attributes
  - then any &lt;xsl:attribute&gt; instructions</pre><br>
<tt>The last value applied to a given attribute is the one that is used.</tt><br>
<br>
<tt>It is not possible to remove an attribute node from an element once 
one has been attached, but you can change its value.</tt><br>
<br>
<tt>Once you have added any children to the element you cannot change any 
of the attributes of that element.</tt><br>
<br>
<tt>I hope this helps.</tt><br>
<br>
<tt>. . . . . . . . Ken</tt><br>
<br>
<pre style="margin: 0em;"><br>--
Public XSLT, XSL-FO, UBL and code list classes in Europe -- Apr 2013 |
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   <a  href="mailto:gkholman@xxxxxxxxxxxxxxxxxxxx">mailto:gkholman@xxxxxxxxxxxxxxxxxxxx</a> |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post60010.html</link><pubDate>Tue, 05 Mar 2013 10:44:34 GMT</pubDate></item><item><title> Re: Getting info of runtime failure in saxon environme</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Thanks to you all for the various answers and suggestions. Very useful. Thanks
again.

Regards.

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post30010.html</link><pubDate>Sat, 02 Mar 2013 19:32:51 GMT</pubDate></item><item><title>Re:  Re: Getting info of runtime failure in saxon  envi</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Karl,

You're very welcome, and I apologize if I came off as abrupt about the
OT-ness. Just because your question was off topic does not (at all!)
mean it was not of interest to readers of this list.

You may want to consider a range of options, for your gatekeepers to
use according to personal preference. If they use text editors, they
can learn to use XML editors or XML add-ons to the their text editors.
Liam mentioned xmllint and there are other command-line options. Maybe
they would be interested in xmlsh, a set of utilities in the form of a
shell. Etc. If you encourage them to try a few different things you
might be able to get them to teach each other.

If they are really not &quot;technical&quot; (which can mean a lot of things, as
there are many ways to be technical than to be expert with computers
:-) they may be most at home with one of the lightweight editors you
can find on line.

Undertaking a survey of the present state of the art in XML editors at
the free or low-cost end would -- again -- be off-topic ...

... unless it were reframed as &quot;what's the state of the art in
low-cost or free editing applications to enable 'non-technical' users
to correct broken 'XML' and fix it for XSLT&quot; ... one might manage to
get that on topic by stressing the last point. :-&gt;

What sorts of applications do your non-technical users already know
and like to use? What operating systems are they running?

Are they already viewing the XML in a styled display through CSS or
XSLT? Have they ever seen angle brackets?

Cheers, Wendell




On Sat, Mar 2, 2013 at 6:32 AM, Karlmarx R &lt;karlmarxr@xxxxxxxxx&gt; wrote:
&gt; Thanks to you all for the various answers and suggestions. Very useful. Thanks again.
&gt;
&gt; Regards.
&gt;



--
Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables
_____oo_________o_o___ooooo____ooooooo_^

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post40010.html</link><pubDate>Sat, 02 Mar 2013 18:59:27 GMT</pubDate></item><item><title>Re:  Support for lookaround regexp in XSLT -- any time </title><description><![CDATA[<!--X-Body-of-Message-->
<pre>&gt; For example, there's a sorry history of patches to the spec regarding the
&gt; handling of a newline character appearing as the last thing in the input.
&gt;
yeah, negative lookahead assertions can be really handy.

&lt;xsd:pattern value=&quot;\d&quot;/&gt;
defines as a single digit, and should not match eg. &quot;7\n&quot;.

The PCRE regexp &quot;^\d$&quot; does match &quot;7&quot; as well as &quot;7\n&quot;.

&quot;^\d(?!\n)$&quot; does only match a single digit.



Mit besten Gruessen / Best wishes,

Hermann Stamm-Wilbrandt
Level 3 support for XML Compiler team and Fixpack team lead
WebSphere DataPower SOA Appliances
https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/
https://twitter.com/HermannSW/
----------------------------------------------------------------------
IBM Deutschland Research &amp; Development GmbH
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


|------------&gt;
| From:      |
|------------&gt;
  &gt;--------------------------------------------------------------------------------------------------------------------------------------------------|
  |Michael Kay &lt;mike@xxxxxxxxxxxx&gt;                                                                                                                   |
  &gt;--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------&gt;
| To:        |
|------------&gt;
  &gt;--------------------------------------------------------------------------------------------------------------------------------------------------|
  |xsl-list@xxxxxxxxxxxxxxxxxxxxxx,                                                                                                                  |
  &gt;--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------&gt;
| Date:      |
|------------&gt;
  &gt;--------------------------------------------------------------------------------------------------------------------------------------------------|
  |03/01/2013 11:40 AM                                                                                                                               |
  &gt;--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------&gt;
| Subject:   |
|------------&gt;
  &gt;--------------------------------------------------------------------------------------------------------------------------------------------------|
  |Re:  Support for lookaround regexp in XSLT -- any time soon?                                                                                 |
  &gt;--------------------------------------------------------------------------------------------------------------------------------------------------|







&gt;unsure about the original reason to restrict regex, as it seems to
just confuse people when a regex they lovingly crafted elsewhere
doesn't work (not that the various java, Perl, etc schisms help).

I don't know the history in full, but I think there were several reasons
XSD adopted a &quot;minimal&quot; regex subset:

(a) they wanted to be sure it could be widely implemented using existing
regex engines (i.e. a highest common factor approach)

(b) they wanted to exclude anything that didn't make sense in an
international Unicode context (so things like word boundaries were
immediately suspect)

(c) they wanted to make sure that what they included was well specified.
Finding solid specifications of regex constructs is remarkably difficult;
there's a culture of very informal specification. Many times when adding
constructs to the XPath spec, we've had to do empirical tests on existing
regex engines such as PCRE to see how they actually handle edge cases, and
very often we find differences between different engines that couldn't be
guessed from the documentation. For example, there's a sorry history of
patches to the spec regarding the handling of a newline character appearing
as the last thing in the input. It's a shame when a feature gets left out
because we can't decide what it should do in edge cases, but the standards
process tends to lead to people asking such questions and expecting
answers.

Michael Kay
Saxonica

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post80000.html</link><pubDate>Fri, 01 Mar 2013 23:43:47 GMT</pubDate></item><item><title>Re:  Complex XPath question</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 01/03/2013 23:08, dvint@xxxxxxxxx wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">Should have said I'm doing this in XSLT. I can use keys, but I'm trying to
figure out the XPath to make the keys useful.
</pre></blockquote><tt><br>not sure what you meant by</tt><br>
<br>
<tt>&gt; Is it possible in one XPath statement?</tt><br>
<br>
<tt>in that case.</tt><br>
<br>
<tt><br>&lt;xsl:stylesheet version=&quot;2.0&quot; 
xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt;</tt><br>
<br>
<tt>&lt;xsl:key name=&quot;o&quot; match=&quot;object[property[@name='title']]&quot; 
use=&quot;normalize-space(property[@name='title'])&quot;/&gt;</tt><br>
<br>
<tt>&lt;xsl:template match=&quot;/&quot;&gt;<br>
---<br>
&lt;xsl:copy-of select=&quot;<br>
for $m in 
max(//object[normalize-space(property[@name='title'])='COMPARE']/number(property[@name='version']))<br>
return<br>
//object[normalize-space(property[@name='title'])='COMPARE'][number(property[@name='version'])=$m]/id<br>
&quot;/&gt;<br>
--<br>
&lt;xsl:variable name=&quot;m&quot; 
select=&quot;max(key('o','COMPARE')/number(property[@name='version']))&quot;/&gt;<br>
&lt;xsl:copy-of 
select=&quot;key('o','COMPARE')[number(property[@name='version'])=$m]/id&quot;/&gt;<br>
&lt;/xsl:template&gt;<br>
&lt;/xsl:stylesheet&gt;</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post10010.html</link><pubDate>Fri, 01 Mar 2013 23:17:50 GMT</pubDate></item><item><title>Re:  Complex XPath question</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 01/03/2013 22:38, dvint@xxxxxxxxx wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>I have the following XML:</tt><br>
<br>
<pre style="margin: 0em;">&lt;wrapper&gt;
&lt;object class=&quot;Page&quot; package=&quot;com.atlassian.confluence.pages&quot;&gt;
	&lt;id name=&quot;id&quot;&gt;37716253&lt;/id&gt;
	&lt;property name=&quot;title&quot;&gt;
		&lt;![CDATA[COMPARE]]&gt;
	&lt;/property&gt;
	...
	&lt;property name=&quot;version&quot;&gt;3&lt;/property&gt;
	&lt;property name=&quot;creatorName&quot;&gt;
		&lt;![CDATA[wbenica]]&gt;
	&lt;/property&gt;
	&lt;property name=&quot;creationDate&quot;&gt;2012-11-16 14:00:35.000&lt;/property&gt;
&lt;/object&gt;
&lt;object class=&quot;Page&quot; package=&quot;com.atlassian.confluence.pages&quot;&gt;
	&lt;id name=&quot;id&quot;&gt;37716529&lt;/id&gt;
	&lt;property name=&quot;title&quot;&gt;
		&lt;![CDATA[COMPARE]]&gt;
	&lt;/property&gt;
	...
	&lt;property name=&quot;version&quot;&gt;1&lt;/property&gt;
	&lt;property name=&quot;creatorName&quot;&gt;
		&lt;![CDATA[wbenica]]&gt;
	&lt;/property&gt;
	&lt;property name=&quot;creationDate&quot;&gt;2012-11-16 14:00:35.000&lt;/property&gt;
&lt;/object&gt;
&lt;object class=&quot;Page&quot; package=&quot;com.atlassian.confluence.pages&quot;&gt;
	&lt;id name=&quot;id&quot;&gt;37716528&lt;/id&gt;
	&lt;property name=&quot;title&quot;&gt;
		&lt;![CDATA[COMPARE]]&gt;
	&lt;/property&gt;
	...
	&lt;property name=&quot;version&quot;&gt;2&lt;/property&gt;
	&lt;property name=&quot;creatorName&quot;&gt;
		&lt;![CDATA[wbenica]]&gt;
	&lt;/property&gt;
&lt;/object&gt;
&lt;object class=&quot;Page&quot; package=&quot;com.atlassian.confluence.pages&quot;&gt;
	&lt;id name=&quot;id&quot;&gt;37716253&lt;/id&gt;
	&lt;property name=&quot;title&quot;&gt;
		&lt;![CDATA[SOME OTHER TITLE]]&gt;
	&lt;/property&gt;
	...
	&lt;property name=&quot;version&quot;&gt;3&lt;/property&gt;
	&lt;property name=&quot;creatorName&quot;&gt;
		&lt;![CDATA[wbenica]]&gt;
	&lt;/property&gt;
	&lt;property name=&quot;creationDate&quot;&gt;2012-11-16 14:00:35.000&lt;/property&gt;
&lt;/object&gt;
&lt;/wrapper&gt;</pre><br>
<pre style="margin: 0em;">I want to find the &lt;id&gt; element value for the &lt;object&gt; element that has
the highest version &lt;property&gt; (of those matching the title) and matches the
title &lt;property&gt; element for 'COMPARE'.</pre><br>
<pre style="margin: 0em;">The following matchs all &lt;object&gt;
elements that have a title and version:</pre><br>
<tt>//object[property[@name='title'] and property[@name='version']]</tt><br>
<br>
<pre style="margin: 0em;">How do I look for a specific title and find the highest version? Is it
possible in one XPath statement?</pre><br>
</blockquote><tt><br>Would be more efficient of you could use xslt and keys and variables and 
things but this seems to work, returns</tt><br>
<br>
<tt>&lt;id name=&quot;id&quot;&gt;37716253&lt;/id&gt;</tt><br>
<br>
<tt>on your input.</tt><br>
<br>
<tt><br>for $m in 
max(//object[normalize-space(property[@name='title'])='COMPARE']/number(property[@name='version']))<br>
return<br>
//object[normalize-space(property[@name='title'])='COMPARE'][number(property[@name='version'])=$m]/id</tt><br>
<br>
<tt></tt><br>
<br>
<tt>(more pointless CDATA markup in your input document)</tt><br>
<br>
<tt>David</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post90000.html</link><pubDate>Fri, 01 Mar 2013 22:55:06 GMT</pubDate></item><item><title>Re:  Support for lookaround regexp in XSLT -- any time </title><description><![CDATA[<!--X-Body-of-Message-->
<pre>ok I redact the unambiguous part ... was getting nostalgic.

though sometimes ... I do feel that we rush to specify in language
that machines understand first, personally I like the fireside chat
approach but acknowledge I wouldn't want to build a rocket ship with
this level of 'blueprint'.

J






On Fri, Mar 1, 2013 at 6:39 PM, Michael Kay &lt;mike@xxxxxxxxxxxx&gt; wrote:
&gt;
&gt;
&gt;&gt; but I would argue that perl6
&gt;
&gt;
&gt;&gt; https://github.com/perl6/specs/blob/master/S05-regex.pod
&gt;
&gt;
&gt;&gt; does the best job at unambiguously defining ...
&gt;
&gt;
&gt; That's supposed to be unambiguous? It's a fireside chat, full of &quot;Oh, and
&gt; here's something else I thought I might mention&quot;.
&gt;
&gt;
&gt; Michael Kay
&gt; Saxonica

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post60000.html</link><pubDate>Fri, 01 Mar 2013 19:51:51 GMT</pubDate></item><item><title>Re:  Complex XPath question</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>On Fri, 2013-03-01 at 14:38 -0800, dvint@xxxxxxxxx wrote:
&gt; I have the following XML:
[...]

&gt; &lt;object class=&quot;Page&quot; package=&quot;com.atlassian.confluence.pages&quot;&gt;
&gt; 	&lt;id name=&quot;id&quot;&gt;37716253&lt;/id&gt;
&gt; 	&lt;property name=&quot;title&quot;&gt;
&gt; 		&lt;![CDATA[SOME OTHER TITLE]]&gt;
&gt; 	&lt;/property&gt;
&gt; 	...
&gt; 	&lt;property name=&quot;version&quot;&gt;3&lt;/property&gt;
&gt; 	&lt;property name=&quot;creatorName&quot;&gt;
&gt; 		&lt;![CDATA[wbenica]]&gt;
&gt; 	&lt;/property&gt;
&gt; 	&lt;property name=&quot;creationDate&quot;&gt;2012-11-16 14:00:35.000&lt;/property&gt;
&gt; &lt;/object&gt;
&gt; &lt;/wrapper&gt;
&gt; 
&gt; I want to find the &lt;id&gt; element value for the &lt;object&gt; element that has
&gt; the highest version &lt;property&gt; (of those matching the title) and matches the
&gt; title &lt;property&gt; element for 'COMPARE'.

You mentioned elsewhere that you're using XSLT but not which version.

Here's an XQuery version:

(for $i in //object[match title here]
  order by property[@name eq &quot;version&quot;] descending
  return $i)[1]/id

David already suggested a way to match title elements.

In XPath we can do something like this, looking for an object such that
no other object has a higher version (assuming they all have versions):

//object[
  not(
   //object[property[@name eq &quot;version&quot;] &gt; property[@name eq &quot;version&quot;]
  )]/id

but it might not be very fast...

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post20010.html</link><pubDate>Fri, 01 Mar 2013 19:09:10 GMT</pubDate></item><item><title>Re:  Support for lookaround regexp in XSLT -- any time </title><description><![CDATA[<!--X-Body-of-Message-->
<pre>thx for the background info, its useful and interesting to hear about.

btw

    http://en.wikipedia.org/wiki/Regular_expression

does a good job at identifying regex specs/docs

but I would argue that perl6

https://github.com/perl6/specs/blob/master/S05-regex.pod

does the best job at unambiguously defining ... though this regex is
not your grandad's regex.

back to regex in XML land ... to add a datapoint: I think the only oft
repeated shortcoming of regex in XML, is lack of lookahead/lookbehind

J



On Fri, Mar 1, 2013 at 11:40 AM, Michael Kay &lt;mike@xxxxxxxxxxxx&gt; wrote:
&gt;
&gt;
&gt;&gt; unsure about the original reason to restrict regex, as it seems to
&gt;
&gt; just confuse people when a regex they lovingly crafted elsewhere
&gt; doesn't work (not that the various java, Perl, etc schisms help).
&gt;
&gt; I don't know the history in full, but I think there were several reasons XSD
&gt; adopted a &quot;minimal&quot; regex subset:
&gt;
&gt; (a) they wanted to be sure it could be widely implemented using existing
&gt; regex engines (i.e. a highest common factor approach)
&gt;
&gt; (b) they wanted to exclude anything that didn't make sense in an
&gt; international Unicode context (so things like word boundaries were
&gt; immediately suspect)
&gt;
&gt; (c) they wanted to make sure that what they included was well specified.
&gt; Finding solid specifications of regex constructs is remarkably difficult;
&gt; there's a culture of very informal specification. Many times when adding
&gt; constructs to the XPath spec, we've had to do empirical tests on existing
&gt; regex engines such as PCRE to see how they actually handle edge cases, and
&gt; very often we find differences between different engines that couldn't be
&gt; guessed from the documentation. For example, there's a sorry history of
&gt; patches to the spec regarding the handling of a newline character appearing
&gt; as the last thing in the input. It's a shame when a feature gets left out
&gt; because we can't decide what it should do in edge cases, but the standards
&gt; process tends to lead to people asking such questions and expecting answers.
&gt;
&gt; Michael Kay
&gt; Saxonica

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post40000.html</link><pubDate>Fri, 01 Mar 2013 18:24:46 GMT</pubDate></item><item><title>Re:  Support for lookaround regexp in XSLT -- any time </title><description><![CDATA[<!--X-Body-of-Message-->
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>but I would argue that perl6
</tt></blockquote><br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>https://github.com/perl6/specs/blob/master/S05-regex.pod
</tt></blockquote><br>
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>does the best job at unambiguously defining ...
</tt></blockquote><tt><br>That's supposed to be unambiguous? It's a fireside chat, full of &quot;Oh, and here's something else I thought I might mention&quot;.</tt><br>
<br>
<pre style="margin: 0em;">Michael Kay
Saxonica</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post50000.html</link><pubDate>Fri, 01 Mar 2013 17:39:57 GMT</pubDate></item><item><title>Re:  Complex XPath question</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>&gt; for $m in
&gt;
max(//object[normalize-space(property[@name='title'])='COMPARE']/number(prope
rty[@name='version']))
&gt; return
&gt;
//object[normalize-space(property[@name='title'])='COMPARE'][number(property[
@name='version'])=$m]/id


Should have said I'm doing this in XSLT. I can use keys, but I'm trying to
figure out the XPath to make the keys useful.

&gt;
&gt;
&gt;
&gt; (more pointless CDATA markup in your input document)

Agreed, but I can't change that as it is what the 3rd party app is
creating. I suppose it might be easier to preproces this single input file
before I produce the files I need. That would allow me easier access to
some information.

..dan


&gt;
&gt; David

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post00010.html</link><pubDate>Fri, 01 Mar 2013 15:08:23 GMT</pubDate></item><item><title> Complex XPath question</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>I have the following XML:

&lt;wrapper&gt;
&lt;object class=&quot;Page&quot; package=&quot;com.atlassian.confluence.pages&quot;&gt;
	&lt;id name=&quot;id&quot;&gt;37716253&lt;/id&gt;
	&lt;property name=&quot;title&quot;&gt;
		&lt;![CDATA[COMPARE]]&gt;
	&lt;/property&gt;
	...
	&lt;property name=&quot;version&quot;&gt;3&lt;/property&gt;
	&lt;property name=&quot;creatorName&quot;&gt;
		&lt;![CDATA[wbenica]]&gt;
	&lt;/property&gt;
	&lt;property name=&quot;creationDate&quot;&gt;2012-11-16 14:00:35.000&lt;/property&gt;
&lt;/object&gt;
&lt;object class=&quot;Page&quot; package=&quot;com.atlassian.confluence.pages&quot;&gt;
	&lt;id name=&quot;id&quot;&gt;37716529&lt;/id&gt;
	&lt;property name=&quot;title&quot;&gt;
		&lt;![CDATA[COMPARE]]&gt;
	&lt;/property&gt;
	...
	&lt;property name=&quot;version&quot;&gt;1&lt;/property&gt;
	&lt;property name=&quot;creatorName&quot;&gt;
		&lt;![CDATA[wbenica]]&gt;
	&lt;/property&gt;
	&lt;property name=&quot;creationDate&quot;&gt;2012-11-16 14:00:35.000&lt;/property&gt;
&lt;/object&gt;
&lt;object class=&quot;Page&quot; package=&quot;com.atlassian.confluence.pages&quot;&gt;
	&lt;id name=&quot;id&quot;&gt;37716528&lt;/id&gt;
	&lt;property name=&quot;title&quot;&gt;
		&lt;![CDATA[COMPARE]]&gt;
	&lt;/property&gt;
	...
	&lt;property name=&quot;version&quot;&gt;2&lt;/property&gt;
	&lt;property name=&quot;creatorName&quot;&gt;
		&lt;![CDATA[wbenica]]&gt;
	&lt;/property&gt;
&lt;/object&gt;
&lt;object class=&quot;Page&quot; package=&quot;com.atlassian.confluence.pages&quot;&gt;
	&lt;id name=&quot;id&quot;&gt;37716253&lt;/id&gt;
	&lt;property name=&quot;title&quot;&gt;
		&lt;![CDATA[SOME OTHER TITLE]]&gt;
	&lt;/property&gt;
	...
	&lt;property name=&quot;version&quot;&gt;3&lt;/property&gt;
	&lt;property name=&quot;creatorName&quot;&gt;
		&lt;![CDATA[wbenica]]&gt;
	&lt;/property&gt;
	&lt;property name=&quot;creationDate&quot;&gt;2012-11-16 14:00:35.000&lt;/property&gt;
&lt;/object&gt;
&lt;/wrapper&gt;

I want to find the &lt;id&gt; element value for the &lt;object&gt; element that has
the highest version &lt;property&gt; (of those matching the title) and matches the
title &lt;property&gt; element for 'COMPARE'.

The following matchs all &lt;object&gt;
elements that have a title and version:

//object[property[@name='title'] and property[@name='version']]

How do I look for a specific title and find the highest version? Is it
possible in one XPath statement?

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post70000.html</link><pubDate>Fri, 01 Mar 2013 14:38:38 GMT</pubDate></item><item><title>Re:  Support for lookaround regexp in XSLT -- any time </title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 01.03.2013 11:40, Michael Kay wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">(b) they wanted to exclude anything that didn't make sense in an
international Unicode context (so things like word boundaries were
immediately suspect)
</pre></blockquote><tt><br>If they had been concerned about what is a word constituent and what is 
not in a certain language, they wouldnbt have included \w and \W in 
http://www.w3.org/TR/xmlschema-2/#cces</tt><br>
<br>
<tt>\w is locale-independently defined as:<br>
[#x0000-#x10FFFF]-[\p{P}\p{Z}\p{C}] (all characters except the set of 
&quot;punctuation&quot;, &quot;separator&quot; and &quot;other&quot; characters)</tt><br>
<br>
<tt>So I think \b, defined as either a \w-\W, a \W-\w boundary, the start 
anchor, or the end anchor, is also perfectly well-defined and works as 
expected in most circumstances.</tt><br>
<br>
<tt>Gerrit</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post20000.html</link><pubDate>Fri, 01 Mar 2013 12:02:38 GMT</pubDate></item><item><title>Re:  Support for lookaround regexp in XSLT -- any time </title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 01/03/2013 11:02, Imsieke, Gerrit, le-tex wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt></tt><br>
<br>
<tt>On 01.03.2013 11:40, Michael Kay wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">(b) they wanted to exclude anything that didn't make sense in an
international Unicode context (so things like word boundaries were
immediately suspect)
</pre></blockquote><tt><br>If they had been concerned about what is a word constituent and what 
is not in a certain language, they wouldnbt have included \w and \W in 
http://www.w3.org/TR/xmlschema-2/#cces
</tt></blockquote><tt>You're assuming a rational and logical process. You clearly haven't 
worked on a standards committee.</tt><br>
<br>
<pre style="margin: 0em;">Michael Kay
Saxonica</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post30000.html</link><pubDate>Fri, 01 Mar 2013 11:33:04 GMT</pubDate></item><item><title>Re:  Support for lookaround regexp in XSLT -- any time </title><description><![CDATA[<!--X-Body-of-Message-->
<blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>unsure about the original reason to restrict regex, as it seems to
</tt></blockquote><pre style="margin: 0em;">just confuse people when a regex they lovingly crafted elsewhere
doesn't work (not that the various java, Perl, etc schisms help).</pre><br>
<tt>I don't know the history in full, but I think there were several reasons XSD adopted a &quot;minimal&quot; regex subset:</tt><br>
<br>
<tt>(a) they wanted to be sure it could be widely implemented using existing regex engines (i.e. a highest common factor approach)</tt><br>
<br>
<tt>(b) they wanted to exclude anything that didn't make sense in an international Unicode context (so things like word boundaries were immediately suspect)</tt><br>
<br>
<tt>(c) they wanted to make sure that what they included was well specified. Finding solid specifications of regex constructs is remarkably difficult; there's a culture of very informal specification. Many times when adding constructs to the XPath spec, we've had to do empirical tests on existing regex engines such as PCRE to see how they actually handle edge cases, and very often we find differences between different engines that couldn't be guessed from the documentation. For example, there's a sorry history of patches to the spec regarding the handling of a newline character appearing as the last thing in the input. It's a shame when a feature gets left out because we can't decide what it should do in edge cases, but the standards process tends to lead to people asking such questions and expecting answers.</tt><br>
<br>
<pre style="margin: 0em;">Michael Kay
Saxonica</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201303/post10000.html</link><pubDate>Fri, 01 Mar 2013 10:40:33 GMT</pubDate></item><item><title>Re:  Support for lookaround regexp in XSLT -- any time </title><description><![CDATA[<!--X-Body-of-Message-->
<pre>alternately, you may find that some processors 'bend the rules a
little' eg. I think (I maybe wrong) basex for example may allow
lookbehind/lookahead.

unsure about the original reason to restrict regex, as it seems to
just confuse people when a regex they lovingly crafted elsewhere
doesn't work (not that the various java, Perl, etc schisms help).

I am all for upgrading regex expressions, feels like very low hanging
fruit to me.

J


On Thu, Feb 28, 2013 at 1:20 AM, Manuel Souto Pico
&lt;m.soutopico@xxxxxxxxx&gt; wrote:
&gt; Hi there,
&gt;
&gt; I've been using XSLT/XPath for some time to find patterns in
&gt; (XML-based) XLIFF files, but now I'm going to need more complex
&gt; regexps (e.g. positive/negative lookaround/lookbehind/lookahead, aka
&gt; zero-width assertions, or non-capturing groups) and I see that they
&gt; are not supported.
&gt;
&gt; My question is whether there are plans to support these advanced
&gt; features in the future. Does anyone know?
&gt;
&gt; I know .NET or Perl regular expressions support that, but I would
&gt; rather stick to XSLT if I can. It makes my life much simpler.
&gt;
&gt; Thanks in advance.
&gt;
&gt; Cheers,
&gt; Manuel Souto Pico

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201303/post00000.html</link><pubDate>Fri, 01 Mar 2013 09:59:41 GMT</pubDate></item><item><title>Re:  Support for lookaround regexp in XSLT -- any time </title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Thank you, Liam.

I will have a look at the W3C Bugzilla and will try to add a feature
request. It's good that it's so relatively easy to have features
included in the language.

The reason why this is needed is to be able to find all kinds patterns
in XML files, as a kind of linguistic quality control. Lack of
lookaround assertions is a serious limitation when using XSLT to
generate reports based on the input XML document.

Cheers,

Manuel Souto Pico
Linguist 7 Translation technologist
http://www.msoutopico.es
es.linkedin.com/in/msoutopico


On 28 February 2013 03:24, Liam R E Quin &lt;liam@xxxxxx&gt; wrote:
&gt;
&gt; On Thu, 2013-02-28 at 00:20 +0000, Manuel Souto Pico wrote:
&gt; &gt; Hi there,
&gt; &gt;
&gt; &gt; I've been using XSLT/XPath for some time to find patterns in
&gt; &gt; (XML-based) XLIFF files, but now I'm going to need more complex
&gt; &gt; regexps (e.g. positive/negative lookaround/lookbehind/lookahead, aka
&gt; &gt; zero-width assertions, or non-capturing groups) and I see that they
&gt; &gt; are not supported.
&gt;
&gt; The best way to ask for such features is to enter them into the W3C
&gt; Bugzilla instance for the Path &amp; XQuery Functions and Operators
&gt; specification, together with a use case for why they are needed.
&gt;
&gt; Note that the 3.0 &quot;Candidate Recommendation&quot; draft does have
&gt; non-capturing (?....) groups.  I don't think we added the zero-width
&gt; assertions, possibly because no-one has asked for them.
&gt;
&gt; See http://www.w3.org/TR/xpath-functions-30/ for the latest version of
&gt; Functions and Operators, and the Status section at the start has
&gt; instructions for submitting comments.
&gt;
&gt; I am not sure that we can add such features for 3.0, because the
&gt; metaphorical train is already pulling out of the metaphorical station
&gt; with a full head of metaphorical steam, but if we've missed it there's
&gt; likely to be an XPath 3.1 right behind it, as soon as the platform's
&gt; clear. Metaphorically speaking.
&gt;
&gt; Liam
&gt;
&gt; --
&gt; Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
&gt; Pictures from old books: http://fromoldbooks.org/
&gt; Ankh: irc.sorcery.net irc.gnome.org freenode/#xml

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201302/post30110.html</link><pubDate>Fri, 01 Mar 2013 03:11:36 GMT</pubDate></item><item><title>Re:  Processing XML with multiple nested CDATA sections</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>On 28/02/2013 23:47, dvint@xxxxxxxxx wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">  Some of
these CDATA sections have CDATA sections in them.
</pre></blockquote><tt><br>You can't nest CDATA sections.</tt><br>
<br>
<tt>&lt;![CDATA[a &lt;![CDATA[b ]]&gt; c ]]&gt;</tt><br>
<br>
<tt>is a fatal syntax error as the CDATA section ends at the first ]]&gt;<br>
so the second ]]&gt; is a syntax error. The second &lt;![CDATA[ doesn't start 
a CDATA section at all as it is equivalent to &amp;lt;![CDATA[.</tt><br>
<br>
<tt>In your example the inner &quot;]]&gt;&quot; is changed to ]] &gt; to avoid this.</tt><br>
<br>
<tt>The input is a mess and this isn't guaranteed to work but on the posted 
example</tt><br>
<br>
<tt></tt><br>
<br>
<tt>&lt;xsl:template match=&quot;hibernate-generic&quot;&gt;<br>
 &lt;xsl:value-of disable-output-escaping=&quot;yes&quot; 
select=&quot;replace(object/property[@name='body'],'(&amp;lt;!\[CDATA\[)|(\]\] 
*&gt;)','')&quot;/&gt;<br>
&lt;/xsl:template&gt;</tt><br>
<br>
<tt>produces</tt><br>
<br>
<pre style="margin: 0em;"><br> &lt;p&gt;Creating Inted.&lt;/p&gt;&lt;p&gt;You can also ptions.&lt;/p&gt;
&lt;h1&gt;Generating&lt;/h1&gt;&lt;p&gt;&lt;ac:link&gt;&lt;ri:page ri:content-title=&quot;Types of
Widgets&quot; /&gt;&lt;ac:plain-text-link-body&gt;Infographic widgets
&lt;/ac:plain-text-link-body&gt;&lt;/ac:link&gt; are ways.&lt;/p&gt;</pre><br>
<tt><br>David</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201302/post00110.html</link><pubDate>Fri, 01 Mar 2013 00:04:56 GMT</pubDate></item><item><title>RE:  How can one get the name of a template or function</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>On Thu, 2013-02-28 at 19:50 -0800, John Laurence Poole wrote:
[...]

&gt; What I would like to have is the ability to get
&gt; the name of a template in instances where the
&gt; template is invoked via the match mechanism:
&gt; xsl:apply-templates.
[...]

&gt; Maybe I'm barking up the wrong tree and the matching mechanism is not
&gt; what I'm imagining?

You probably want the saxon mailing list... but this is a fairly unusual
question. For a template or XSLT function you could process the
stylesheet with XSLT to provide the information in a variable.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201302/post60110.html</link><pubDate>Thu, 28 Feb 2013 23:10:59 GMT</pubDate></item><item><title>Re:  Support for lookaround regexp in XSLT -- any time </title><description><![CDATA[<!--X-Body-of-Message-->
<pre>On Fri, 2013-03-01 at 03:11 +0000, Manuel Souto Pico wrote:
&gt; Thank you, Liam.
&gt; 
&gt; I will have a look at the W3C Bugzilla and will try to add a feature
&gt; request.

Cool. The worst that can happen is someone can tell you it' already
there, or that we won't do it in this version :)  Your &quot;bug&quot;/request
should be filed against XPath and XQuery Functions and Operators in this
case, because that's where replace() and matches() are defined.

&gt;  It's good that it's so relatively easy to have features
&gt; included in the language.
W3C Process requires Working Groups to consider all public comments.

Of course, they might turn round and say &quot;no&quot; :-)


&gt; The reason why this is needed is to be able to find all kinds patterns
&gt; in XML files, as a kind of linguistic quality control. Lack of
&gt; lookaround assertions is a serious limitation when using XSLT to
&gt; generate reports based on the input XML document.

Actually I 100% agree, I use them in other languages.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201302/post40110.html</link><pubDate>Thu, 28 Feb 2013 22:39:59 GMT</pubDate></item><item><title>RE:  How can one get the name of a template or function</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>I'm resurrecting an old 2009 topic regarding
getting the name of a template.

I followed Michael's suggestion below and have
successfully written an extension function that
produces the names of the template in instances
where the template is invoke through the
xsl:call-template mechanism.

I'd be happy to provide a how-to on how I accomplished this along with
demonstration files if someone would like them; I suspect this is a
very esoteric area and there would not be any takers on my offer.

What I would like to have is the ability to get
the name of a template in instances where the
template is invoked via the match mechanism:
xsl:apply-templates.  This would be for instances where
the template has a name attribute, e.g. name=&quot;template_ABC&quot;.  I tried
invoking my function similar to that below in a match situation and
null was returned despite the fact that the template that matched had
a name attribute.

Any suggestions on how to approach this?  I'm new to studying the
internals of Saxon, but believe there must be some place where
information about the templates is stored to be accessed by the parser
for the match facility and that extending the properties of the
storage model to include a name attribute in instances where a
template does have a name attribute would be the way toapproach this.
Maybe I'm barking up the wrong tree and the matching mechanism is not
what I'm imagining?

Thanks,

John Poole


here's the message I'm following up on:

On 2009-02-11 11:57:49  Michael Kay posted to this list:

If you're prepared to grovel around the depths of Saxon internals, you can
write an extension function


public static String getTemplateName(net.sf.saxon.expr XPathContext context)
{
     try {
        return context.getOrigin().getObjectName().getDisplayName();
     } catch (Exception err) {
        return null;
     }
}

and call it without any arguments as xx:getTemplateName(). Not tested. It
will only give the template name if it was invoked using call-template.
Should probably work for function calls as well.

Michael Kay
http://www.saxonica.com/

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201302/post50110.html</link><pubDate>Thu, 28 Feb 2013 19:50:42 GMT</pubDate></item><item><title>Re:  Processing XML with multiple nested CDATA sections</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>On Thu, 2013-02-28 at 15:47 -0800, dvint@xxxxxxxxx wrote:
&gt; [...] Some of
&gt; these CDATA sections have CDATA sections in them.
Are you sure about that?...

CDATA sections don't nest, which is why the &quot;inner&quot; one is terminated
with &quot;]] &gt;&quot; instead of&quot;]]&gt;&quot;.

What you actually have is, to use technical parlance, a mess....

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201302/post10110.html</link><pubDate>Thu, 28 Feb 2013 19:11:02 GMT</pubDate></item><item><title>Re:  Processing XML with multiple nested CDATA sections</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/28/2013 06:47 PM, dvint@xxxxxxxxx wrote:
&gt; I have an XML file that is an export from a Wiki site. The
&gt; management information for the wiki is in clear XML, bu tthe
&gt; information contained in the pages (actual content) has been
&gt; wrapped in CDATA sections. Some of these CDATA sections have CDATA
&gt; sections in them. I need to extract the content and create
&gt; individual files for each of the pages.

You will need to preprocess the content, I think.

There is no such thing as a nested CDATA section (just like there is
no such thing as a nested comment).  The first ]]&gt; ends the currently
open CDATA section, period.  It looks like the generating software
gets around this, if your pasted example, is accurate, by inserting a
space; the nested sections end in ]] &gt;
(bracket-bracket-space-greaterthan).

You could handle this in XSLT, but I think thatbs doing it the hard way.

~Chris
- --
Chris Maden, text nerd  &lt;URL: http://crism.maden.org/ &gt;
  FIVE TONS OF FLAX
GnuPG fingerprint: DB08 CF6C 2583 7F55 3BE9  A210 4A51 DBAC 5C5C 3D5E
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQEcBAEBAgAGBQJRL+92AAoJEEpR26xcXD1exLsIAIzpRmvlh+d7+GT6S2UPmrQD
ts1QKkFi+Dkc2abFum/0esl78ryb5S0fjuZPd0S2qFA82pIphvcKlsk9mcpr/g7x
gCrXUm7d7VJDOF5Wr6ccQIdFlvkyoKqNVsH2l3zKU6BPVktx1j2IMbXi5oIPYHXw
1kObMQ89eEx7iW1jc7/xVKuRyKycwltMeNd4DEMoQnYpg1y+5UgukDESMWXstbY4
u7kTfDeufpU9mKG7VdQbKYzBdn++v5hKw4LiV+tNfWcMTvHxUrjAnZ2xdQyG2tsa
tYqSWhQBDNpz0/W6ESmJdFdHMA41yTsof1mz4F8833qxnwDbr4jOVq6BaiTltpg=
=s6no
-----END PGP SIGNATURE-----

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201302/post90100.html</link><pubDate>Thu, 28 Feb 2013 18:59:50 GMT</pubDate></item><item><title>Re:  Processing XML with multiple nested CDATA sections</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>At 04:11 PM 2/28/2013, you wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><pre style="margin: 0em;">CDATA sections don't nest, which is why the &quot;inner&quot; one is terminated
with &quot;]] &gt;&quot; instead of&quot;]]&gt;&quot;.</pre><br>
<tt>What you actually have is, to use technical parlance, a mess....</tt><br>
<br>
<tt>Liam
</tt></blockquote><tt><br>I hadn't caught that trick. Got to love people that make XML like 
documents. I'll have to look into how to work this out in the morning.</tt><br>
<br>
<tt>thanks everyone</tt><br>
<br>
<pre style="margin: 0em;">..dan
---------------------------------------------------------------------------
Danny Vint</pre><br>
<pre style="margin: 0em;">Panoramic Photography
http://www.dvint.com</pre><br>
<tt>voice: 619-938-3610</tt><br>
<br>

]]></description><link>http://www.stylusstudio.com/xsllist/201302/post20110.html</link><pubDate>Thu, 28 Feb 2013 16:59:24 GMT</pubDate></item><item><title> Processing XML with multiple nested CDATA sections</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>I have an XML file that is an export from a Wiki site. The management
information for the wiki is in clear XML, bu tthe information contained in
the pages (actual content) has been wrapped in CDATA sections. Some of
these CDATA sections have CDATA sections in them. I need to extract the
content and create individual files for each of the pages.

So my first hurdle is unwrapping all these CDATA sections. I was handling
the first one with a simple

&lt;xsl:result-document method=&quot;xml&quot; href=&quot;{element/id}.html&quot;&gt;
    &lt;html xmlns:ac=&quot;foo&quot; xmlns:ri=&quot;bar&quot;&gt;
            &lt;xsl:value-of  disable-output-escaping=&quot;yes&quot;
select=&quot;normalize-space(key('objects',
id)/property[@name='body'])&quot;/&gt;
    &lt;/html&gt;
&lt;/xsl:result-document&gt;

Is there some trick to deal with the nesting that I might try? So far it
looks like I have about 3 levels to deal with. Content I'm processing
looks like this:
&lt;hibernate-generic datetime=&quot;2012-12-30 17:00:12&quot;&gt;
&lt;object class=&quot;BodyContent&quot; package=&quot;com.atlassian.confluence.core&quot;&gt;
		&lt;id name=&quot;id&quot;&gt;37749131&lt;/id&gt;
		&lt;property name=&quot;body&quot;&gt;
			&lt;![CDATA[&lt;p&gt;Creating Inted.&lt;/p&gt;&lt;p&gt;You can also ptions.&lt;/p&gt;
&lt;h1&gt;Generating&lt;/h1&gt;&lt;p&gt;&lt;ac:link&gt;&lt;ri:page ri:content-title=&quot;Types of
Widgets&quot; /&gt;&lt;ac:plain-text-link-body&gt;&lt;![CDATA[Infographic widgets]] &gt;
&lt;/ac:plain-text-link-body&gt;&lt;/ac:link&gt; are ways.&lt;/p&gt;]]&gt;
		&lt;/property&gt;
		&lt;property name=&quot;content&quot; class=&quot;Page&quot;
package=&quot;com.atlassian.confluence.pages&quot;&gt;
			&lt;id name=&quot;id&quot;&gt;37716459&lt;/id&gt;
		&lt;/property&gt;
		&lt;property name=&quot;bodyType&quot;&gt;2&lt;/property&gt;
	&lt;/object&gt;
&lt;/hibernate-generic&gt;

This is my typical situation where there are little CDATA sections for the
filenames, but I have seen other situations where large sections of
content have been wrapped this way as well.

I can brute force this and process my output file several times to finally
cleanup all the CDATA sections, but I would like to be more elegant.

Also I will have a need to de-reference these &lt;id&gt; elements within the
original context, so even my current simple approach is going to cause
problems. This current approach has extracted the content so I can take a
look at it easily, but ultimately I really would like to submit that first
CDATA section in the &lt;property&gt; element for additional processing. For
instance those &lt;ac:link&gt; elements need to be converted to a different
linking structure like the more typical &lt;a href=&quot;&quot;&gt; form.

..dan

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201302/post80100.html</link><pubDate>Thu, 28 Feb 2013 15:47:43 GMT</pubDate></item><item><title>Re:  repeatedly calling a template triggered by data  w</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>Thank you Michael!</tt><br>
<br>
<tt>On 28/02/2013 02:21, Michael Kay wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt><br>Something like</tt><br>
<br>
<pre style="margin: 0em;">&lt;xsl:for-each select=&quot;1 to string-length($alphabet)&quot;&gt;
  &lt;xsl:call-template name=&quot;keyboard&quot;&gt;
    &lt;xsl:with-param name=&quot;letter&quot; select=&quot;substring($alphabet, ., 1)&quot;/&gt;</pre><br>
<tt>perhaps?</tt><br>
<br>
<tt>Or if you want groups of six, something along the lines of</tt><br>
<br>
<pre style="margin: 0em;">&lt;xsl:for-each select=&quot;0 to ceiling(string-length($alphabet) div 6)&quot;&gt;
  &lt;xsl:call-template name=&quot;keyboard&quot;&gt;
    &lt;xsl:with-param name=&quot;letter&quot; select=&quot;substring($alphabet, .+1, 6)&quot;/&gt;</pre><br>
<tt>You'll have to sort out the boundary conditions for yourself.</tt><br>
<br>
<pre style="margin: 0em;">Michael Kay
Saxonica</pre><br>
<tt>On 28/02/2013 05:07, Mark Wilson wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>Hello,<br>
I want to write a template that would, for each letter in some 
specified alphabet, call the following template to create a cell for 
an HTML table in the output document. Is there a way to set up 
something that would select each letter from an alphabet stored in a 
stylesheet parameter and call the 'keyboard' template? Since various 
alphabets have differing lengths and content, I was thinking of 
perhaps a string as the parameter. It would be very helpful to be 
able to trigger the template in groups of six to accommodate the &lt;tr&gt; 
elements.</tt><br>
<br>
<tt>I looked at XPath 'for' but could not see a means of triggering the 
'keyboard' template.</tt><br>
<br>
<pre style="margin: 0em;">Thanks,
Mark</pre><br>
<tt>&lt;xsl:template name=&quot;keyboard&quot;&gt;<br>
        &lt;xsl:param name=&quot;letter&quot;/&gt;<br>
        &lt;xsl:param name=&quot;this-page-name&quot;/&gt;<br>
        &lt;xsl:choose&gt;<br>
            &lt;xsl:when test=&quot;not($this-page-name eq $letter)&quot;&gt;<br>
                &lt;xsl:variable name=&quot;file-name&quot; 
select=&quot;concat(lower-case($letter),'.htm')&quot;/&gt;<br>
                &lt;td&gt;<br>
                    &lt;a href=&quot;{$file-name}&quot;&gt;<br>
                        &lt;xsl:value-of select=&quot;$letter&quot;/&gt;<br>
                    &lt;/a&gt;<br>
                &lt;/td&gt;<br>
            &lt;/xsl:when&gt;<br>
            &lt;xsl:otherwise&gt;<br>
                &lt;td class=&quot;current&quot;&gt;<br>
                    &lt;xsl:value-of select=&quot;$letter&quot;/&gt;<br>
                &lt;/td&gt;<br>
            &lt;/xsl:otherwise&gt;<br>
        &lt;/xsl:choose&gt;<br>
    &lt;/xsl:template&gt;
</tt></blockquote><tt></tt><br>
<br>
<tt></tt><br>
<br>
</blockquote><pre style="margin: 0em;"><br>--
Mark Wilson
Knihtisk Publishing</pre><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201302/post70100.html</link><pubDate>Thu, 28 Feb 2013 10:14:04 GMT</pubDate></item><item><title>Re:  repeatedly calling a template triggered by data  w</title><description><![CDATA[<!--X-Body-of-Message-->
<tt>Something like</tt><br>
<br>
<pre style="margin: 0em;">&lt;xsl:for-each select=&quot;1 to string-length($alphabet)&quot;&gt;
  &lt;xsl:call-template name=&quot;keyboard&quot;&gt;
    &lt;xsl:with-param name=&quot;letter&quot; select=&quot;substring($alphabet, ., 1)&quot;/&gt;</pre><br>
<tt>perhaps?</tt><br>
<br>
<tt>Or if you want groups of six, something along the lines of</tt><br>
<br>
<pre style="margin: 0em;">&lt;xsl:for-each select=&quot;0 to ceiling(string-length($alphabet) div 6)&quot;&gt;
  &lt;xsl:call-template name=&quot;keyboard&quot;&gt;
    &lt;xsl:with-param name=&quot;letter&quot; select=&quot;substring($alphabet, .+1, 6)&quot;/&gt;</pre><br>
<tt>You'll have to sort out the boundary conditions for yourself.</tt><br>
<br>
<pre style="margin: 0em;">Michael Kay
Saxonica</pre><br>
<tt>On 28/02/2013 05:07, Mark Wilson wrote:
</tt><blockquote style="border-left: #0000FF solid 0.1em; margin: 0em; padding-left: 1.0em"><tt>Hello,<br>
I want to write a template that would, for each letter in some 
specified alphabet, call the following template to create a cell for 
an HTML table in the output document. Is there a way to set up 
something that would select each letter from an alphabet stored in a 
stylesheet parameter and call the 'keyboard' template? Since various 
alphabets have differing lengths and content, I was thinking of 
perhaps a string as the parameter. It would be very helpful to be able 
to trigger the template in groups of six to accommodate the &lt;tr&gt; 
elements.</tt><br>
<br>
<tt>I looked at XPath 'for' but could not see a means of triggering the 
'keyboard' template.</tt><br>
<br>
<pre style="margin: 0em;">Thanks,
Mark</pre><br>
<tt>&lt;xsl:template name=&quot;keyboard&quot;&gt;<br>
        &lt;xsl:param name=&quot;letter&quot;/&gt;<br>
        &lt;xsl:param name=&quot;this-page-name&quot;/&gt;<br>
        &lt;xsl:choose&gt;<br>
            &lt;xsl:when test=&quot;not($this-page-name eq $letter)&quot;&gt;<br>
                &lt;xsl:variable name=&quot;file-name&quot; 
select=&quot;concat(lower-case($letter),'.htm')&quot;/&gt;<br>
                &lt;td&gt;<br>
                    &lt;a href=&quot;{$file-name}&quot;&gt;<br>
                        &lt;xsl:value-of select=&quot;$letter&quot;/&gt;<br>
                    &lt;/a&gt;<br>
                &lt;/td&gt;<br>
            &lt;/xsl:when&gt;<br>
            &lt;xsl:otherwise&gt;<br>
                &lt;td class=&quot;current&quot;&gt;<br>
                    &lt;xsl:value-of select=&quot;$letter&quot;/&gt;<br>
                &lt;/td&gt;<br>
            &lt;/xsl:otherwise&gt;<br>
        &lt;/xsl:choose&gt;<br>
    &lt;/xsl:template&gt;
</tt></blockquote><br>

]]></description><link>http://www.stylusstudio.com/xsllist/201302/post60100.html</link><pubDate>Thu, 28 Feb 2013 09:21:40 GMT</pubDate></item><item><title> Support for lookaround regexp in XSLT -- any time soon</title><description><![CDATA[<!--X-Body-of-Message-->
<pre>Hi there,

I've been using XSLT/XPath for some time to find patterns in
(XML-based) XLIFF files, but now I'm going to need more complex
regexps (e.g. positive/negative lookaround/lookbehind/lookahead, aka
zero-width assertions, or non-capturing groups) and I see that they
are not supported.

My question is whether there are plans to support these advanced
features in the future. Does anyone know?

I know .NET or Perl regular expressions support that, but I would
rather stick to XSLT if I can. It makes my life much simpler.

Thanks in advance.

Cheers,
Manuel Souto Pico

</pre>
]]></description><link>http://www.stylusstudio.com/xsllist/201302/post30100.html</link><pubDate>Thu, 28 Feb 2013 00:20:55 GMT</pubDate></item></channel></rss>