Subscribe to the XSL-List Blog in XML format
RSS 2.0
Atom 0.3

The XSL-LIST Blog

The 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: How to dynamically evaluate an equation in the inp

Posted 7/16/2021 12:50:35 AM

You could also express or transform the expression into Content MathML and use a processor for that? https://www.w3.org/TR/MathML3/chapter4.html On Thu, Jul 15, 2021 at 8:43 AM Dimitre Novatchev dnovatchev@xxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > > You can short-c . . . Read full entry »


Re: How to dynamically evaluate an equation in the inp

Posted 7/15/2021 3:43:21 PM

> You can short-circuit the process by generating the lexical analyser and syntax analyser directly from a BNF specification > using a parser generator; a popular choice in this community is Rex from Gunther Rademacher > (though this does an excellent job, it suffers from (a) not being pub . . . Read full entry »


Re: How to dynamically evaluate an equation in the inp

Posted 7/15/2021 3:28:39 PM

> I have XML documents like this: > > <Convert-to-Celsius> > <equation>(Fahrenheit - 32) * (5/9)</equation> > <variable> > <name>Fahrenheit</name> > <value>32</value> > </variable> > </Convert . . . Read full entry »


Re: How to dynamically evaluate an equation in the inp

Posted 7/15/2021 3:10:08 PM

> Have you done this kind of dynamic equation solving using XSLT? If so, how did you do it? What is described is not "equation solving", it is just evaluation of a function for a certain value of a variable. Solving an equation requires to have an equation in the first place. That is . . . Read full entry »


Re: How to dynamically evaluate an equation in the inp

Posted 7/15/2021 7:11:17 AM

On Wed, 2021-07-14 at 18:49 +0000, Roger L Costello costello@xxxxxxxxx wrote: > Hi Folks, > > I have XML documents like this: > > <Convert-to-Celsius> > B B B <equation>(Fahrenheit - 32) * (5/9)</equation> > B B B <variable> > B B B B B B B <n . . . Read full entry »


Re: How to dynamically evaluate an equation in the inp

Posted 7/15/2021 6:04:49 AM

On Thu, Jul 15, 2021 at 12:18 AM Roger L Costello costello@xxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > I have XML documents like this: > > <Convert-to-Celsius> > <equation>(Fahrenheit - 32) * (5/9)</equation> > <variable> > . . . Read full entry »


Re: How to dynamically evaluate an equation in the inp

Posted 7/15/2021 5:14:30 AM

Hi Roger Le 14/07/2021 C 20:48, Roger L Costello costello@xxxxxxxxx a C)critB : Have you done this kind of dynamic equation solving using XSLT? If so, how did you do it? Computer Algebra System like maxima (https://maxima.sourceforge.io/) have powerful representation of symbolic equations allowi . . . Read full entry »


Re: How to dynamically evaluate an equation in the inp

Posted 7/14/2021 8:04:07 PM

Hi Roger, > The document contains an equation which might contain variables. If it does contain variables, then I need to fetch their values and replace the variables in the equation with their values and then compute the value of the equation. > > Have you done this kind of dynamic equ . . . Read full entry »


Re: How to dynamically evaluate an equation in the inp

Posted 7/14/2021 6:57:37 PM

On 14.07.2021 20:48, Roger L Costello costello@xxxxxxxxx wrote: <Convert-to-Celsius> <equation>(Fahrenheit - 32) * (5/9)</equation> <variable> <name>Fahrenheit</name> <value>32</value> </variable> </Convert-to . . . Read full entry »


How to dynamically evaluate an equation in the input X

Posted 7/14/2021 6:48:18 PM

Hi Folks, I have XML documents like this: <Convert-to-Celsius> <equation>(Fahrenheit - 32) * (5/9)</equation> <variable> <name>Fahrenheit</name> <value>32</value> </variable> </Convert-to-Celsius> The documen . . . Read full entry »


Re: Got an XSLT function that does value intersection

Posted 7/12/2021 6:40:22 AM

On Sun, Jul 11, 2021 at 10:47 PM Michael Kay mike@xxxxxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: Yes, but doing N-squared deep-equal comparisons doesn't scale very well. > I thought that, the problem was not a grouping problem. And I wanted to present an algorithm, that c . . . Read full entry »


Re: Got an XSLT function that does value intersection

Posted 7/11/2021 5:17:33 PM

> The following XSLT stylesheet, also seems to work, Yes, but doing N-squared deep-equal comparisons doesn't scale very well. Michael Kay Saxonica > > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform <http://www.w3.org/1999/XSL/Transform>" > . . . Read full entry »


Re: Got an XSLT function that does value intersection

Posted 7/11/2021 4:28:51 AM

On Thu, Jul 8, 2021 at 6:50 PM Roger L Costello costello@xxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > I have an XML document that consists of <row> elements: > > <Document> > <row> > <x>1</x> > <y>2< . . . Read full entry »


XQuery alternative ⁓ map | XSLT 2.0 || 3.0

Posted 7/10/2021 1:17:19 PM

B B B B Stage four execution: let $m := c:mM($c) let $h := c:style($t, $c) => c:hM() return let $b := <b> B B B <m>{ $m - $h }</m> B B B <h>{ $h - $m }</h> B B B <e> B B B B B B B { B B B B B B B B let $e := <e>{ $m + $h }</e> B B B B B B B . . . Read full entry »


Re: Do you use Knuth's algorithms book to solve XML p

Posted 7/9/2021 4:15:44 PM

> For example, recently I wrote an XSLT program to output information about each element (name, type, minOccurs, maxOccurs, facets) in all the files of an XML Schema. My program had to take into consideration complexTypes with complexContent, complexTypes with simpleContent, complexTypes with se . . . Read full entry »


Re: Do you use Knuth's algorithms book to solve XML p

Posted 7/9/2021 4:05:19 PM

Roger, You can't do engineering without mathematics (in some form) -- but that doesn't mean they are the same thing. Cheers, Wendell On Fri, Jul 9, 2021 at 3:09 PM Roger L Costello costello@xxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > Hi Folks, > > As you know, D . . . Read full entry »


Re: Do you use Knuth's algorithms book to solve XML p

Posted 7/9/2021 3:14:57 PM

It took me a long time to wrap my head around programming in XSL. In my opinion, it was very similar to programming in oldB school lisp. I have used Knutebs book for solving problems. I think what you end up having to do is understand his algorithm and then it HasB to be recast in your language of . . . Read full entry »


Do you use Knuth's algorithms book to solve XML proce

Posted 7/9/2021 3:08:53 PM

Hi Folks, As you know, Donald Knuth has written a bunch of books that describe algorithms for solving just about every conceivable problem. I've always dreamed of, one day, getting a problem to solve, looking up the appropriate algorithm in one of Knuth's books, and then expressing the algorithm . . . Read full entry »


Re: Got an XSLT function that does value intersection

Posted 7/9/2021 1:57:12 PM

> On 9 Jul 2021, at 14:03, Roger L Costello costello@xxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > > Michael Kay wrote: > >> In this situation, you can use grouping: >> >> <xsl:for-each-group select="row" group-by="x, y" comp . . . Read full entry »


Here’s how to eliminate duplicate elements using XSLT

Posted 7/9/2021 1:56:31 PM

Hi Folks, [This is a summary of yesterday's discussion, for the archives.] I have an XML document that consists of <row> elements: <Document> <row> <x>1</x> <y>2</y> </row> <row> <x>3</x> . . . Read full entry »


Re: Got an XSLT function that does value intersection

Posted 7/9/2021 1:02:57 PM

Michael Kay wrote: > In this situation, you can use grouping: > > <xsl:for-each-group select="row" group-by="x, y" composite="yes"> > <xsl:sequence select="current-group()[1]"/> > </xsl:for-each> That is a beautiful solu . . . Read full entry »


Re: Got an XSLT function that does value intersection

Posted 7/8/2021 1:31:30 PM

In this situation, you can use grouping: <xsl:for-each-group select="row" group-by="x, y" composite="yes"> <xsl:sequence select="current-group()[1]"/> </xsl:for-each> If your comparison operation is more complex (e.g., deep-equal()) then . . . Read full entry »


Re: Got an XSLT function that does value intersection

Posted 7/8/2021 1:30:13 PM

Am 08.07.2021 um 15:19 schrieb Roger L Costello costello@xxxxxxxxx: Hi Folks, I have an XML document that consists of <row> elements: <Document> <row> <x>1</x> <y>2</y> </row> <row> <x>3</x> . . . Read full entry »


Got an XSLT function that does value intersection (not

Posted 7/8/2021 1:19:41 PM

Hi Folks, I have an XML document that consists of <row> elements: <Document> <row> <x>1</x> <y>2</y> </row> <row> <x>3</x> <y>4</y> </row> <row> < . . . Read full entry »


Reminder: Declarative Amsterdam 2021, Call for Presen

Posted 7/8/2021 1:01:13 PM

On 4 and 5 November 2021, the third Declarative Amsterdam conference will take place at CWI, Science Park, Amsterdam. The conference focuses on the technologies and methods used for declarative programming and declarative data. Declarative programming (https://en.wikipedia.org/wiki/Declarati . . . Read full entry »


[ANN] Balisage Dress Rehearsals (Saturday 31 July & S

Posted 7/7/2021 9:09:16 PM

Considering "Balisage: The Markup Conference?" Unsure about the conference portal? Wish for just a bit more Markup talk? Balisage Dress Rehearsals are open to all Balisage attendees! Balisage 2021 Dress Rehearsals Balisage will use the Whova Conference Portal, which is unfamiliar to so . . . Read full entry »


XSL-List Guidelines

Posted 7/1/2021 3:38:30 PM

This 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: Re: fn:contains in sequence – P2 | XSLT 2.0

Posted 6/24/2021 5:10:34 PM

Superb is as Superb does !!! On Thursday, June 24, 2021, 12:31:21 p.m. EDT, Martin Honnen martin.honnen@xxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: I think you want to put your variable's selection directly as the second argument expression in the contains call or rather jus . . . Read full entry »


Re: Re: fn:contains in sequence – P2 | XSLT 2.0

Posted 6/24/2021 4:31:20 PM

Am 24.06.2021 um 18:20 schrieb Fiona Chen anonymousjuly1@xxxxxxxx: > Hi, Martin: > B B B I understand what the error means. > > B B B B If I run that module in Oxygen, I get: > > <?xml version="1.0" encoding="UTF-8"?> > <SVM xmlns="schema://fc . . . Read full entry »


Re: fn:contains in sequence – P2 | XSLT 2.0

Posted 6/24/2021 4:19:47 PM

Hi, Martin:B B B B B B B I understand what the error means. B B B B If I run that module in Oxygen, I get: <?xml version="1.0"encoding="UTF-8"?> <SVM xmlns="schema://fc.fasset/svm"><!-- June 23rd, 202122:18:41 --> B B <Negative><!--Negati . . . Read full entry »


Re: fn:contains in sequence – P2 | XSLT 2.0

Posted 6/24/2021 3:53:23 PM

Am 24.06.2021 um 16:47 schrieb Fiona Chen anonymousjuly1@xxxxxxxx: > B B B B However, I am not able to transform the report in XSLT 2.0 > equivalent without MarkLogic cts. > > <xsl:template match="SVM"> > <xsl:variable name="classVal" select="class[/ . . . Read full entry »


fn:contains in sequence – P2 | XSLT 2.0

Posted 6/24/2021 2:47:35 PM

B B B B However, I am not able to transform thereport in XSLT 2.0 equivalent without MarkLogic cts. B B B B <xsl:templatematch="SVM"> B B B B B B B <xsl:variable name="classVal"select="class[xs:decimal(@val) gt 0.00]"/> B B B B B B B <xsl:elem . . . Read full entry »


fn:contains in sequence – P1 | XSLT 2.0

Posted 6/24/2021 2:36:14 PM

I am developing a classification application. As the result of theStage one module, the trained classifier will classify the documents as below: <SVM xmlns="schema://fc.fasset/svm"> B B B <classification> B B B B B B B <serial>1</serial> B B B B B B B <docI . . . Read full entry »


Re: Is XPath and/or XSLT designed such that I should

Posted 6/23/2021 8:13:09 AM

> I don't think that, using an "if" (xsl:if / xsl:choose in XSLT, "if" in XPath) control flow mechanism in the code (and equally well in XSLT) is always a bad idea. It's an integral programming tool to solve problems. To have code look nicer, may be we can encapsulate the &qu . . . Read full entry »


Re: Is XPath and/or XSLT designed such that I should

Posted 6/23/2021 4:27:33 AM

On Tue, 2021-06-22 at 19:51 +0000, Dimitre Novatchev dnovatchev@xxxxxxxxx wrote: > > > Example: finding all (X)Html elements that have class $myClass: > > B B B B B //*[contains(concat(' ', @class, ' '), concat(' ', $myClass, ' > ')] > Expressions like this, which work in . . . Read full entry »


Re: Is XPath and/or XSLT designed such that I should

Posted 6/23/2021 3:49:29 AM

On Tue, Jun 22, 2021 at 10:34 PM Roger L Costello costello@xxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > <xsl:if test="empty(Cell[2]/Data)"> do something </xsl:if> > > Bad, bad, bad. > > > Question #1: is XPath and/or XSLT designed s . . . Read full entry »


Re: Is XPath and/or XSLT designed such that I should

Posted 6/22/2021 7:50:09 PM

> Question #1: is XPath and/or XSLT designed such that I should never have to write special case code? > > Question #2: If I find myself writing special case code, should I stop and say, "How can I modify this XPath and/or XSLT so that I do not have to write special case code? Remind . . . Read full entry »


Re: Is XPath and/or XSLT designed such that I should

Posted 6/22/2021 6:36:05 PM

If I understand what you mean by bspecial case codeb I think you really mean bhandling edge cases in a one-off or clunky kind of wayb. With XSLT, if you take the general approach of doing as much as possible with templates then handling special cases is usually a matter of having templates t . . . Read full entry »


Is XPath and/or XSLT designed such that I should never

Posted 6/22/2021 5:03:43 PM

Hi Folks, I think special case code is evil. To explain what I mean by "special case code" let's take its opposite: code selects what is desired under any condition. So, by "special case code" I mean extra code that is written for dealing with special conditions. Last week I . . . Read full entry »


Re: An XPath expression that avoids writing special ca

Posted 6/22/2021 1:59:07 PM

Hey again, Better: <xsl:sequence select="$document/Row[Cell[1]/Data = $element][not(Cell[2]/Data != $parent)]" /> Cheers, Wendell On Tue, Jun 22, 2021 at 9:42 AM Wendell Piez <wapiez@xxxxxxxxxxxxxxx> wrote: > Roger, > > Okay, so the requirement is that if Data[2] . . . Read full entry »


Re: An XPath expression that avoids writing special ca

Posted 6/22/2021 1:42:55 PM

Roger, Okay, so the requirement is that if Data[2] is present, it must correspond with the second argument. It may not be the same (if it is not there at all) but it must not be different. <xsl:function name="f:getRow"> <xsl:param name="element"/> <xsl:p . . . Read full entry »


Re: user-defined XSLT functions and stylesheet variabl

Posted 6/20/2021 7:18:17 PM

On Sun, Jun 20, 2021 at 04:42:39PM -0000, Michael Kay mike@xxxxxxxxxxxx scripsit: > I have occasionally wondered whether the ban on using tunnel parameters inside a function is perhaps rather paternalistic. In many ways, accessing tunnel parameters is "less evil" than accessing global . . . Read full entry »


Re: user-defined XSLT functions and stylesheet variabl

Posted 6/20/2021 5:48:28 PM

> On 20 Jun 2021, at 18:35, Jeremy Cronk jcronk@xxxxxxxxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > > Forgive my ignorance on this, but why is there a global context item in the first place? Ibve never seen it do anything but cause trouble, but on the other hand, . . . Read full entry »


Re: user-defined XSLT functions and stylesheet variabl

Posted 6/20/2021 5:35:40 PM

Forgive my ignorance on this, but why is there a global context item in the first place? Ive never seen it do anything but cause trouble, but on the other hand, Ive never seen it actually being used except by global variables. Jeremy From: Michael Kay mike@xxxxxxxxxxxx <xsl-list-service@xx . . . Read full entry »


Re: user-defined XSLT functions and stylesheet variabl

Posted 6/20/2021 5:12:58 PM

>> I have occasionally wondered whether the ban on using tunnel >> parameters inside a function is perhaps rather paternalistic. > > I think so - you can presumably have a template wrapper whose only > purpose is to return a tunel parameter, and call it from within the > f . . . Read full entry »


Re: user-defined XSLT functions and stylesheet variabl

Posted 6/20/2021 5:05:35 PM

On Sun, 2021-06-20 at 16:43 +0000, Michael Kay mike@xxxxxxxxxxxx wrote: > > > > A non-streamable function fn:input-document() might be a win! > > > > Liam > > > > It would have the same effect: code using this function could not be > easily converted to be . . . Read full entry »


Re: user-defined XSLT functions and stylesheet variabl

Posted 6/20/2021 4:42:33 PM

> A non-streamable function fn:input-document() might be a win! > > Liam > It would have the same effect: code using this function could not be easily converted to be part of a stylesheet that processes a collection of documents. I have occasionally wondered whether the ban on using t . . . Read full entry »


Re: user-defined XSLT functions and stylesheet variabl

Posted 6/20/2021 4:12:25 PM

On Sun, 2021-06-20 at 08:01 +0000, Michael Kay mike@xxxxxxxxxxxx wrote: > > > > But i agree there are cases where it makes sense.B B Sometimes i > > write, > > B <xsl:variable name="input" select="/" /> > > for example, > > Yep, we a . . . Read full entry »


Re: user-defined XSLT functions and stylesheet variabl

Posted 6/20/2021 2:55:54 PM

I think the use case here is not really a support for global variables but for appropriately-managed global configuration. I think thatbs a special case separate from a more general (ill-advised) use of global variables. That suggests that Mike Kaybs assertion that a global variable is just an . . . Read full entry »


Re: user-defined XSLT functions and stylesheet variabl

Posted 6/20/2021 8:01:01 AM

> But i agree there are cases where it makes sense. Sometimes i write, > <xsl:variable name="input" select="/" /> > for example, Yep, we all do that, and it's very handy, but it also has a devastating impact: it severely restricts your abiliity to reuse your c . . . Read full entry »


Re: user-defined XSLT functions and stylesheet variabl

Posted 6/20/2021 7:52:17 AM

But a lot of that stuff is assuming procedural languages, where global variables are mutable. An immutable global variable is essentially equivalent to a zero-arity function. With XSLT, the only real difference between a global variable and a zero-arity function is that a global variable has access . . . Read full entry »


Re: user-defined XSLT functions and stylesheet variabl

Posted 6/20/2021 3:25:07 AM

On Sun, 2021-06-20 at 00:35 +0000, Graydon graydon@xxxxxxxxx wrote: > > I think this is one of those places where the imperative best > practise > and the declarative best practise aren't perfectly congruent. For sure things are changed, but recall that global variables in XSLT can b . . . Read full entry »


Re: user-defined XSLT functions and stylesheet variabl

Posted 6/20/2021 12:35:06 AM

On Sun, Jun 20, 2021 at 12:11:50AM -0000, Christophe Marchand cmarchand@xxxxxxxxxx scripsit: > All the responses given by Eliot and Liam respect Clean Code[1] best > practises. Many principles must be respected if you expect your code may > evolve : I think this is one of those places whe . . . Read full entry »


Re: user-defined XSLT functions and stylesheet variabl

Posted 6/20/2021 12:11:42 AM

All the responses given by Eliot and Liam respect Clean Code[1] best practises. Many principles must be respected if you expect your code may evolve : * DRY : Don't Repeat Yourself ; sometime in opposition with Single Responsability principle * YAGNI : You Ain't Gonna Need It * SOLID, . . . Read full entry »


Re: constructing arrays in XSLT with templates

Posted 6/19/2021 1:49:58 PM

I like the binding via the *for $book in books/book* expression .. it makes the entire mapping block more readable. Thanks again, very helpful. -alan On Sat, Jun 19, 2021 at 12:47 PM Martin Honnen martin.honnen@xxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > > Am 19.06 . . . Read full entry »


Re: constructing arrays in XSLT with templates

Posted 6/19/2021 10:47:31 AM

Am 19.06.2021 um 12:37 schrieb Martin Honnen martin.honnen@xxxxxx: > > Or you would need to use a for expression to bind a "book" e.g. > > > B B map { > B B B 'books' : array { > B B B B for $book in books/book return map:merge(( > B B B B B map:entry . . . Read full entry »


Re: constructing arrays in XSLT with templates

Posted 6/19/2021 10:37:05 AM

Am 19.06.2021 um 12:30 schrieb Alan Painter alan.painter@xxxxxxxxx: > *map:entry('out-of-print', true())[current()/@out-of-print eq 'true']* *I think you would need to write e.g.* *B if (@out-of-print eq 'true') then map:entry('out-of-print', true()) else ()* * * Or you would need to use a . . . Read full entry »


Re: constructing arrays in XSLT with templates

Posted 6/19/2021 10:30:15 AM

That looks very good. I'm able to get your recommendation to work: <books> <book> <title>The C Programming Language</title> <author>Brian Kernighan</author> <author>Dennis Ritchie</author> </book> <book out-of-print=" . . . Read full entry »


Re: user-defined XSLT functions and stylesheet variabl

Posted 6/19/2021 9:43:08 AM

David, My general principle in writing a function has been to avoid any global parameters/variables to begin with. When it needs one or two more options, I supply ++-arity variants. But at some point, one might face the problem of function constants that must be either set in stone, or bound t . . . Read full entry »


Re: constructing arrays in XSLT with templates

Posted 6/19/2021 9:25:39 AM

Am 19.06.2021 um 10:54 schrieb Alan Painter alan.painter@xxxxxxxxx: But I'm wondering what the equivalent would be for conditional map entries. Supposing that there is an additional optional attribute on the 'book' element of the original xml, 'out-of-print="true"'. Furthermore, let's say . . . Read full entry »


Re: constructing arrays in XSLT with templates

Posted 6/19/2021 8:54:04 AM

Martin, I'm liking your xpath example more and more, especially for people who like in-line parsing (for instance, folks who prefer XQuery over XPath). But I'm wondering what the equivalent would be for conditional map entries. Supposing that there is an additional optional attribute on the 'bo . . . Read full entry »


Re: user-defined XSLT functions and stylesheet variabl

Posted 6/19/2021 1:26:20 AM

> Is there agreement about Best Practice with respect to using stylesheet (global) variables inside user-defined functions? Not if one wants to have reusable functions -- many of them, in useful libraries that you can use again and again and that you can share with everyone. Best of all, defi . . . Read full entry »


Re: constructing arrays in XSLT with templates

Posted 6/18/2021 9:46:29 PM

Unfortunately this is a significant gap in XSLT 3.0 functionality. The explanation for the gap is that the WG was reluctant to make XSLT 3.0 dependent on XPath 3.1 as distinct from XPath 3.0, and arrays only came with 3.1. There are workarounds, of course, but they aren't particularly nice. Mich . . . Read full entry »


Re: user-defined XSLT functions and stylesheet variabl

Posted 6/18/2021 9:42:57 PM

First, I'd suggest that it's bad practice to have global variables whose value depends on the global context item. If you have such variables, it makes it much harder to reuse the code, e.g. as part of a pipeline. (If you want, you can use the xsl:global-context-item declaration to enforce this.) . . . Read full entry »


Re: constructing arrays in XSLT with templates

Posted 6/18/2021 7:07:35 PM

I agree that this case is so simple that you don't need to use xsl:apply-templates at all and can either in-line all of the xpath expressions or can convert the templates to functions. I do like breaking things up into templates so was hoping that I was just missing something and that there was a . . . Read full entry »


Re: constructing arrays in XSLT with templates

Posted 6/18/2021 6:54:34 PM

On Fri, 2021-06-18 at 18:41 +0000, Alan Painter alan.painter@xxxxxxxxx wrote: > > > Is there a more elegant way of doing this? I don't think so; you could construct maps with integer keys and then convert them, but i don't think that's remotely elegant. -- Liam Quin,B https://www.deli . . . Read full entry »


Re: constructing arrays in XSLT with templates

Posted 6/18/2021 6:50:03 PM

On 18.06.2021 20:45, Martin Honnen martin.honnen@xxxxxx wrote: Of course for the limited sample you could be tempted to inline anything as an XPath 3.1 expression. Like this: <xsl:template match="/"> <xsl:sequence select="map { 'books' : array { . . . Read full entry »


Re: constructing arrays in XSLT with templates

Posted 6/18/2021 6:44:46 PM

On 18.06.2021 20:40, Alan Painter alan.painter@xxxxxxxxx wrote: Hi fellow XSLT enthusiasts, I've been constructingB json in XSLT using xsl:map and xsl:map-entry and the resulting code looks really nice.B But I'm a bit stuck with arrays and was hoping for some enlightenment. Within the template f . . . Read full entry »


constructing arrays in XSLT with templates

Posted 6/18/2021 6:40:09 PM

Hi fellow XSLT enthusiasts, I've been constructing json in XSLT using xsl:map and xsl:map-entry and the resulting code looks really nice. But I'm a bit stuck with arrays and was hoping for some enlightenment. Taking as input example: <books> <book> <title>The C Programmi . . . Read full entry »


Re: user-defined XSLT functions and stylesheet variabl

Posted 6/18/2021 6:21:29 PM

If I was given a style sheet with a function that used a global variable I would immediately rewrite the function to take that variable as a parameter. Cheers, E. -- Eliot Kimber http://contrext.com From: "Liam R. E. Quin liam@xxxxxxxxxxxxxxxx" <xsl-list-service@xx . . . Read full entry »


Re: user-defined XSLT functions and stylesheet variabl

Posted 6/18/2021 5:56:15 PM

On Fri, 2021-06-18 at 17:42 +0000, David Birnbaum djbpitt@xxxxxxxxx wrote: > Dear XSLT-list, > > Is there agreement about Best Practice with respect to using > stylesheet > (global) variables inside user-defined functions? Tommie once gave a talk about best practice considered hamr . . . Read full entry »


user-defined XSLT functions and stylesheet variables?

Posted 6/18/2021 5:41:31 PM

Dear XSLT-list, Is there agreement about Best Practice with respect to using stylesheet (global) variables inside user-defined functions? If I want to be able to reuse my function in different contexts, passing in everything the function needs as an explicit parameter ensures that it won't have e . . . Read full entry »


Re: An XPath expression that avoids writing special c

Posted 6/18/2021 4:23:43 PM

Wendell wrote: > In the first case, the step 'string(Data)', in the absence of a Data node, > will return '', since string(()) (a string value of nothing) is an empty string, > i.e. a sequence of one member, (''). > In the second case, the failure of the path to reach any node at Data . . . Read full entry »


Re: An XPath expression that avoids writing special c

Posted 6/18/2021 4:02:12 PM

Roger, You ask > Question: Below are two XPath expressions. The first is the one that Mukul recommended and it returns the desired row. The second is the one that I created and it fails. The only difference between the two XPath expressions is string(Data) versus Data. Why does the former work . . . Read full entry »


Re: An XPath expression that avoids writing special c

Posted 6/18/2021 1:31:15 PM

Hi Mukul, I tried your suggestion. For this XML document: <Document> <Row> <Cell> <Data>aviation</Data> </Cell> <Cell/> </Row> </Document> I evaluated the following XPath expression in Oxygen XML: . . . Read full entry »


Re: An XPath expression that avoids writing special c

Posted 6/18/2021 1:12:35 PM

Am 18.06.2021 um 14:35 schrieb Roger L Costello costello@xxxxxxxxx: I tried your suggestion. For this XML document: <Document> <Row> <Cell> <Data>aviation</Data> </Cell> <Cell/> </Row> < . . . Read full entry »


Re: An XPath expression that avoids writing special ca

Posted 6/18/2021 12:57:39 PM

Hi Wendell, My XML document may have an element named navaid with a parent element named airport and it may have an element named navaid with a parent element named enrouteAirway, like this: <Document> B B ... B B <Row> B B B B <Cell> B B B B B B <Data>navaid . . . Read full entry »


Re: An XPath expression that avoids writing special ca

Posted 6/18/2021 12:44:58 PM

Roger, I am fairly puzzled, not by the problem as posed, but whether it is really the problem. Surely, if you had <xsl:function name="f:getRow"> <xsl:param name="element"/> <xsl:sequence select="$document/Row[Cell[1]/Data eq $element]" /> & . . . Read full entry »


Re: An XPath expression that avoids writing special c

Posted 6/18/2021 12:35:35 PM

Hi Martin, I tried your suggestion. For this XML document: <Document> <Row> <Cell> <Data>aviation</Data> </Cell> <Cell/> </Row> </Document> I used Oxygen XML to evaluate this XPath expression on the . . . Read full entry »


Re: An XPath expression that avoids writing special ca

Posted 6/18/2021 7:27:52 AM

On Thu, Jun 17, 2021 at 7:36 PM Roger L Costello costello@xxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > My XML document contains a bunch of <Row> elements, like so: > > <Document> > ... > <Row> > <Cell> > . . . Read full entry »


Re: An XPath expression that avoids writing special ca

Posted 6/18/2021 5:33:53 AM

Hi Martin, I really like your solution. Short, elegant, and to the point. The empty element is part of every set. Changing a single character. A piece of beauty & smarts. Thank you. Cheers, ac Le jeu. 17 juin 2021 C 10:16, Michael Kay mike@xxxxxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxx . . . Read full entry »


Re: An XPath expression that avoids writing special ca

Posted 6/17/2021 2:16:14 PM

This is a case for pipelines. First run a transformation that turns your document into something that better represents thet semantics, like <airports> <airport>LHR</airport> <airport>LAX</airport> </airports> and then do your actual query against this docu . . . Read full entry »


Re: An XPath expression that avoids writing special ca

Posted 6/17/2021 2:15:22 PM

Am 17.06.2021 um 16:06 schrieb Roger L Costello costello@xxxxxxxxx: <xsl:sequence select="$document/Row[Cell[1]/Data eq $element][Cell[2]/Data eq $parent]" /> I think using = helps: <xsl:sequence select="$document/Row[Cell[1]/Data eq $element][Cell[2]/Data = $parent]" . . . Read full entry »


An XPath expression that avoids writing special case

Posted 6/17/2021 2:06:03 PM

Hi Folks, My XML document contains a bunch of <Row> elements, like so: <Document> ... <Row> <Cell> <Data>airport</Data> </Cell> <Cell> <Data>airports</Data> </Cell> . . . Read full entry »


[ANN] Balisage Program Adds Late-breaking News

Posted 6/16/2021 3:04:37 PM

The Balisage 2021 program has grown! Late-breaking News Pre-conference Sessions Sponsor Presentations See details at: https://www.balisage.net/2021/Program.html <https://www.balisage.net/2021/Program.html> Register at: https://www.balisage.net/registration.html <https://www.balisage.net/re . . . Read full entry »


Re: We need to kick someone out of the group

Posted 6/15/2021 9:27:28 PM

Thanks Mukul! I will give that a try. Best, Charles From: Mukul Gandhi mukulg@xxxxxxxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Sent: Tuesday, June 15, 2021 12:33 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: We need to kick someone out of the group *** External email: us . . . Read full entry »


Re: We need to kick someone out of the group

Posted 6/15/2021 4:32:32 AM

On Fri, Jun 11, 2021 at 5:56 PM Charles O'Connor coconnor@xxxxxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > Using XSLT 2.0, I have the input XML: > > <contrib-group> > <contrib><name>Bob</name><xref rid="aff1"/>& . . . Read full entry »


Re: We need to kick someone out of the group

Posted 6/11/2021 9:04:04 PM

Thanks Wendell! I'll give that a try, and I'll be brewing a triple-decoction mash pilsner this winter when I can fill my lagering cave (OK, it's a bulkhead) with snow. Best, Charles From: Wendell Piez wapiez@xxxxxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Sent: Friday, June 11, 2 . . . Read full entry »


Re: We need to kick someone out of the group

Posted 6/11/2021 6:06:10 PM

Hey Charles, If the data is as I guessed, instead of grouping you could use keys to assemble the data into the structure you want. Inside the contrib-group in the result, pull the wanted affiliations into the contrib-group using an appropriate key to grab and copy them. And when they are matched . . . Read full entry »


Re: We need to kick someone out of the group

Posted 6/11/2021 1:37:20 PM

Oh, I missed that. Apologies and thanks! -----Original Message----- From: Martin Honnen martin.honnen@xxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Sent: Friday, June 11, 2021 9:35 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: We need to kick someone out of the group *** External . . . Read full entry »


Re: We need to kick someone out of the group

Posted 6/11/2021 1:34:29 PM

Am 11.06.2021 um 15:32 schrieb Charles O'Connor coconnor@xxxxxxxxxxxx: Alas, I cannot use Martinbs solution, as I am limited to XSLT 2.0. The only XSLT 3 in there was the use of the XPath 3 tail function use but the answer also stated that tail(current-group()) is subsequence(current-group(), 2 . . . Read full entry »


Re: We need to kick someone out of the group

Posted 6/11/2021 1:31:43 PM

Alas, I cannot use Martinbs solution, as I am limited to XSLT 2.0. Wendell, Sorry. When I simplified the input for the question, I forgot the "aff" in the @id <aff>. It should indeed match the @rid in the <xref>. I will have to bone up on keys. As for beer, clean beers like . . . Read full entry »


Re: We need to kick someone out of the group

Posted 6/11/2021 12:42:12 PM

Charles, Your stated input has: <contrib-group> <contrib><name>Bob</name><xref rid="aff1"/></contrib> <contrib><name>Judy</name><xref rid="aff2"/></contrib> </contrib-group> <aff . . . Read full entry »


Re: We need to kick someone out of the group

Posted 6/11/2021 12:35:03 PM

Am 11.06.2021 um 14:26 schrieb Charles O'Connor coconnor@xxxxxxxxxxxx: Hi all, Sometimes I am baffled about how to approach something. Sometimes I'm baffled by why something doesn't work. Using XSLT 2.0, I have the input XML: <contrib-group> <contrib><name>Bob</ . . . Read full entry »


We need to kick someone out of the group

Posted 6/11/2021 12:26:26 PM

Hi all, Sometimes I am baffled about how to approach something. Sometimes I'm baffled by why something doesn't work. Using XSLT 2.0, I have the input XML: <contrib-group> <contrib><name>Bob</name><xref rid="aff1"/></contrib> <c . . . Read full entry »


Re: Removing unwanted space

Posted 6/7/2021 2:19:08 PM

That's interesting. I'll give it a try. Thanks Joel! >Hi Charles, >As I understand it, you want to normalize space, but exercise the option to specify if the initial or terminal space should be replaced by a single space or removed >altogether. Here's how I'd handle it: [Snip] >Good . . . Read full entry »


Re: Conditional sort instruction as parameter within

Posted 6/7/2021 2:09:29 AM

Splendid !!B B Thanks for entertaining the question!B This is my first time using XSLT to perform sort. I incapacitated the ML sort operator and plugin the XSLT sort. A trifle unsteady in the IDEA - "Expected type 'xs:string', got 'xs:decimal' ?B But the sort rendering bears well in the UI . . . Read full entry »


Re: Conditional sort instruction as parameter within

Posted 6/6/2021 10:44:10 PM

Hi, Michael: B B B I included the Input XML in the question already. The <search:response> itself is XML as the Stage One search result: <?xml version="1.0" encoding="UTF-8"?> <search:response xmlns:search="http://marklogic.com/appservices/search"> . . . Read full entry »


Re: Conditional sort instruction as parameter within

Posted 6/6/2021 10:40:48 PM

The desired result is simple as:B <Incarnation> B B <Trade> B B B B B <Justification> B B B B B B B B <path>fn:doc('/b.xml')//*:putCurrencyAmount/*:currency</path> B B B B B B B B <highlight>USD</highlight> B B B B B B B B <path>fn:doc('/b.xml . . . Read full entry »


Re: Conditional sort instruction as parameter within

Posted 6/6/2021 9:39:41 PM

Fiona, I'm afraid you really aren't making yourself very clear. It would be much easier if you showed us a source document and a desired result document. You've shown us code like > <xsl:for-each select="highlight"> > > <xsl:sort select="if (normaliz . . . Read full entry »


Re: Conditional sort instruction as parameter within

Posted 6/6/2021 8:59:57 PM

The logic is to sort on the <search:highlight>:B <search:highlight> contains both string( /*:putCurrencyAmount/*:currency) and decimal (/*:putCurrencyAmount/*:amount) value in the same parent element (search:result/search:snippet).B "sortAmount" is supposed to sortB /*:am . . . Read full entry »


Re: Conditional sort instruction as parameter within

Posted 6/6/2021 8:23:54 PM

On Sun, 2021-06-06 at 19:33 +0000, Martin Honnen martin.honnen@xxxxxx wrote: > On 06.06.2021 19:34, Fiona Chen anonymousjuly1@xxxxxxxxx wrote: > > > > B B B B <xsl:param name="sortAmount"> > > B B B B B B B B <xsl:for-each select="highlight"> . . . Read full entry »


Re: Conditional sort instruction as parameter within

Posted 6/6/2021 7:32:11 PM

On 06.06.2021 19:34, Fiona Chen anonymousjuly1@xxxxxxxx wrote: Question One: The conditional sort is based on the search:highlight, if it is decimal, sort the putAmount and then incarnate the document. Notice: The "Rationale" is that currency and amount must be paired. In each search:snip . . . Read full entry »


Re: Conditional sort instruction as parameter within

Posted 6/6/2021 6:29:09 PM

On 06.06.2021 19:34, Fiona Chen anonymousjuly1@xxxxxxxx wrote: Question One: The conditional sort is based on the search:highlight, if it is decimal, sort the putAmount and then incarnate the document. Notice: The "Rationale" is that currency and amount must be paired. In each search:sni . . . Read full entry »


Conditional sort instruction as parameter within group

Posted 6/6/2021 5:33:53 PM

I can sort on putAmount by exploiting the data engine through API. But I can't seem to achieve the same sort effect in pure XSLT. Below is my XSLT module extract as part of the Stage Two implementation: B B B <xsl:template match="result"> B B B B B B B <xsl:variable name=" . . . Read full entry »


Conditional sort instruction as parameter within group

Posted 6/6/2021 5:32:42 PM

I am developing a search and transform engine. Stage one ( XQuery ): It returns the search response snippet based on the point-in-time criteria from the UI: <search:response xmlns:search="http://marklogic.com/appservices/search"> B B B <search:result index="1" uri=&qu . . . Read full entry »


Re: Removing unwanted space

Posted 6/5/2021 10:02:57 PM

On 04/06/2021 19:54, Charles O'Connor coconnor@xxxxxxxxxxxx wrote: > On 04/06/2021 18:58, Liam R. E. Quin liam@xxxxxxxxxxxxxxxx wrote: >> If you use DTD parsing, you can declare specific elements as being >> element-only (by giving a list of all permitted element children >> . . . Read full entry »


Re: Removing unwanted space

Posted 6/5/2021 5:54:11 AM

Hi Charles, As I understand it, you want to normalize space, but exercise the option to specify if the initial or terminal space should be replaced by a single space or removed altogether. Here's how I'd handle it: <xsl:template match="text()" priority="-1" mode="nor . . . Read full entry »


Re: Removing unwanted space

Posted 6/4/2021 10:49:51 PM

On 04/06/2021 23:45, Charles O'Connor coconnor@xxxxxxxxxxxx wrote: > Ask an ye shall receive. Here's an example from a table (words have been changed to protect the innocent), though I think Peter's template would work fine here. However, there are gene names and yeast mating types that use mark . . . Read full entry »


Re: Removing unwanted space

Posted 6/4/2021 10:46:53 PM

On 04/06/2021 23:05, Liam R. E. Quin liam@xxxxxxxxxxxxxxxx wrote: [...] > > Watch out for input like > > <p>The boy<em> splshed </em>through the puddles!</p> > and, > <p>It was very un<i>convent</i><b>ion</b>al to have to fa . . . Read full entry »


Re: Removing unwanted space

Posted 6/4/2021 10:44:54 PM

Ask an ye shall receive. Here's an example from a table (words have been changed to protect the innocent), though I think Peter's template would work fine here. However, there are gene names and yeast mating types that use markup on just parts of terms, and I'm not sure how it would work on them: . . . Read full entry »


Re: Removing unwanted space

Posted 6/4/2021 10:05:06 PM

On Fri, 2021-06-04 at 21:42 +0000, Peter Flynn peter@xxxxxxxxxxx wrote: > [...] > Pass all text nodes in mixed content through a template which will > strip > space from the start (if it's the first text node in an element) or > the > end (if it's the last text node in an elemen . . . Read full entry »


Re: Removing unwanted space

Posted 6/4/2021 9:41:12 PM

On 04/06/2021 00:54, Charles O'Connor coconnor@xxxxxxxxxxxx wrote: > OK, I've tried this a bunch of ways and failed (using XSLT 2.0). > > The XML I'm working with has a bunch of unwanted whitespace in all sorts of places, but looking just at paragraphs, it can have > > <p> &g . . . Read full entry »


Re: Removing unwanted space

Posted 6/4/2021 7:18:21 PM

On Fri, 2021-06-04 at 19:08 +0000, Wendell Piez wapiez@xxxxxxxxxxxxxxx wrote: > Hi, > > Alas, schema awareness is actually not a help for this particular > case or > any case where the errant whitespace turns up in places where > whitespace is > supposed to be significant (and . . . Read full entry »


Re: Removing unwanted space

Posted 6/4/2021 7:07:42 PM

Hi, Alas, schema awareness is actually not a help for this particular case or any case where the errant whitespace turns up in places where whitespace is supposed to be significant (and frequently is). I suppose something like schema-awareness, or actual schema awareness (XSD awareness), might be . . . Read full entry »


Re: Removing unwanted space

Posted 6/4/2021 6:53:41 PM

>If you use DTD parsing, you can declare specific elements as being element-only (by giving a list of all permitted element children without #PCDATA), and then >whitespace in such a context may be dropped by the parser or application (e.g. Saxon) automatically. Alas, we are limited to non- . . . Read full entry »


Re: Removing unwanted space

Posted 6/4/2021 5:58:21 PM

On Fri, 2021-06-04 at 12:41 +0000, Charles O'Connor coconnor@xxxxxxxxxxxx wrote: > In tables I fear that some line > breaks will be junk and others used to get rendering they want, which > will be near impossible to tease out. If you use DTD parsing, you can declare specific elements . . . Read full entry »


Re: Removing unwanted space

Posted 6/4/2021 1:07:19 PM

Don't forget https://www.w3.org/TR/xslt-30/#element-strip-space Useful with selected elements. HTH On Fri, 4 Jun 2021 at 13:40, Charles O'Connor coconnor@xxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > > Thanks Wendell, Joel, and Graydon! I will use your suggestions an . . . Read full entry »


Re: Removing unwanted space

Posted 6/4/2021 12:40:09 PM

Thanks Wendell, Joel, and Graydon! I will use your suggestions and see what I get and whether I can apply the lessons to other places I need to get rid of white space. I am at least a little gratified that this is not an easy problem causing the bumps on my forehead. Joel, to answer your question . . . Read full entry »


Re: Removing unwanted space

Posted 6/4/2021 11:36:25 AM

Hey Charles, A couple of techniques I use in this situation: text()[. is ancestor::p/descendant::text()[1]] - matches the first text node in a p, no matter how deep. text()[. is ancestor::p/descendant::text()[last()]] - same for the end text()[not(matches(.,'\S')] - text that has no non-whitesp . . . Read full entry »


Re: Removing unwanted space

Posted 6/4/2021 8:49:27 AM

Hi Charles, This question seems to need more specificity. People can reasonably disagree on details, especially if a space appears to be an object of markup, or there are expectations further downstream about space explicitly tagged/formatted. For example, in the following variation... <p&g . . . Read full entry »


Re: Removing unwanted space

Posted 6/4/2021 12:36:35 AM

On Thu, Jun 03, 2021 at 11:54:25PM -0000, Charles O'Connor coconnor@xxxxxxxxxxxx scripsit: > OK, I've tried this a bunch of ways and failed (using XSLT 2.0). > > The XML I'm working with has a bunch of unwanted whitespace in all > sorts of places, but looking just at paragraphs, it can . . . Read full entry »


Removing unwanted space

Posted 6/3/2021 11:54:18 PM

OK, I've tried this a bunch of ways and failed (using XSLT 2.0). The XML I'm working with has a bunch of unwanted whitespace in all sorts of places, but looking just at paragraphs, it can have <p> The rain in <bold>Spain</bold> <italic>is</italic> wet. </p> O . . . Read full entry »


XSL-List Guidelines

Posted 6/1/2021 2:29:31 PM

This 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: White papers etc on xsl:iterate

Posted 5/27/2021 10:46:28 PM

On Thu, 2021-05-27 at 21:39 +0000, rick@xxxxxxxxxxxxxx wrote: > . Does anyone know of any white papers, > conference presentations, etc. on <xsl:iterate>? It's included in the XSLT 3 course i run :) (i've expamded coverage somewhat, too) and there are examples om the spec. Liam -- L . . . Read full entry »


Aw:  White papers etc on xsl:iterate

Posted 5/27/2021 9:58:45 PM

https://www.balisage.net/Proceedings/vol25/html/Walsh 01/BalisageVol25-Walsh01.html#xsliterate -- Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.Am 27.05.21, 23:38 schrieb "rick@xxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>: Hi all, I . . . Read full entry »


Re: White papers etc on xsl:iterate

Posted 5/27/2021 9:42:05 PM

I'm currently not aware of any, but https://xsl.markmail.org/search/?q=iterate should unearth some examples. On 27.05.2021 23:38, rick@xxxxxxxxxxxxxx wrote: Hi all, I finally used <xsl:iterate> on a job and it was pretty useful passing parameters for each iteration. Does anyone know of an . . . Read full entry »


White papers etc on xsl:iterate

Posted 5/27/2021 9:38:08 PM

Hi all, I finally used <xsl:iterate> on a job and it was pretty useful passing parameters for each iteration. Does anyone know of any white papers, conference presentations, etc. on <xsl:iterate>? I looked at the spec and the Saxon docs, but I was hoping to find more details and exa . . . Read full entry »


[ANN] Balisage Late-breaking News proposals due 4 June

Posted 5/27/2021 7:05:30 PM

The peer-reviewed part of the Balisage 2021 program has been scheduled (https://www.balisage.net/2021/Program.html). As usual, some speaking slots were set aside for late-breaking news, updates, and fast-breaking stories. Proposals for late-breaking presentations at Balisage are due June 4th. Deta . . . Read full entry »


Re: Transform selected attribute to element when eleme

Posted 5/22/2021 9:28:02 PM

p b$o8 Excellent Collaboration!!!B On Saturday, May 22, 2021, 12:03:32 p.m. MST, Martin Honnen martin.honnen@xxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: On 22.05.2021 20:51, Sam Spade anonymousjuly1@xxxxxxxx wrote: > As you can see,B the unwanted attribute . . . Read full entry »


Re: Transform selected attribute to element when eleme

Posted 5/22/2021 7:03:31 PM

On 22.05.2021 20:51, Sam Spade anonymousjuly1@xxxxxxxx wrote: As you can see,B the unwanted attribute *currencyScheme* still persists. Is there a way to remove the attribute which is not in the $keepAttr list? Perhaps in this case it is better to filter when applying templates: <xsl:stylesheet . . . Read full entry »


Re: Transform selected attribute to element when eleme

Posted 5/22/2021 6:51:01 PM

Thanks!B I tried a similar approach before. Input: <requestConfirmation xmlns="http://example/confirmation"> B B B <trade> B B B B B B B <cal> B B B B B B B B B B B <c>PRECEDING</c> B B B B B B B B B B B <bcs id="businessCenters"> B B B . . . Read full entry »


Re: How to fuzz the last four digits of a lat/long?

Posted 5/22/2021 1:26:40 PM

> But, but, but, .... > > I really want to do the transformation in one step. Why? There are clearly two separate operations here - rounding the value and then formatting it. I would do round($x, 2) => format-number("000.000000") Michael Kay Saxonica > Is there a way t . . . Read full entry »


How to fuzz the last four digits of a lat/long?

Posted 5/22/2021 1:09:38 PM

Hi Folks, I want to transform this location data: <location> <altitude>30000</altitude> <latitude>42.364978</latitude> <longitude>-71.022362</longitude> </location> to this: <location> <altitude>30000</altitude> . . . Read full entry »


Re: Transform selected attribute to element when eleme

Posted 5/22/2021 8:12:38 AM

Am 22.05.2021 um 02:02 schrieb Sam Spade anonymousjuly1@xxxxxxxx: > > 2.As I point out in the post, > > https://stackoverflow.com/questions/67575484/what-attribute-node-cannot-follo w-non-attribute-node-in-element-content-tells > <https://stackoverflow.com/questions/67575484/what- . . . Read full entry »


Re: Transform selected attribute to element when eleme

Posted 5/22/2021 12:01:47 AM

2.B B B B As I point out in the post, B https://stackoverflow.com/questions/67575484/what-attribute-node-cannot-follo w-non-attribute-node-in-element-content-tells B it is not only very difficult to search value if anelement (<currency>) contains both element (<id>) and text valu . . . Read full entry »


Re: Transform selected attribute to element when eleme

Posted 5/22/2021 12:01:07 AM

Hi, Martin: B B B B B B B B B B B The purposesof flattening the XML are: 1.B B B B After the $keepAttr is flattened to element (therewill not be any attribute ), I can further transform the flattened XML to JSON.That is the purpose of this post: https://stackoverflow.com/questions/67145900/xque . . . Read full entry »


Re: Transform selected attribute to element when eleme

Posted 5/21/2021 5:35:52 PM

On 21.05.2021 16:30, Sam Spade anonymousjuly1@xxxxxxxx wrote: |The transformation logic: ||| | 1) transform namespace 2) transform root element 3) transform the selected attribute(s) to element (the attribute name is parameterised not hard-coded) 4) the transformed element shouldn't contain both o . . . Read full entry »


Transform selected attribute to element when element

Posted 5/21/2021 2:30:07 PM

Input: B <requestConfirmation xmlns="http://example/confirmation"> <trade> <cal> <c>PRECEDING</c> <bcs id="businessCenters"> <bc>USNY</bc> <bc>GBLO</bc> . . . Read full entry »


Re: preceding-sibling in a group

Posted 5/21/2021 7:45:59 AM

Martin's suggestions would both work. Another idea would be <xsl:variable name="first-note" select="current-group/PART_DES[matches(.,'NOTE')][1] > > <xsl:for-each select="current-group()"> > <xsl:choose> > < . . . Read full entry »


Re: preceding-sibling in a group

Posted 5/20/2021 8:49:41 PM

On 20.05.2021 22:36, Martin Honnen martin.honnen@xxxxxx wrote: The idea is that when I see a NOTE string, I want that entry and all following within the same group to be <note> elements. So I am look for preceding-sibling or self that contains NOTE but restricted to the same group. I am u . . . Read full entry »


Re: preceding-sibling in a group

Posted 5/20/2021 8:35:52 PM

On 20.05.2021 22:20, rick@xxxxxxxxxxxxxx wrote: The idea is that when I see a NOTE string, I want that entry and all following within the same group to be <note> elements. So I am look for preceding-sibling or self that contains NOTE but restricted to the same group. I am using XSLT 3. Th . . . Read full entry »


Re: preceding-sibling in a group

Posted 5/20/2021 8:20:03 PM

Here is my sample input: <?xml version="1.0" encoding="UTF-8"?> <dataroot> <DH675AU> <FIG_NO>99999</FIG_NO> <PART_DES>DIPSTICK</PART_DES> </DH675AU> <DH675AU> <FIG_NO>99999 . . . Read full entry »


Re: preceding-sibling in a group

Posted 5/19/2021 5:22:47 PM

It would be good to see the problem in context, but if you want to select elements that are both (a) members of the current group, and (b) preceding siblings of the current element, then you could use (preceding-sibling::* intersect current-group()). I suspect though that there is a better solutio . . . Read full entry »


Re: preceding-sibling in a group

Posted 5/19/2021 4:55:45 PM

On 19.05.2021 18:45, rick@xxxxxxxxxxxxxx wrote: If I am processing elements in the current-group (), is the preceding-sibling axis restricted to the current group? I want to test the value on a preceding-sibling element, but want to restrict it to the group I am processing. Any pointers would be a . . . Read full entry »


preceding-sibling in a group

Posted 5/19/2021 4:45:28 PM

Hi, If I am processing elements in the current-group (), is the preceding-sibling axis restricted to the current group? I want to test the value on a preceding-sibling element, but want to restrict it to the group I am processing. Any pointers would be appreciated. I am using XSLT 3. Thank you . . . Read full entry »


[ANN] Call for Late-breaking News -- Balisage: The Mar

Posted 5/18/2021 3:26:23 PM

It is not too late for you to speak at Balisage! The peer-reviewed part of the Balisage 2021 program has been scheduled (https://www.balisage.net/2021/Program.html). The Markup world moves quickly, so every year some speaking slots are set aside for late-breaking news, updates, and fast-breaking s . . . Read full entry »


[ANN] Markup UK conference approaching (May 21 - 22)

Posted 5/16/2021 10:58:32 AM

Markup UK conference is now less than a week away. (May 21 - 22) Starting Friday, there will be two days of exciting presentations on various topics including XSLT and Schematron. There will also be an extensive XForms tutorial, spanning both Friday and Saturday mornings. The full schedule ca . . . Read full entry »


Declarative Amsterdam 2021, Call for Presentations

Posted 5/15/2021 8:38:40 AM

On 4 and 5 November 2021, the third Declarative Amsterdam conference will take place at CWI, Science Park, Amsterdam. The conference focuses on the technologies and methods used for declarative programming and declarative data. Declarative programming (https://en.wikipedia.org/wiki/Declarati . . . Read full entry »


Re: passing a function as a parameter to transform()

Posted 5/14/2021 1:51:30 PM

On Fri, May 14, 2021 at 01:35:38PM -0000, Michael Kay mike@xxxxxxxxxxxx scripsit: > Clearly the "called" stylesheet isn't picking up the supplied value for the parameter. I can't see why, but I would look carefully at the rather weird namespace that it's using. Martin correctly identi . . . Read full entry »


Re:  Re:  Re: passing a function as a parameter to tr

Posted 5/14/2021 1:48:20 PM

On Fri, May 14, 2021 at 01:30:39PM -0000, Martin Honnen martin.honnen@xxxxxx scripsit: > The parameter passing needs to use the URI of the namespace and not the namespace prefix. (Argh.) That works! Thank you! Apologies for the cabbage-nature. For anyone who might be curious, the working . . . Read full entry »


Re: passing a function as a parameter to transform()

Posted 5/14/2021 1:35:33 PM

I can't see what's wrong at this stage, but that's probably because I'm not sure exactly what your code looks like after a series of changes. Clearly the "called" stylesheet isn't picking up the supplied value for the parameter. I can't see why, but I would look carefully at the rather w . . . Read full entry »


Aw: Re:  Re: passing a function as a parameter to tra

Posted 5/14/2021 1:30:34 PM

The parameter passing needs to use the URI of the namespace xmlns:local="data:,dpc" e.g.QName('data:,dpc','functionname&# 39;) -- Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.Am 14.05.21, 15:06 schrieb "Graydon graydon@xxxxxxxxx" <xsl-list- . . . Read full entry »


Re: passing a function as a parameter to transform()

Posted 5/14/2021 1:28:35 PM

On Fri, May 14, 2021 at 01:05:31PM -0000, Michael Kay mike@xxxxxxxxxxxx scripsit: > You're calling <xsl:sequence select="local:tiny('away')" />, but there is no function named local:tiny in scope. What there is is a variable (parameter) named local:tiny, whose value is a function . . . Read full entry »


Re:  Re: passing a function as a parameter to transfo

Posted 5/14/2021 1:06:43 PM

On Fri, May 14, 2021 at 12:39:53PM -0000, Martin Honnen martin.honnen@xxxxxx scripsit: > Use $local:function Progress! If I invoke the passed-as-a-parameter function as <xsl:sequence select="$local:tiny('away')" /> in the stylesheet called by transform(), it changes the error . . . Read full entry »


Re: passing a function as a parameter to transform()

Posted 5/14/2021 1:05:25 PM

You're calling <xsl:sequence select="local:tiny('away')" />, but there is no function named local:tiny in scope. What there is is a variable (parameter) named local:tiny, whose value is a function. So you need a dynamic call on the function held in the variable, not a static call on . . . Read full entry »


Aw: Re: passing a function as a parameter to transfor

Posted 5/14/2021 12:39:47 PM

Use $local:function -- Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.Am 14.05.21, 14:15 schrieb "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>: On Thu, May 13, 2021 at 09:20:49PM -0000, Michael Kay mike@xxxxxxxxxxxx scripsit . . . Read full entry »


Re:  Re: passing a function as a parameter to transfo

Posted 5/14/2021 12:31:17 PM

On Fri, May 14, 2021 at 12:20:04PM -0000, Martin Honnen martin.honnen@xxxxxx scripsit: > Perhaps try visibility=&quot;public&quot; on the function declaration If I try <xsl:function name="local:tiny" as="text()" visibility="public"> <xsl:param . . . Read full entry »


Aw: Re: passing a function as a parameter to transfor

Posted 5/14/2021 12:19:58 PM

Perhaps try visibility="public" on the function declaration -- Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.Am 14.05.21, 14:15 schrieb "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>: On Thu, May 13, 2021 at 09:20:49 . . . Read full entry »


Re: passing a function as a parameter to transform()

Posted 5/14/2021 12:14:44 PM

On Thu, May 13, 2021 at 09:20:49PM -0000, Michael Kay mike@xxxxxxxxxxxx scripsit: > To pass the function itself, rather than the result of a function call, use local:getString#2. Thank you! That moves the error into the stylesheet called by transform(): Engine name: Saxon-EE 10.3 (External) S . . . Read full entry »


Aw:  passing a function as a parameter to transform()

Posted 5/13/2021 9:27:56 PM

A function reference would be local:get-string#2 -- Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.Am 13.05.21, 23:05 schrieb "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>: Hello -- Using Saxon 10.3 and XSLT 3.0 (from insid . . . Read full entry »


Re: passing a function as a parameter to transform()

Posted 5/13/2021 9:20:43 PM

> On 13 May 2021, at 22:05, Graydon graydon@xxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > > Hello -- > > Using Saxon 10.3 and XSLT 3.0 (from inside oXygen 23), can I pass a function as > a parameter to transform()? > > <xsl:sequence select=" > . . . Read full entry »


passing a function as a parameter to transform()

Posted 5/13/2021 9:05:30 PM

Hello -- Using Saxon 10.3 and XSLT 3.0 (from inside oXygen 23), can I pass a function as a parameter to transform()? <xsl:sequence select=" transform(map { 'stylesheet-location': 'tidy.xsl', 'source-node': $tableMerge, 'stylesheet-params': map { QName('', 'defaultLang'): $d . . . Read full entry »


[ANN] Balisage 2021 Program Now Available

Posted 5/11/2021 3:42:54 PM

Balisage: The Markup Conference 2021 Program Now Available https://www.balisage.net/2021/Program.html Balisage: where serious markup practitioners and theoreticians meet every summer. The 2021 program includes papers that discuss: b" Programming with XSLT and CSS b" Modeling text as g . . . Read full entry »


Re: [ANN] Saxon-JS 2.2 release 11 May 2021

Posted 5/11/2021 3:42:53 PM

Thank you for the update. Has anyone on the list successfully integrated Saxon-JS with Adobe's ExtendScript? Thank you. Rick . . . Read full entry »


[ANN] Saxon-JS 2.2 release 11 May 2021

Posted 5/11/2021 3:36:55 PM

Hello, Saxonica is pleased to announce the release of Saxon-JS 2.2 for both Node.js and the browser. Saxon-JS is a high-performance XSLT 3.0 processor. It conforms with the latest W3C specifications (notably XSLT 3.0 and XPath 3.1), together with extensions designed to meet the needs of modern we . . . Read full entry »


Re: Seeking a smarter tokenize for augmented text

Posted 5/7/2021 9:41:15 AM

I have made some progress on this, not to a working point yet but I'm more confident than I was, so thanks to all for the suggestions which have been helpful. I also found some hints in a stackoverflow answer of Martin Honnen's which reinforced the advice to work on this by adding a line marker ele . . . Read full entry »


Re: Seeking a smarter tokenize for augmented text

Posted 5/7/2021 8:36:56 AM

Hi Michael, I referred to something similar in the one pass suggestion I made If the line break is inside a text node, you need to split that text node in the mean time "this is line 1 this is line 2" is likely to be one text node (or at least could be) Met vriendelijke groeten, Best . . . Read full entry »


Re: Seeking a smarter tokenize for augmented text

Posted 5/7/2021 8:25:13 AM

Hi, . . . Read full entry »


[ANN] XSLT 3 training - May, June, July - XSLT three f

Posted 5/5/2021 2:28:03 AM

Dates for XSLT 3 for XSLT users: * May 25th, 26th, 27th * June 29th, 30th, Jul 1st * July & August on request I'm looking at reorganizing somewhat so that streaming is no longer a separate day and the course is over three days, because two days for everything else plus a day for streaming is t . . . Read full entry »


Re: Same Indent in converted output xml

Posted 4/21/2021 7:05:09 AM

Saxon-HE does not have an option to produce this format. With Saxon-PE and higher you can set saxon:indent-spaces="0". However, you can of course preserve all the whitespace in the input document and copy it manually to the output: in fact, that's the default action if you don't use xsl: . . . Read full entry »


Re: Same Indent in converted output xml

Posted 4/21/2021 5:10:41 AM

I am using saxon9he On Thu, Apr 15, 2021 at 10:01 AM Byomokesh Sahoo <sahoo.byomokesh@xxxxxxxxx> wrote: > Hi, > > Any way to same indentation will appear while converting One XML to > Another XML format. I am using indent="yes" but the same indent does not > appear . . . Read full entry »


Re: How to correctly position breaks in mixed content?

Posted 4/17/2021 6:05:57 AM

Thank you both cheers T From: Geert Bormans geert@xxxxxxxxxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Sent: Thursday, 15 April 2021 00:48 To: xsl-list <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: Re: How to correctly position breaks in mixed content? then a typo occur . . . Read full entry »


Re: problem with key

Posted 4/15/2021 3:09:48 PM

Thank you all. I am happy with my working batch file method. Jim Albright Wycliffe Bible Translators 704-562-1529 On Thu, Apr 15, 2021 at 2:47 AM Martin Honnen martin.honnen@xxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > Am 15.04.2021 um 00:28 schrieb Albright, Jim jim_alb . . . Read full entry »


Re: problem with key

Posted 4/15/2021 6:47:32 AM

Am 15.04.2021 um 00:28 schrieb Albright, Jim jim_albright@xxxxxxxxxxxx: In thinking about this, it looks like this can be written as a recursive routine.B Is this correct? Right now I run a batch file and increment the level for each step. It might be easier for us to help of if you start with a n . . . Read full entry »


Re: Same Indent in converted output xml

Posted 4/15/2021 6:39:45 AM

Am 15.04.2021 um 08:38 schrieb Martin Honnen martin.honnen@xxxxxx: Am 15.04.2021 um 06:32 schrieb Byomokesh Sahoo sahoo.byomokesh@xxxxxxxxx: EXPECTED OUTPUT: <journal-meta> <journal-id journal-id-type="publisher-id">ier</journal-id> <journal-id journal-id-type=" . . . Read full entry »


Re: Same Indent in converted output xml

Posted 4/15/2021 6:38:10 AM

Am 15.04.2021 um 06:32 schrieb Byomokesh Sahoo sahoo.byomokesh@xxxxxxxxx: Hi, Any way to same indentationB will appear while converting One XML to Another XML format. I am using indent="yes" but the same indent does not appear in converted output xml. I can not use xsl:copy because I hav . . . Read full entry »


Same Indent in converted output xml

Posted 4/15/2021 4:32:02 AM

Hi, Any way to same indentation will appear while converting One XML to Another XML format. I am using indent="yes" but the same indent does not appear in converted output xml. I can not use xsl:copy because I have to apply one format to another format with different scenarios. *XSL:* . . . Read full entry »


Re: problem with key

Posted 4/14/2021 10:28:27 PM

In thinking about this, it looks like this can be written as a recursive routine. Is this correct? Right now I run a batch file and increment the level for each step. Jim Albright Wycliffe Bible Translators 704-562-1529 On Wed, Apr 14, 2021 at 4:48 PM Albright, Jim jim_albright@xxxxxxxxxxxx < . . . Read full entry »


Re: problem with key

Posted 4/14/2021 8:48:26 PM

Thank you David and Dimitre, You are both right. Thank you. I would have responded sooner but it took me some time to find a bug that caused the file to grow. I now pass a /level/ parameter to facilitate deleting duplicates. Here is working XSLT <xsl:param name="level"></xsl . . . Read full entry »


Re: How to correctly position breaks in mixed content?

Posted 4/14/2021 12:47:09 PM

then a typo occurred to me... <var type="s" id="ID01"/>n<superscript type="s" id="ID02"/ >th<superscript type="e" id="ID02" ><var type=" r " id="ID01"/> should read <var type="s" id . . . Read full entry »


Re: How to correctly position breaks in mixed content?

Posted 4/14/2021 12:34:00 PM

Hi, Yep, this is essentially an overlap problem. What a wonderful thing, that we have workable solutions. :-> Cheers, Wendell On Wed, Apr 14, 2021 at 5:55 AM Geert Bormans geert@xxxxxxxxxxxxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > Hi Trevor, > > One option . . . Read full entry »


Re: How to correctly position breaks in mixed content?

Posted 4/14/2021 9:55:05 AM

Hi Trevor, One option would be to replace the mixed content elements by empty elements <var>n<superscript>th</superscript></var> to become <var type="s" id="ID01"/>n<superscript type="s" id="ID02"/ >th<superscript type= . . . Read full entry »


How to correctly position breaks in mixed content?

Posted 4/14/2021 9:40:10 AM

NB currently XSL 2.0 I'm struggling with what I thought would be a simple enough problem: given content like this "<code>Mixed content, mainly text but with some text such as <var>variable names</var> wrapped in elements, sometimes nested like a reference to the & . . . Read full entry »


Re: problem with key

Posted 4/12/2021 5:20:20 AM

On Mon, 12 Apr 2021 06:08:46 +0200, Albright, Jim jim_albright@xxxxxxxxxxxx wrote: > > [1 <text/plain; UTF-8 (7bit)>] > [2 <text/html; UTF-8 (quoted-printable)>] > I am trying to upconvert from a flat-file. After I get it into XML form I try to add hierarchy using "k . . . Read full entry »


Re: problem with key

Posted 4/12/2021 4:25:00 AM

> <SubPossibilities> > <xsl:copy select="key('SemanticDomainByParent', '$parentSD')"/> > </SubPossibilities> I think you want to use *<xsl:copy-of>* here, and the XSLT processor probably should have raised an error. Cheers, . . . Read full entry »


problem with key

Posted 4/12/2021 4:08:27 AM

I am trying to upconvert from a flat-file. After I get it into XML form I try to add hierarchy using "key". ------------- OUTPUT ------------- I get NO results from <SubPossibilities> <xsl:copy select="key('SemanticDomainByParent', '$parentSD')"/> </Su . . . Read full entry »


Re: getting result documents out of a function that ca

Posted 3/31/2021 6:45:57 PM

On Wed, 2021-03-31 at 18:26 +0000, Graydon graydon@xxxxxxxxx wrote: > > How do I get those DEBUG result documents back out of the function? You probably do need to have your function take a map as an argument. A sequence of "documents-so-far" is even less elegant when you start de . . . Read full entry »


getting result documents out of a function that calls

Posted 3/31/2021 6:25:07 PM

In the interest of doing a bunch of small named transformations in a particular order (for refactoring, or to regularize content before processing it generally), I have this function: <xsl:function name="local:processList" as="document-node()"> <xsl:param as=" . . . Read full entry »


[ANN] Reminder: Balisage Paper submissions due 2 April

Posted 3/31/2021 1:52:29 PM

Balisage: The Markup Conference 2021 About: https://www.balisage.net/ Call for Participation: https://www.balisage.net/Call4Participation.html submissions due 2 April 2021 Proceedings of Previous Events: https://www.balisage.net/Proceedings/index.html Help or Information: info@xxxxxxxxxxxx . . . Read full entry »


[ANN] XSLT 3 training - 20th - 22nd April 2021 (new

Posted 3/29/2021 9:12:43 PM

A change of dates to make it easier for people attending JATS-Con: I'll be running XSLT 3 training on the 20th, 21st, 22nd April - the week before ATS-Con this year. It's mid-week to try & minimize impact on people's work. This is really a two and a half day course when delivered online. In p . . . Read full entry »


Re: RDF graph to SVG force-directed layout

Posted 3/29/2021 8:49:16 AM

Hi, thanks for the suggestions. Ibm not after a standalone tool, Ibm integrating graph layout into our UI which is XSLT-based rendering of RDF data, both server- and client-side. "By means of interactive XSLT extensions, it can deliver the rich user experience of a modern web application w . . . Read full entry »


Re: RDF graph to SVG force-directed layout

Posted 3/29/2021 8:47:22 AM

Michael Kay mike@xxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> writes: > We also used Graphviz for the streamabililty diagrams in early drafts > of XSLT 3.0, see for example > > https://www.w3.org/TR/2010/WD-xslt-21-20100511/#streamability-examples > > The graph was . . . Read full entry »


Re: RDF graph to SVG force-directed layout

Posted 3/29/2021 8:36:12 AM

We also used Graphviz for the streamabililty diagrams in early drafts of XSLT 3.0, see for example https://www.w3.org/TR/2010/WD-xslt-21-20100511/#streamability-examples The graph was transformed to DotML vocabulary from a high-level XML description of the tree structure. Michael Kay Saxonica . . . Read full entry »


Re: RDF graph to SVG force-directed layout

Posted 3/29/2021 12:33:45 AM

I use Graphviz for this stuff: https://graphviz.org/ It's kind of on-topic because it takes an XML graph as input. - Chris . . . Read full entry »


Re: RDF graph to SVG force-directed layout

Posted 3/28/2021 9:40:33 PM

Hi Paul, I wonder if that JSON-LD/d3.js code can be found anywhere? :) Martynas atomgraph.com On Thu, Oct 15, 2020 at 3:16 AM Paul Tyson phtyson@xxxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > > I also thought of d3.js, but donbt know if it fits your overall archit . . . Read full entry »


Re: Find/replace algorithm

Posted 3/28/2021 5:30:38 PM

Here is a multi-replace transformation I wrote as an answer to this SO question in 2012 (no regex, just replace one whole string with another). This is just a recursive algorithm: https://stackoverflow.com/a/12505924/36305 In the example there, it transforms: <t>The quick brown fox</t& . . . Read full entry »


Re: Find/replace algorithm

Posted 3/28/2021 9:26:08 AM

Hi Jim, If you can express the substitutions as proper XSLT regular expressions (i.e., no \b), then you could add as one more possibility the use of tan:batch-replace(), which allows you to stay within XSLT. One passes as parameters a sequence of elements with attributes corresponding to fn:ma . . . Read full entry »


Re: RDF graph to SVG force-directed layout

Posted 3/26/2021 10:22:33 PM

Hi Michael, I wanted to pick up this thread as I started working on this stylesheet again. I've implemented some of the optimizations suggested in this thread. https://github.com/AtomGraph/Web-Client/blob/master/src/main/webapp/static/co m/atomgraph/client/xsl/converters/RDFXML2SVG.xsl I want to . . . Read full entry »


Re: Find/replace algorithm

Posted 3/26/2021 1:40:46 PM

An ancient but very powerful tool called Consistent Changes handles this very easily. Program available for free at https://software.sil.org/cc/ The table would be 'xxxx' > 'yyyyyyy' 'as many items' > 'that you like' 'very efficient' > 'but old program' I use this progra . . . Read full entry »



PURCHASE STYLUS STUDIO ONLINE TODAY!!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Attend a Live Webinar This Week!

Learn about Stylus Studio's unique features and benefits in just under an hour. Register for the Stylus Studio QuickStart Training WebCast!

Ask Someone You Know

Does your company use Stylus Studio? Do your competitors? Engineers from over 100,000 leading companies use Stylus Studio, and now you can ask someone from your own organization about their experiences using Stylus Studio.

 
Free Stylus Studio XML Training:
W3C Member