|
Home > Learn XML > XML Blogs > XSL-List Blog
The XSL-LIST BlogThe XSL-List Blog's mission is to increase the level of XSL knowledge and usage in the software development community. It's a service by Mulberry Technologies, and the list is by far the most popular XSL development forum in the world — in fact, some of the inventors of XSL hang out there and respond to questions. Got a stylesheet emergency? Want to contribute to the XSL community? visit the XSL-List blog today! Re: XSLT 3.0 features in Saxon 9.5Posted 5/6/2013 10:33:36 PMOn Wed, 24 Apr 2013, Michael Kay wrote: 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. [...] * xsl:map and xsl:map-entry so you can now construct maps at the XSLT level, not only at the XPath . . . Read full entry » Re: XSLT 3.0 features in Saxon 9.5Posted 5/6/2013 10:33:36 PMOn Wed, 24 Apr 2013, Michael Kay wrote: 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. [...] * xsl:map and xsl:map-entry so you can now construct maps at the XSLT level, not only at the XPath . . . Read full entry » XSLT 3.0 Relax NG SchemaPosted 5/4/2013 10:23:01 PMDear 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 . . . Read full entry » [ann] A series of 3 webinars on XSLT development withPosted 5/1/2013 1:13:53 PMHi all, I would like to invite you to attend our "XSLT development with oXygen XML Editor" webinars. XSLT is the best supported technology in oXygen and we will try to cover all aspects of XSLT development in 3 webinars. The first webinar is scheduled for May 8th from 11:00 AM to 12:0 . . . Read full entry » XSL-List GuidelinesPosted 5/1/2013 9:58:31 AMThis information is posted to the XSL-List (and the XSL-List Digest) at intervals under the subject line "XSL-List guidelines". 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, us . . . Read full entry » XSL-List GuidelinesPosted 5/1/2013 9:58:26 AMThis information is posted to the XSL-List (and the XSL-List Digest) at intervals under the subject line "XSL-List guidelines". 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, us . . . Read full entry » Re: how to include nodes inside CData tagsPosted 4/30/2013 2:44:10 PMIt's a very confused question. "tags" exist in lexical (angle-bracket) XML, "nodes" 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 pur . . . Read full entry » Re: how to include nodes inside CData tagsPosted 4/30/2013 2:44:10 PMIt's a very confused question. "tags" exist in lexical (angle-bracket) XML, "nodes" 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 pur . . . Read full entry » Re: how to include nodes inside CData tagsPosted 4/30/2013 2:21:53 PMOn 30 April 2013 14:16, Terry Ofner <tdofner@xxxxxxxxx> wrote: > I need to generate the following format: > > <question> > <![CDATA[The city council passed the new <strong>regulation</strong>.]]> > </question> > > from this input: > > & . . . Read full entry » how to include nodes inside CData tagsPosted 4/30/2013 9:16:05 AMI need to generate the following format: <question> <![CDATA[The city council passed the new <strong>regulation</strong>.]]> </question> from this input: <question>The city council passed the new <strong>regulation</strong>.></question> w . . . Read full entry » Re: how to include nodes inside CData tagsPosted 4/30/2013 8:48:13 AMIn XSLT 3.0 (XPath 3.0) one can use the parse-xml-fragment() function: <xsl:sequence select="parse-xml-fragment(question) /node()"/> Cheers, Dimitre On Tue, Apr 30, 2013 at 6:16 AM, Terry Ofner <tdofner@xxxxxxxxx> wrote: > I need to generate the following format: > &g . . . Read full entry » XSL-List GuidelinesPosted 4/29/2013 4:45:37 PMThis information is posted to the XSL-List (and the XSL-List Digest) at intervals under the subject line "XSL-List guidelines". 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, us . . . Read full entry » XSL-List GuidelinesPosted 4/29/2013 4:45:37 PMThis information is posted to the XSL-List (and the XSL-List Digest) at intervals under the subject line "XSL-List guidelines". 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, us . . . Read full entry » Re: How to make auto row-spanned tablePosted 4/25/2013 11:27:16 PMDear Mr. Holman, Thank you for your detailed and excellent reply. I was very excited seeing your XSLT stylesheet. It is actually working! 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 . . . Read full entry » Re: Chrome/blink developers discussing removing XSLTPosted 4/25/2013 10:13:38 PMOn Thu, April 25, 2013 9:04 pm, Eric J. Bowman wrote: > Dimitre Novatchev wrote: >> >> Alas, I am not one of the browser vendors... but these people probably >> can make logical conclusions? > > Yes, they've logically concluded that they can dictate which > technologie . . . Read full entry » Re: Chrome/blink developers discussing removing XSLTPosted 4/25/2013 5:23:16 PM"Tony Graham" wrote: > > There's obviously more than a little distance between those two > positions, but how would you positively influence them towards our > position? > After years of watching every issue I care about get decided the other way by the browser vendors, I . . . Read full entry » Re: XSLT 3.0 features in Saxon 9.5Posted 4/25/2013 5:01:33 PMOn 25 Apr 2013, at 07:36, davep wrote: > On 24/04/13 18:29, Michael Kay wrote: >> 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. >> > > Is 9.5 fully compliant to the spec . . . Read full entry » Re: Chrome/blink developers discussing removing XSLTPosted 4/25/2013 2:04:06 PMDimitre Novatchev wrote: > > Alas, I am not one of the browser vendors... but these people probably > can make logical conclusions? > Yes, they've logically concluded that they can dictate which technologies are "inappropriate" for use in browsers. Can't imagine this has a . . . Read full entry » RE: XSLT 3.0 features in Saxon 9.5Posted 4/25/2013 12:12:46 PMYes Mike, awaiting to implement it here! Regards, Arulselvan R Pallavarayar Senior Software Engineer | MPS Limited RR Tower -4 | Super-A, 16 &17 4th floor| TVK industrial Estate | Guindy | Chennai | 600032 | INDIA Direct: +91 (0)44 4916 2259 | Ext 259 Mobile: +91 (0)9710416093 Email: arul.se . . . Read full entry » Re: XSLT 3.0 features in Saxon 9.5Posted 4/25/2013 10:14:12 AMOn Thu, 2013-04-25 at 07:36 +0100, davep wrote: > On 24/04/13 18:29, Michael Kay wrote: > > 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. > > > > Is 9.5 fully compliant t . . . Read full entry » Re: XSLT 3.0 features in Saxon 9.5Posted 4/25/2013 7:36:47 AMOn 24/04/13 18:29, Michael Kay wrote: 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. Is 9.5 fully compliant to the spec now Mike? As it currently stands? I know you do a lot of testing. rega . . . Read full entry » How to make auto row-spanned tablePosted 4/25/2013 1:29:50 AMHi list, 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. For your reference I upload . . . Read full entry » XSLT 3.0 features in Saxon 9.5Posted 4/24/2013 6:29:03 PMI 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 <xsl:for-each-group group-by="first, last" composite="yes"> * a . . . Read full entry » Re: How to make auto row-spanned tablePosted 4/24/2013 1:56:29 PMAt 2013-04-24 12:40 -0400, I wrote: At 2013-04-25 01:29 +0900, Toshihiko Makita wrote: I'm making a stylesheet that converts DITA documents to XSL-FO. 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 . . . Read full entry » Re: How to make auto row-spanned tablePosted 4/24/2013 12:40:58 PMAt 2013-04-25 01:29 +0900, Toshihiko Makita wrote: Hi list, 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 automatic . . . Read full entry » Re: How to make auto row-spanned tablePosted 4/24/2013 12:40:58 PMAt 2013-04-25 01:29 +0900, Toshihiko Makita wrote: Hi list, 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 automatic . . . Read full entry » Chrome/blink developers discussing removing XSLT suppoPosted 4/24/2013 10:12:50 AMA 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 "blink-dev" discussion for Chrome's new rendering engine ... examines the possibility of removing support for XSLT from the browser. If so, Bl . . . Read full entry » RE: Chrome/blink developers discussing removing XSLTPosted 4/24/2013 9:54:04 AMThis 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'V . . . Read full entry » Re: Namespace for reconstituted HTMLPosted 4/24/2013 9:23:55 AMOn 24/04/2013 07:36, Ihe Onwuka wrote: 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 xmln . . . Read full entry » Re: Namespace for reconstituted HTMLPosted 4/24/2013 9:23:55 AMOn 24/04/2013 07:36, Ihe Onwuka wrote: 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 xmln . . . Read full entry » Re: Chrome/blink developers discussing removing XSLTPosted 4/24/2013 9:05:54 AMWell, 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 enha . . . Read full entry » Namespace for reconstituted HTMLPosted 4/24/2013 7:36:49 AMI 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="http://www.w3.org/1999/xhtml&q . . . Read full entry » Namespace for reconstituted HTMLPosted 4/24/2013 7:36:49 AMI 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="http://www.w3.org/1999/xhtml&q . . . Read full entry » RE: accumulatorsPosted 4/20/2013 8:06:56 PMYes, the example I sent does not make any sense after reading the spec properly. -----Original Message----- From: Michael Kay [mailto:mike@xxxxxxxxxxxx] Sent: Saturday, April 20, 2013 6:41 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: accumulators Like xsl:key, accumulators apply to every . . . Read full entry » RE: accumulatorsPosted 4/20/2013 8:06:56 PMYes, the example I sent does not make any sense after reading the spec properly. -----Original Message----- From: Michael Kay [mailto:mike@xxxxxxxxxxxx] Sent: Saturday, April 20, 2013 6:41 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: accumulators Like xsl:key, accumulators apply to every . . . Read full entry » Re: accumulatorsPosted 4/20/2013 5:41:09 PMLike 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: . . . Read full entry » accumulatorsPosted 4/19/2013 11:04:51 PMHi, 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: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3 . . . Read full entry » accumulatorsPosted 4/19/2013 11:04:51 PMHi, 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: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3 . . . Read full entry » Re: Using mode removes linebreaks/indentsPosted 4/19/2013 4:30:56 PMAt 2013-04-18 11:07 +0000, trond.huso@xxxxxx wrote: For some reason when using mode the indentation and line breaks are all removed: 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 th . . . Read full entry » Re: Using mode removes linebreaks/indentsPosted 4/19/2013 4:30:56 PMAt 2013-04-18 11:07 +0000, trond.huso@xxxxxx wrote: For some reason when using mode the indentation and line breaks are all removed: 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 th . . . Read full entry » Re: replacing selective p tags with tags with attributPosted 4/18/2013 11:02:45 PMAt 2013-04-18 22:38 -0400, strip513 . wrote: Hey guys, I have an xml file with many p tags -- INPUT -- ... I want all the p tags which are above inline img class to be replaced by <p channel="y.com"> and it will look like ... I dont want to . . . Read full entry » replacing selective p tags with tags with attributesPosted 4/18/2013 10:38:40 PMHey guys, I have an xml file with many p tags -- INPUT -- <p> <inline-img class="full"> <web-main-photo> <photo src="http://yahoo.com/test.jpg"/> </web-m . . . Read full entry » Re: replacing selective p tags with tags with attributPosted 4/18/2013 8:30:22 PMstrip513, 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 <gkholman@xxxxxxxxxxxxxxxxxxxx> wrote: > At 2013-04-18 22:38 -0400, strip513 . wrote: &g . . . Read full entry » Using mode removes linebreaks/indentsPosted 4/18/2013 11:07:49 AMHi, For some reason when using mode the indentation and line breaks are all removed: This is the initiater: <xsl:template match="/" mode="run2"> <nitf version="-//IPTC//DTD NITF 3.2//EN" change.date="October 10, 2003" change.time="19:3 . . . Read full entry » Re: xsl output defaults - htmlPosted 4/18/2013 9:28:41 AMOn 18/04/2013 06:48, Ihe Onwuka wrote: 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. . . . Read full entry » xsl output defaults - htmlPosted 4/18/2013 6:48:02 AMJust 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. . . . Read full entry » Re: .[predicate] vs self::node()[predicate]- Xalan 2.7Posted 4/17/2013 11:28:48 AMOn 17.04.2013 11:27, Imsieke, Gerrit, le-tex wrote: If the first hypothesis is correct, it will explain that "self::node()[starts-with(name,'tdown')]" does not match while "child::node()[starts-with(name,'tdown')]" or "*[starts-with(name,'tdown')]" will probably match. . . . Read full entry » Re: .[predicate] vs self::node()[predicate]- Xalan 2.7Posted 4/17/2013 11:28:48 AMOn 17.04.2013 11:27, Imsieke, Gerrit, le-tex wrote: If the first hypothesis is correct, it will explain that "self::node()[starts-with(name,'tdown')]" does not match while "child::node()[starts-with(name,'tdown')]" or "*[starts-with(name,'tdown')]" will probably match. . . . Read full entry » Re: .[predicate] vs self::node()[predicate]- Xalan 2.7Posted 4/17/2013 11:27:07 AMOn 17.04.2013 11:12, Raimund Kammering wrote: XSL: <xsl:template match="entry/sum"> ... <xsl:for-each select=".[starts-with(name,'tdown')]"> ... </xsl:for-each> ... </xsl:template> Given the structure of your XML document, it looks as if th . . . Read full entry » .[predicate] vs self::node()[predicate]- Xalan 2.7Posted 4/17/2013 11:12:37 AMHello, 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! There . . . Read full entry » Re: .[predicate] vs self::node()[predicate]- Xalan 2.7Posted 4/17/2013 10:29:39 AMOn 17/04/2013 10:12, Raimund Kammering wrote: Hello, I have a stylesheet which works correct if I use: .[predicate] but I get an warning/error from the transformer saying: It's not a warning it is a syntax error, The processor could just stop and give no result at all. It is legal syntax in X . . . Read full entry » XSLT and SPARQLPosted 4/16/2013 11:45:00 AMXSL Working Group, Greetings. Previous research and projects into XSLT and SPARQL include Topia (http://www.telin.nl/index.cfm?language=en&project=Topia) from the research of Jacco Van Ossenbruggen, Lynda Hardman and Lloyd Rutledge, RDF Twig (http://norman.walsh.name/2004/projects/rdftwig) by N . . . Read full entry » Re: Saxon-EE 9.4.0.6 can't adress comment nodesPosted 4/10/2013 5:19:31 PMNow fixed. https://saxonica.plan.io/issues/1731 Thanks Bjoern and Octavian. Michael Kay Saxonica On 10 Apr 2013, at 14:57, Octavian Nadolu wrote: > Hello, > > The problem can be reproduced in oXygen 14.2 if schema-based validation (-val) is enabled, the XML Schema version is set to 1. . . . Read full entry » Re: Saxon-EE 9.4.0.6 can't adress comment nodesPosted 4/10/2013 5:19:31 PMNow fixed. https://saxonica.plan.io/issues/1731 Thanks Bjoern and Octavian. Michael Kay Saxonica On 10 Apr 2013, at 14:57, Octavian Nadolu wrote: > Hello, > > The problem can be reproduced in oXygen 14.2 if schema-based validation (-val) is enabled, the XML Schema version is set to 1. . . . Read full entry » Re: Saxon-EE 9.4.0.6 can't adress comment nodesPosted 4/10/2013 4:57:43 PMHello, 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. To resolve the problem you can enable the 'assertions can see comments' option from the . . . Read full entry » Re: Saxon-EE 9.4.0.6 can't adress comment nodesPosted 4/10/2013 4:57:43 PMHello, 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. To resolve the problem you can enable the 'assertions can see comments' option from the . . . Read full entry » Re: Saxon-EE 9.4.0.6 can't adress comment nodesPosted 4/10/2013 3:12:37 PMOK, 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: > Hello, > . . . Read full entry » Re: Saxon-EE 9.4.0.6 can't adress comment nodesPosted 4/10/2013 12:42:13 PMWe'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: >> I'm always a bit reticent about . . . Read full entry » Re: Saxon-EE 9.4.0.6 can't adress comment nodesPosted 4/10/2013 10:15:02 AMI'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 . . . Read full entry » Re: Saxon-EE 9.4.0.6 can't adress comment nodesPosted 4/9/2013 6:51:51 PMI'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. . . . Read full entry » Saxon-EE 9.4.0.6 can't adress comment nodesPosted 4/9/2013 5:44:16 PMWith Saxon-EE 9.4.0.6 I can't adress comment nodes. Source ----------------------------------------------- <?xml version="1.0" encoding="UTF-8"?> <r> <!-- This is a comment. --> </r> --------------------------------------------- . . . Read full entry » Re: Priorities of unionised patternsPosted 4/9/2013 2:32:22 PMI 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 <mike@xxxxxxxxxxxx> wrote: & . . . Read full entry » Re: Priorities of unionised patternsPosted 4/9/2013 2:22:21 PMYou'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, . . . Read full entry » Re: XPath 3.0: Is it possible to do recursion in an aPosted 4/9/2013 12:43:18 PMIt 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. <costello@xxxxxxxxx> wrote: > Hi Folks, > > Is it possible to do . . . Read full entry » Priorities of unionised patternsPosted 4/9/2013 12:37:59 PMGiven that the sub parts of a unionized pattern retain their individual priorities <xsl:template match="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 . . . Read full entry » Re: Matching string values across element boundariesPosted 4/8/2013 8:58:49 PMDavid, Can you give a more complex example, how "variable in structure" 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?) . . . Read full entry » Re: XPath 3.0: Is it possible to do recursion in an aPosted 4/8/2013 8:04:55 PMSomething 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, Oc . . . Read full entry » Re: Matching string values across element boundariesPosted 4/8/2013 7:00:00 PMDavid - 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 m . . . Read full entry » Re: Matching string values across element boundariesPosted 4/8/2013 5:01:09 PMAnaylze-string can match the string, and wrap the <ref> 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: <note>See for example <ref target="st002">Jay, Unpublished Paper . . . Read full entry » Re: Matching string values across element boundariesPosted 4/8/2013 4:26:06 PMA sample of the citation abbreviations that need to be matched (for simplicity, <i> 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): <abbr xml:id="st001"><i>Cal. . . . Read full entry » Matching string values across element boundariesPosted 4/8/2013 2:15:28 PMI 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, <hi rend="italic">Braintree Families</hi> We want to wrap them inside another . . . Read full entry » Re: CSSXX to XMLPosted 4/5/2013 2:01:04 PMOn 03/30/2013 09:03 PM, Dorothy Hoskins wrote: https://github.com/andriy-gerasika/css2xml . . . Read full entry » Re: Cannot write more than one result document to thePosted 4/5/2013 11:08:12 AMAt 2013-04-04 20:22 -0700, Dan Vint wrote: 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? It is sitting in memory w . . . Read full entry » Balisage 2013Posted 4/5/2013 10:55:12 AMIs 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 . . . Read full entry » Re: Cannot write more than one result document to thePosted 4/5/2013 9:18:13 AMDan, 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 . . . Read full entry » Re: Cannot write more than one result document to thePosted 4/5/2013 9:08:18 AM> The problem is that the specification does not require the XSLT processor to complete the processing of the first <b> before starting or even ending the processing of the second <b>. Sure a single-process implementation "X" likely would. But a parallelized (is that a wo . . . Read full entry » Re: Cannot write more than one result document to thePosted 4/4/2013 10:56:54 PMAt 2013-04-04 19:37 -0700, Dan Vint wrote: I can live with the rule, just would like to understand the logic. Consider the following scenario. An XML document has two elements <b>: <a> <b id="1">...</b> <b id="2">...</b> </a&g . . . Read full entry » Re: Cannot write more than one result document to thePosted 4/4/2013 10:18:37 PMOn 4 Apr 2013, at 21:42, dvint@xxxxxxxxx wrote: > 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? It's not clear what you would like to happe . . . Read full entry » Re: Cannot write more than one result document to thePosted 4/4/2013 9:53:13 PMOn Thu, 2013-04-04 at 16:46 -0700, Dan Vint wrote: > I guess what I'm expecting is that the result document is closed once > the </xslt:result-document> 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 . . . Read full entry » Re: Cannot write more than one result document to thePosted 4/4/2013 9:52:01 PMAt 2013-04-04 16:46 -0700, Dan Vint wrote: I guess what I'm expecting is that the result document is closed once the </xslt:result-document> end tag is found. Yes, it is. Instead XSLT seems to keep this memory around that it is there. No, not in memory. I'm happy with just over writing the . . . Read full entry » [Ann] A new desktop app for syntax-highlighting and fPosted 4/4/2013 8:26:36 PMDear 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 . . . Read full entry » Re: Cannot write more than one result document to thePosted 4/4/2013 8:22:20 PMThanks, 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? Probably answering my own question here, I'm guessing the differenc . . . Read full entry » Re: Cannot write more than one result document to thePosted 4/4/2013 7:37:48 PMAt 06:52 PM 4/4/2013, you wrote: It isn't a problem with the implementation, it is a formal aspect of the specification as cited above. 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 . . . Read full entry » Re: Cannot write more than one result document to thePosted 4/4/2013 7:27:13 PMIt 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? ..dan At 06:53 PM 4/4/2013, you wrote: On Thu, 2013-04-04 at 16:46 . . . Read full entry » Re: xsl:apply-imports behavior wrong in Saxon?Posted 4/4/2013 6:38:56 PMThe 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: "If no matching template rule is found that satisfies these criteria, the built-in template rul . . . Read full entry » [ANN] No Fooling: Time to Start on Your Balisage PaperPosted 4/4/2013 5:35:04 PMOK, I know I "cried wolf" 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/Call4Partic . . . Read full entry » Re: Cannot write more than one result document to thePosted 4/4/2013 4:46:31 PMI guess what I'm expecting is that the result document is closed once the </xslt:result-document> 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 in . . . Read full entry » Re: xpath 2 regexPosted 4/4/2013 2:13:07 PMOn 04/04/13 13:56, Michael Sokolov wrote: It seems likely () (for grouping) was intended rather than [] (for a character class)? Yes Michael, that makes sense, though testing shows that as unnecessary in this simple case. regards On 04/04/2013 08:04 AM, David Carlisle wrote: On 04/04/2013 13:0 . . . Read full entry » Re: xpath 2 regexPosted 4/4/2013 2:04:02 PMdavep wrote: Tks for the quick reply. On 04/04/13 12:49, Martin Honnen wrote: davep wrote: If so, what patter matches a p element which starts with the string "the quick brown" or contains "brown fox" please? <xsl:template match="p[matches(., '(^the quick brown)|bro . . . Read full entry » Re: Cannot write more than one result document to thePosted 4/4/2013 2:03:33 PMIt looks like this is more the issue: <concept> <h1 conref="file2.xml#sysoutput"></h1> <h1 conref=file2.xml#sysoutput"></h1> </concept> Same situation applies, tha the result document should be closed, but it is writing to the same file twi . . . Read full entry » Re: xpath 2 regexPosted 4/4/2013 1:49:24 PMdavep wrote: If so, what patter matches a p element which starts with the string "the quick brown" or contains "brown fox" please? <xsl:template match="p[matches(., '(^the quick brown)|brown fox')]">...</xsl:template> . . . Read full entry » Cannot write more than one result document to the samePosted 4/4/2013 1:42:25 PMI 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 fi . . . Read full entry » Re: xsl:apply-imports behavior wrong in Saxon?Posted 4/4/2013 1:11:17 PMAt 2013-04-04 09:10 -0700, Bob Stayton wrote: I have uncovered a significant difference in the way xsltproc and Saxon (both 6 and 9) handle xsl:apply-imports when using a template mode. It seem that Saxon is doing the wrong thing here, but I wanted to ask if others interpret it this way. I canno . . . Read full entry » Re: xpath 2 regexPosted 4/4/2013 1:04:06 PMOn 04/04/2013 13:00, David Carlisle wrote: On 04/04/2013 12:40, davep wrote: <xsl:template match="p[matches(normalize-space(), '^[the quick] | [brown fox]' )]" that matches either a string that starts with one of the letters t h e ' ' q u i c k followed by a space. or string tha . . . Read full entry » Re: xpath 2 regexPosted 4/4/2013 1:00:25 PMOn 04/04/2013 12:40, davep wrote: <xsl:template match="p[matches(normalize-space(), '^[the quick] | [brown fox]' )]" that matches either a string that starts with one of the letters t h e ' ' q u i c k followed by a space. or string that contains a space followed by one of the . . . Read full entry » Re: xpath 2 regexPosted 4/4/2013 12:52:44 PMTks for the quick reply. On 04/04/13 12:49, Martin Honnen wrote: davep wrote: If so, what patter matches a p element which starts with the string "the quick brown" or contains "brown fox" please? <xsl:template match="p[matches(., '(^the quick brown)|brown fox')]&quo . . . Read full entry » xpath 2 regexPosted 4/4/2013 12:40:52 PM<xsl:template match="p[matches(normalize-space(), '^[the quick] | [brown fox]' )]" I'm having problems interpreting this. I think <p> the quick .....</p> matches <p>the quick... </p> matches what role does the | take please? a simple alternate? <p> . . . Read full entry » xsl:apply-imports behavior wrong in Saxon?Posted 4/4/2013 9:10:18 AMI have uncovered a significant difference in the way xsltproc and Saxon (both 6 and 9) handle xsl:apply-imports when using a template mode. It seem that Saxon is doing the wrong thing here, but I wanted to ask if others interpret it this way. I cannot find anything in the archive on this subject . . . Read full entry » Re: xpath 2 regexPosted 4/4/2013 8:56:23 AMIt seems likely () (for grouping) was intended rather than [] (for a character class)? On 04/04/2013 08:04 AM, David Carlisle wrote: On 04/04/2013 13:00, David Carlisle wrote: On 04/04/2013 12:40, davep wrote: <xsl:template match="p[matches(normalize-space(), '^[the quick] | [brown fox]' . . . Read full entry » Best way of preserving comments?Posted 4/3/2013 3:08:54 PMUsing XSLT 2, this combination: <xsl:strip-space elements = "*" /> <xsl:template match="element()|attribute()">... skip selected *|@* ... /> <xsl:template match="text()|@_ix"> <xsl:copy-of select="."/> </xsl:template> . . . Read full entry » Re: Best way of preserving comments?Posted 4/3/2013 2:56:48 PMOn Wed, April 3, 2013 2:08 pm, Wolfgang Laun wrote: > Using XSLT 2, this combination: > > <xsl:strip-space elements = "*" /> If you don't strip white-space and do use: <xsl:output method="xml" indent="no" /> then you should get your existing wh . . . Read full entry » Re: Best way of preserving comments?Posted 4/3/2013 2:23:46 PMOn 03/04/2013 14:08, Wolfgang Laun wrote: Using XSLT 2, this combination: <xsl:strip-space elements = "*" /> <xsl:template match="element()|attribute()">... skip selected *|@* ... /> <xsl:template match="text()|@_ix"> <xsl:copy-of sel . . . Read full entry » Re: Best way of preserving comments?Posted 4/3/2013 2:15:49 PM> <xsl:strip-space elements = "*" /> > 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. . . . Read full entry » RE: XML Schema 1.0 filesPosted 4/1/2013 12:38:32 PMWhen 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 d . . . Read full entry » Re: CSSXX to XMLPosted 3/31/2013 10:18:21 PMOn Sat, Mar 30, 2013 at 8:03 PM, Dorothy Hoskins <dorothy.hoskins@xxxxxxxxx> wrote: > > 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. (...) > Th . . . Read full entry » Re: CSSXX to XMLPosted 3/30/2013 8:59:49 PMHi Dorothy, You might want to try our css expander. Itbs a three-step process: b Transform the XHTML and its CSS, be it linked, included as style element or style attribute, into an XML representation of the CSS. b Transform this representation into an XSLT stylesheet, where XSLT matching . . . Read full entry » Re: CSSXX to XMLPosted 3/30/2013 3:08:40 PMDorothy, I have an example of using unparsed-text() and <xsl:analyze-string> with regular expressions in this publicly-available set of stylesheets that convert CSV (comma-separated values) and TSV (tab-separated values) into XML: http://www.CraneSoftwrights.com/resources/#csv The inpu . . . Read full entry » CSSXX to XMLPosted 3/30/2013 3:03:47 PMHI, 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: <img class="frame-3" src . . . Read full entry » Re: XML and JSON performance tests in browsersPosted 3/28/2013 1:53:22 PMThe network is iphone4 over 100 mb/5mb fiber and wifi. El 28/03/2013, a las 13:29, David Lee <dlee@xxxxxxxxxxx> escribiC3: > 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. . . . Read full entry » Re: XML and JSON performance tests in browsersPosted 3/28/2013 1:51:44 PMDone! Could you share the results? El 28/03/2013, a las 13:29, David Lee <dlee@xxxxxxxxxxx> escribiC3: > 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 . . . Read full entry » XML and JSON performance tests in browsersPosted 3/28/2013 12:29:23 PMI 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 . . . Read full entry » Re: XML Schema 1.0 filesPosted 3/28/2013 7:25:22 AMThanks Mike, Quite comprehensive. On 27/03/13 22:54, Michael Kay wrote: 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 th . . . Read full entry » Re: XML Schema 1.0 filesPosted 3/27/2013 10:54:23 PMIn 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 el . . . Read full entry » Re: How to write a stream-oriented XSLT filter?Posted 3/27/2013 8:13:46 PMOn 27/03/2013 17:32, Liam R E Quin wrote: 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. Thanks, but filtering and so on is handled very . . . Read full entry » RE: Processing tab delimited text with XSLTPosted 3/27/2013 3:28:16 PMHi 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 [mailto:g.ken.holman@xxxxxxxxx] On Behalf Of G. Ken Holman Sent: Wednesday, March 27, 2013 3:11 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx; xsl-list@xxxxxxxxx . . . Read full entry » Re: Processing tab delimited text with XSLTPosted 3/27/2013 3:10:31 PMAt 2013-03-27 15:06 -0400, Rick Quatro wrote: 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 . . . Read full entry » Processing tab delimited text with XSLTPosted 3/27/2013 3:06:32 PMI 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 . . . Read full entry » Re: XML Schema 1.0 filesPosted 3/27/2013 1:28:55 PMA partial answer using xmlsh xpath -i abc.xsd "//xsd:attribute[@name='x']/ancestor::xsd:schema/@targetNamespace" Delivers the associated namespace when a match is found. regards On 27/03/13 11:58, davep wrote: On 27/03/13 11:34, Wolfgang Laun wrote: I think I did something similar . . . Read full entry » Re: XML Schema 1.0 filesPosted 3/27/2013 12:34:32 PMI think I did something similar only recently. My XML schema had attributes marking the "interesting" xsd:element (and xsd:attribute) definitions. Based on this I created a key with the names of the marked elements. <xsl:key name="kSkips" match="element()[@my:m . . . Read full entry » Re: How to write a stream-oriented XSLT filter?Posted 3/27/2013 12:04:40 PMOn 26/03/2013 21:20, Michael Kay wrote: 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. 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 . . . Read full entry » Re: XML Schema 1.0 filesPosted 3/27/2013 11:58:24 AMOn 27/03/13 11:34, Wolfgang Laun wrote: I think I did something similar only recently. My XML schema had attributes marking the "interesting" xsd:element (and xsd:attribute) definitions. Based on this I created a key with the names of the marked elements. <xsl:key name="kSkips&quo . . . Read full entry » Re: How to write a stream-oriented XSLT filter?Posted 3/27/2013 11:32:49 AMOn Wed, 2013-03-27 at 12:04 +0200, John English wrote: > [...] 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). You could look into XQuery - a number of XQuery implementations that can liv . . . Read full entry » Re: XML Schema 1.0 filesPosted 3/27/2013 11:25:45 AMOn 27/03/13 10:56, Philip Fearon wrote: 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 a . . . Read full entry » Re: XML Schema 1.0 filesPosted 3/27/2013 10:56:26 AMI 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 . . . Read full entry » XML Schema 1.0 filesPosted 3/27/2013 10:14:01 AMGiven an XML schema, I want to find files containing definitions & references of a particular element Root is <xsd:schema xmlns="http://www.x" targetNamespace="http://www.x" ... Later I see <xsd:element ref="X"/> and <xsd:element name="X& . . . Read full entry » Re: How to write a stream-oriented XSLT filter?Posted 3/26/2013 7:20:59 PMThere 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 "push-pull" conflict - the servlet expects to write (push) the ou . . . Read full entry » How to write a stream-oriented XSLT filter?Posted 3/26/2013 4:41:30 PMApologies in advance: this is not an XSLT-specific question, but I thought someone here might be able to help me anyway... 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 t . . . Read full entry » Re: What is the best solution?Posted 3/25/2013 8:49:01 PMWe need more information, like what XSLT version/processor are you using? Are you trying to do this in browsers? That sort of thing... <advocacy> 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 <tbody> an . . . Read full entry » What is the best solution?Posted 3/25/2013 2:12:47 PMI have a structure like the one below: <ns1:Event> <ns1:Name>Anders Jacobsen - Anders Bardal</ns1:Name> <ns1:MatchId>331782</ns1:MatchId> <ns1:ArrangementId>100000214</ns1:ArrangementId> <ns1:Arra . . . Read full entry » [Announce] Looming course cancellation - XSLT/XSL-FOPosted 3/25/2013 10:33:59 AMThe 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. The course outlines are linked at http://www.xml-finland. . . . Read full entry » [Ann] XMLSpectrum - Update to support reformatting ofPosted 3/25/2013 9:17:58 AMI'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 . . . Read full entry » Re: creating a temporary document from multiple inputsPosted 3/23/2013 4:07:53 PMReading the messages helps :-) <xsl:variable name="doc" as="element()*" select="document($paths)/*"/> 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. . . . Read full entry » Re: creating a temporary document from multiple inputsPosted 3/23/2013 3:59:52 PMHi David, I tried this, and the proposed <xsl:variable name="doc"> produces an error. <xsl:variable name="paths" as="item()*"> <xsl:sequence select = "($p1,$p2,$p3)" /> </xsl:variable> <xsl:variable name="doc" as=" . . . Read full entry » Re: creating a temporary document from multiple inputsPosted 3/23/2013 3:02:56 PMOn 23/03/2013 14:59, Wolfgang Laun wrote: Hi David, I tried this, and the proposed <xsl:variable name="doc"> produces an error. <xsl:variable name="paths" as="item()*"> <xsl:sequence select = "($p1,$p2,$p3)" /> </xsl:variable> <xsl . . . Read full entry » Re: creating a temporary document from multiple inputsPosted 3/23/2013 11:18:42 AMOn 09/03/2013 16:02, Wolfgang Laun wrote: 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): <xsl:variable name="doc" as="document-node()"> <xsl:document> <xsl:sequence select="doc . . . Read full entry » Re: Find the node name of the parent in the result trePosted 3/22/2013 9:26:36 PMOn 22/03/2013 21:14, Martin Holmes wrote: If I have a template matching an attribute, and producing one in the output tree, like this: <xsl:template match="@style"> <xsl:attribute name="style" select="."/> </xsl:template> Is there any wa . . . Read full entry » Re: Find the node name of the parent in the result trePosted 3/22/2013 5:23:19 PMAt 2013-03-22 14:14 -0700, Martin Holmes wrote: If I have a template matching an attribute, and producing one in the output tree, like this: <xsl:template match="@style"> <xsl:attribute name="style" select="."/> </xsl:template> The above . . . Read full entry » Re: Find the node name of the parent in the result trePosted 3/22/2013 4:27:28 PMOn Fri, Mar 22, 2013 at 2:14 PM, Martin Holmes <mholmes@xxxxxxx> wrote: > If I have a template matching an attribute, and producing one in the output > tree, like this: > > <xsl:template match="@style"> > <xsl:attribute name="style" select . . . Read full entry » Find the node name of the parent in the result tree?Posted 3/22/2013 2:14:33 PMIf I have a template matching an attribute, and producing one in the output tree, like this: <xsl:template match="@style"> <xsl:attribute name="style" select="."/> </xsl:template> Is there any way to know the name of the element in the r . . . Read full entry » Re: Modes - Necessary Construct or Syntactic SugarPosted 3/20/2013 9:01:17 AM> <xsl:template name="title"> > <xsl:param name="mode" select=" 'default' " as="xs:string" /> > <xsl:choose test="$mode eq 'index'> > . . . > </xsl:choose> : ) Liam will have meant xsl:when test (wrapped . . . Read full entry » Re: Modes - Necessary Construct or Syntactic SugarPosted 3/19/2013 9:58:19 PMOn Tue, 2013-03-19 at 08:58 +0000, Ihe Onwuka wrote: > 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. Yes, but not in he way you d . . . Read full entry » 3D XSLT - Experience and Feedback WelcomePosted 3/19/2013 12:41:55 PMHi, 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 . . . Read full entry » Re: 3D XSLT - Experience and Feedback WelcomePosted 3/19/2013 12:33:46 PMOn 19/03/2013 11:41, Eric Brichemier wrote: 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 . . . Read full entry » Re: 3D XSLT - Experience and Feedback WelcomePosted 3/19/2013 9:44:12 AMAt 2013-03-19 12:41 +0100, Eric Brichemier wrote: 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 mat . . . Read full entry » Re: Modes - Necessary Construct or Syntactic SugarPosted 3/19/2013 9:19:18 AMOn 19/03/2013 08:58, Ihe Onwuka wrote: 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 styleshee . . . Read full entry » Modes - Necessary Construct or Syntactic SugarPosted 3/19/2013 8:58:36 AMSuppose 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 "2nd mode" and app . . . Read full entry » WorldML FilterationPosted 3/18/2013 11:44:15 AMHi, I have got a good clue about formatting elements for worldML. In the similar effort we need to filter these elements. Comparison of "current output" and "desired output" is sufficient to understand the requirement. Input <w:r><w:rPr><w:i/><w:i-cs/>& . . . Read full entry » Re: WorldML FilterationPosted 3/18/2013 6:15:58 AMJoga, I try again. <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0" xmlns:w="so . . . Read full entry » Re: WorldML FilterationPosted 3/18/2013 6:10:02 AMJoga, Try this - it much more fun with groups and functions and it does work for the sample provided: Terry<?xml version="1.0" encoding="UTF-8"?> From: Joga Singh Rawat <jrawat@xxxxxxxxxxxxxx> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Sent: Monday, March 18, 2013 2:14 A . . . Read full entry » Re: Hierarchy to Flat StructurePosted 3/17/2013 11:14:17 AMAnd you will love this, the XSLT2 solution... worth considering, no? <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" /> &l . . . Read full entry » Re: Hierarchy to Flat StructurePosted 3/17/2013 11:10:39 AMHi Rick, As I said, I would use sibling recursion. Start at the first Category element and walk the following-sibling axis, like this <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transf . . . Read full entry » Re: Hierarchy to Flat StructurePosted 3/17/2013 11:03:15 AMaddendum A more general and safer template would likely be this <xsl:template match="Cases/Cases/*[not(self::Category)]"> <xsl:copy-of select="." /> </xsl:template> as a simple replacement for all the sibling templates then you don't need to a . . . Read full entry » Re: Hierarchy to Flat StructurePosted 3/17/2013 10:59:36 AMHi Rick, If you add a template for your root <xsl:template match="/Cases"> <xsl:apply-templates /> </xsl:template> you could simply do this <xsl:template match="*"> <xsl:copy-of select="." /> </xsl: . . . Read full entry » RE: Hierarchy to Flat StructurePosted 3/17/2013 8:02:12 AMHi 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. Than . . . Read full entry » Hierarchy to Flat StructurePosted 3/16/2013 9:57:33 PMI 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: <Cases> <Cases> <Category>Category One</Cate . . . Read full entry » wordml to xml (formatting) using loopPosted 3/15/2013 12:48:54 PMHi 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 <w:r> <w:rPr> <w:b/> <w:i/> <w:u/> </w:rPr> <w:t> . . . Read full entry » Re: wordml to xml (formatting) using loopPosted 3/15/2013 10:43:37 AMJoga, Id 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. See this ShareXML paste: http://www.sharexml.com:80/x/get?k=LLUgPpFyiAk1 . . . Read full entry » Re: How can one get the name of a template or functionPosted 3/13/2013 10:06:45 AMHi, 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 <pgfearo@xxxxxxxxxxxxxx> wrote: > A crude app . . . Read full entry » Re: How can one get the name of a template or functionPosted 3/12/2013 9:53:57 PMThis 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 . . . Read full entry » Re: How can one get the name of a template or functionPosted 3/12/2013 9:27:31 PMA 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 X . . . Read full entry » Re: Determining the type of items in a sequencePosted 3/12/2013 9:03:22 AMKen, Thanks! Indeed, the little voice in my head whispered "instance of", 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 <gkholman@xxxxxxxxxxxxxxxxxxxx> wrote: > At 2013- . . . Read full entry » Re: Determining the type of items in a sequencePosted 3/11/2013 6:40:08 PMActually, to ensure there is at least one node it would be: instance of node()+ . . . . . . Ken At 2013-03-11 18:36 -0400, I wrote: At 2013-03-11 18:31 -0400, Wendell Piez wrote: Could someone please remind me the most graceful way in XPath 2.0 of determining dynamically whether any arbitrary . . . Read full entry » Re: Determining the type of items in a sequencePosted 3/11/2013 6:36:21 PMAt 2013-03-11 18:31 -0400, Wendell Piez wrote: 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)? instance of node()* There's some furious parameterization going on . . . Read full entry » Determining the type of items in a sequencePosted 3/11/2013 6:31:15 PMFriends, 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 thi . . . Read full entry » XML and JSON browser performancePosted 3/9/2013 5:32:11 PMI 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 control . . . Read full entry » Re: creating a temporary document from multiple inputsPosted 3/9/2013 5:30:11 PMSee inline. On 09/03/2013, Graydon <graydon@xxxxxxxxx> wrote: > On Sat, Mar 09, 2013 at 05:02:19PM +0100, Wolfgang Laun scripsit: >> 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 c . . . Read full entry » creating a temporary document from multiple inputsPosted 3/9/2013 5:02:19 PMXSLT 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): <xsl:variable name="doc" as="document-node()"> <xsl:document> <xsl:sequence select="document($paths)/*"/> </xsl: . . . Read full entry » Re: creating a temporary document from multiple inputsPosted 3/9/2013 11:58:16 AMOn Sat, Mar 09, 2013 at 05:30:11PM +0100, Wolfgang Laun scripsit: > See inline. > On 09/03/2013, Graydon <graydon@xxxxxxxxx> wrote: > > On Sat, Mar 09, 2013 at 05:02:19PM +0100, Wolfgang Laun scripsit: [snip] > >> What surprised me was that I could use > >> < . . . Read full entry » Re: creating a temporary document from multiple inputsPosted 3/9/2013 11:23:06 AMOn Sat, Mar 09, 2013 at 05:02:19PM +0100, Wolfgang Laun scripsit: > 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): > > <xsl:variable name="doc" as="document-node()"> . . . Read full entry » Re: Re: Getting info of runtime failure in saxon enviPosted 3/6/2013 4:54:18 PMKarl, 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 recomm . . . Read full entry » Re: Getting info of runtime failure in saxon environmePosted 3/6/2013 6:13:21 AMHi 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: >are they really not "technical"? Not exactly. Mixed lot. But XML and its technology are new to them a . . . Read full entry » conflicting attribute specificationPosted 3/5/2013 3:41:36 PMI have just encountered a stylesheet <element url='bob'> <xsl:attribute name="url" select="'somethingotherthanbob'"> </element> which should take precedence? . . . Read full entry » Re: conflicting attribute specificationPosted 3/5/2013 10:44:34 AMAt 2013-03-05 15:41 +0000, Ihe Onwuka wrote: I have just encountered a stylesheet <element url='bob'> <xsl:attribute name="url" select="'somethingotherthanbob'"> </element> which should take precedence? The last <xsl:attribute> instruction to be execu . . . Read full entry » Re: Getting info of runtime failure in saxon environmePosted 3/2/2013 7:32:51 PMThanks to you all for the various answers and suggestions. Very useful. Thanks again. Regards. . . . Read full entry » Re: Re: Getting info of runtime failure in saxon enviPosted 3/2/2013 6:59:27 PMKarl, 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 pre . . . Read full entry » Re: Support for lookaround regexp in XSLT -- any timePosted 3/1/2013 11:43:47 PM> 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. > yeah, negative lookahead assertions can be really handy. <xsd:pattern value="\d"/> defines as a single digit, and shoul . . . Read full entry » Re: Complex XPath questionPosted 3/1/2013 11:17:50 PMOn 01/03/2013 23:08, dvint@xxxxxxxxx wrote: 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. not sure what you meant by > Is it possible in one XPath statement? in that case. <xsl:stylesheet version="2.0" xm . . . Read full entry » Re: Complex XPath questionPosted 3/1/2013 10:55:06 PMOn 01/03/2013 22:38, dvint@xxxxxxxxx wrote: I have the following XML: <wrapper> <object class="Page" package="com.atlassian.confluence.pages"> <id name="id">37716253</id> <property name="title"> <![CDATA[COMPARE]]> &l . . . Read full entry » Re: Support for lookaround regexp in XSLT -- any timePosted 3/1/2013 7:51:51 PMok 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 . . . Read full entry » Re: Complex XPath questionPosted 3/1/2013 7:09:10 PMOn Fri, 2013-03-01 at 14:38 -0800, dvint@xxxxxxxxx wrote: > I have the following XML: [...] > <object class="Page" package="com.atlassian.confluence.pages"> > <id name="id">37716253</id> > <property name="title"> > . . . Read full entry » Re: Support for lookaround regexp in XSLT -- any timePosted 3/1/2013 6:24:46 PMthx 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 unambiguous . . . Read full entry » Re: Support for lookaround regexp in XSLT -- any timePosted 3/1/2013 5:39:57 PMbut I would argue that perl6 https://github.com/perl6/specs/blob/master/S05-regex.pod does the best job at unambiguously defining ... That's supposed to be unambiguous? It's a fireside chat, full of "Oh, and here's something else I thought I might mention". Michael Kay Saxonica . . . Read full entry » Re: Complex XPath questionPosted 3/1/2013 3:08:23 PM> for $m in > max(//object[normalize-space(property[@name='title'])='COMPARE']/number(prope rty[@name='version'])) > return > //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, . . . Read full entry » Complex XPath questionPosted 3/1/2013 2:38:38 PMI have the following XML: <wrapper> <object class="Page" package="com.atlassian.confluence.pages"> <id name="id">37716253</id> <property name="title"> <![CDATA[COMPARE]]> </property> ... <property name=&quo . . . Read full entry » Re: Support for lookaround regexp in XSLT -- any timePosted 3/1/2013 12:02:38 PMOn 01.03.2013 11:40, Michael Kay wrote: (b) they wanted to exclude anything that didn't make sense in an international Unicode context (so things like word boundaries were immediately suspect) If they had been concerned about what is a word constituent and what is not in a certain language, they w . . . Read full entry » Re: Support for lookaround regexp in XSLT -- any timePosted 3/1/2013 11:33:04 AMOn 01/03/2013 11:02, Imsieke, Gerrit, le-tex wrote: On 01.03.2013 11:40, Michael Kay wrote: (b) they wanted to exclude anything that didn't make sense in an international Unicode context (so things like word boundaries were immediately suspect) If they had been concerned about what is a word cons . . . Read full entry » Re: Support for lookaround regexp in XSLT -- any timePosted 3/1/2013 10:40:33 AMunsure 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 "minimal& . . . Read full entry » Re: Support for lookaround regexp in XSLT -- any timePosted 3/1/2013 9:59:41 AMalternately, 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 (n . . . Read full entry » Re: Support for lookaround regexp in XSLT -- any timePosted 3/1/2013 3:11:36 AMThank 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 con . . . Read full entry » Re: Processing XML with multiple nested CDATA sectionsPosted 3/1/2013 12:04:56 AMOn 28/02/2013 23:47, dvint@xxxxxxxxx wrote: Some of these CDATA sections have CDATA sections in them. You can't nest CDATA sections. <![CDATA[a <![CDATA[b ]]> c ]]> is a fatal syntax error as the CDATA section ends at the first ]]> so the second ]]> is a syntax error. The seco . . . Read full entry » RE: How can one get the name of a template or functionPosted 2/28/2013 11:10:59 PMOn Thu, 2013-02-28 at 19:50 -0800, John Laurence Poole wrote: [...] > 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. [...] > Maybe I'm barking up the wrong tree an . . . Read full entry » Re: Support for lookaround regexp in XSLT -- any timePosted 2/28/2013 10:39:59 PMOn Fri, 2013-03-01 at 03:11 +0000, Manuel Souto Pico wrote: > Thank you, Liam. > > I will have a look at the W3C Bugzilla and will try to add a feature > 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 . . . Read full entry » RE: How can one get the name of a template or functionPosted 2/28/2013 7:50:42 PMI'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 . . . Read full entry » Re: Processing XML with multiple nested CDATA sectionsPosted 2/28/2013 7:11:02 PMOn Thu, 2013-02-28 at 15:47 -0800, dvint@xxxxxxxxx wrote: > [...] Some of > these CDATA sections have CDATA sections in them. Are you sure about that?... CDATA sections don't nest, which is why the "inner" one is terminated with "]] >" instead of"]]>". Wh . . . Read full entry » Re: Processing XML with multiple nested CDATA sectionsPosted 2/28/2013 6:59:50 PM-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 02/28/2013 06:47 PM, dvint@xxxxxxxxx wrote: > 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 > wrap . . . Read full entry » Re: Processing XML with multiple nested CDATA sectionsPosted 2/28/2013 4:59:24 PMAt 04:11 PM 2/28/2013, you wrote: CDATA sections don't nest, which is why the "inner" one is terminated with "]] >" instead of"]]>". What you actually have is, to use technical parlance, a mess.... Liam I hadn't caught that trick. Got to love people that make XM . . . Read full entry » Processing XML with multiple nested CDATA sectionsPosted 2/28/2013 3:47:43 PMI 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 . . . Read full entry » Re: repeatedly calling a template triggered by data wPosted 2/28/2013 10:14:04 AMThank you Michael! On 28/02/2013 02:21, Michael Kay wrote: Something like <xsl:for-each select="1 to string-length($alphabet)"> <xsl:call-template name="keyboard"> <xsl:with-param name="letter" select="substring($alphabet, ., 1)"/> p . . . Read full entry » Re: repeatedly calling a template triggered by data wPosted 2/28/2013 9:21:40 AMSomething like <xsl:for-each select="1 to string-length($alphabet)"> <xsl:call-template name="keyboard"> <xsl:with-param name="letter" select="substring($alphabet, ., 1)"/> perhaps? Or if you want groups of six, something along the l . . . Read full entry » Support for lookaround regexp in XSLT -- any time soonPosted 2/28/2013 12:20:55 AMHi 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 que . . . Read full entry » |
PURCHASE STYLUS STUDIO ONLINE TODAY!!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! What's New for X14?New XQuery & Web Services Tools, Support for MySQL, PostgreSQL, HL7 EDI, Microsoft .NET Code Generation and much more! Why Pay More for XML Tools?With Stylus Studio® X14 XML Enterprise Suite, you get the most comprehensive XML tool suite at one incredibly low price. Value: it's just one of many reasons why smart XML developers are choosing Stylus Studio! |

Cart





