Home > 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: How to remove outer tag if present in XSLTPosted 3/18/2023 5:28:58 AMThanks Michael! Apologies if I'm being unclear here. I'm a novice as far as XSLT goes and our primary code in the project is c# - so part of what we're doing is a bit of a learning/training exercise. I think that the solution Dmitri suggested will work for my issue - I'll be incorporating it a . . . Read full entry » Re: How to remove outer tag if present in XSLTPosted 3/18/2023 1:37:56 AM> This is normal. We figure things out as we go along. > Well said, Wendell. I'm often frustrated when people don't specify their requirement precisely and unambiguously, instead simply describing one example of an input document and saying how that one speciment should be handled. But this . . . Read full entry » Re: How to remove outer tag if present in XSLTPosted 3/18/2023 1:18:11 AMDear Wendell, > Hi Dimitre and XSL-List, > > It isn't altogether fair to be critical if stated requirements change, is it? In the spirit of figuring things out? Agreed, but don't things change all the time? :) This is what makes valuable the understanding and knowledge of the things tha . . . Read full entry » Re: How to remove outer tag if present in XSLTPosted 3/18/2023 12:26:07 AMHi Dimitre and XSL-List, It isn't altogether fair to be critical if stated requirements change, is it? In the spirit of figuring things out? For example, it is possible that this might (also) work for the OP: <xsl:template match="p[p]"> <xsl:apply-templates/> </xsl:tem . . . Read full entry » Re: How to remove outer tag if present in XSLTPosted 3/17/2023 10:50:06 PMMatt, I would have told you exactly what Martin Honnen told you: Change in the solution that I provided earlier this: <xsl:template match="arbitrary-outer-tag-thats-valid/*[1][not( following-sibling::*)]"> to this: <xsl:template match="arbitrary-outer-tag-thats-vali . . . Read full entry » Re: How to remove outer tag if present in XSLTPosted 3/17/2023 10:47:50 PMSorry, my examples needed parentheses for the "except (A|B)" due to precedence: *[A|B][not(* except (A|B))] *[A][B][not(* except (A|B))] - Chris -----Original Message----- From: Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> . . . Read full entry » Re: How to remove outer tag if present in XSLTPosted 3/17/2023 10:36:00 PMAnd to restrict to <p> that contains *only* <p>: <xsl:template match="p[p and not(* except p) and count(../*) = 1]"> <xsl:apply-templates/> </xsl:template> Using "* except" is my favorite way of limiting to certain elements only. To limit to el . . . Read full entry » Re: How to remove outer tag if present in XSLTPosted 3/17/2023 10:29:41 PMOn Fri, 2023-03-17 at 19:44 +0000, Matt Van Voorhies mvanvoorhies@xxxxxxxxxxx wrote: > > B B B B B Ungroup (remove) the outer <p> if it is the only element that > is a child of the arbitrary outer node (and is a <p> node).. > > B B B B B So a <div> > B B B B B . . . Read full entry » Re: How to remove outer tag if present in XSLTPosted 3/17/2023 9:59:49 PMOn 17/03/2023 20:19, Matt Van Voorhies mvanvoorhies@xxxxxxxxxxx wrote: bbbbbbDimitre - this works great for removing the outer tag -- so long as it's any outer tag. bbbbbbHow would I limit this to just <p> tags?? <xsl:template match="p[ p and not(*[name()!='p']) a . . . Read full entry » Re: How to remove outer tag if present in XSLTPosted 3/17/2023 8:43:52 PMOn 3/17/2023 9:19 PM, Matt Van Voorhies mvanvoorhies@xxxxxxxxxxx wrote: > > bbbbbbDimitre - this works great for removing the outer tag -- so long > as it's any outer tag. > > bbbbbbHow would I limit this to just <p> tags?? > > bbbbbbSo for example, > . . . Read full entry » Re: How to remove outer tag if present in XSLTPosted 3/17/2023 8:18:59 PMbbbbbbDimitre - this works great for removing the outer tag -- so long as it's any outer tag. bbbbbbHow would I limit this to just <p> tags?? bbbbbbSo for example, bbbbbb<arbitrary-outer-tag> bbbbbb<div> bbbbbbbbbbbb<p>content< . . . Read full entry » Re: How to remove outer tag if present in XSLTPosted 3/17/2023 7:43:38 PMUngroup (remove) the outer <p> if it is the only element that is a child of the arbitrary outer node (and is a <p> node).. So a <div> ... ... </div> Would not unwrap, since it's a "<div>" and not a "& . . . Read full entry » Re: How to remove outer tag if present in XSLTPosted 3/17/2023 5:26:17 PMA simple XSLT 1.0 solution (using even Saxon 6.5.3 is OK :) ): <xsl:stylesheet version="1.0" xmlns:xsl=" http://www.w3.org/1999/XSL/Transform"> <xsl:output omit-xml-declaration="yes" indent="yes"/> <xsl:strip-space elements="*"/> . . . Read full entry » Re: How to remove outer tag if present in XSLTPosted 3/17/2023 5:01:29 PMHi Matt, What are the precise conditions in which you want to ungroup the <p>? Is it when all of the following are true: * The element is a <p> element. * The <p> element is the only child of its parent (it stands alone). * The <p> element contains one or mor . . . Read full entry » Re: How to remove outer tag if present in XSLTPosted 3/17/2023 5:00:42 PMAm 3/17/2023 um 5:55 PM schrieb Matt Van Voorhies mvanvoorhies@xxxxxxxxxxx: > > Hi folks, > > I have a hopefully simple question that I was unable to find a good > answer for.Ibm trying to convert some code we have that manipulates an > XML structure (transforming to HTML output) . . . Read full entry » How to remove outer tag if present in XSLTPosted 3/17/2023 4:55:31 PMHi folks, I have a hopefully simple question that I was unable to find a good answer for. Im trying to convert some code we have that manipulates an XML structure (transforming to HTML output) and move it into the XSLT transform. . . . Read full entry » Re: [ANN] Oxygen XML Developer/Editor version 25.1 hasPosted 3/17/2023 2:50:09 PMAm 3/17/2023 um 3:46 PM schrieb Octavian Nadolu octavian_nadolu@xxxxxxx: We are excited to announce that Oxygen XML Developer/Editor version 25.1 is now available! Congrats. Listing below some new features which may be useful for the XSL community: XSLT/XQuery ================================= . . . Read full entry » [ANN] Oxygen XML Developer/Editor version 25.1 has beePosted 3/17/2023 2:46:25 PMHi everyone, We are excited to announce that Oxygen XML Developer/Editor version 25.1 is now available! Listing below some new features which may be useful for the XSL community: XSLT/XQuery ================================== * A new Saxon XSLT and XQuery transformer add-on is now available for . . . Read full entry » Re: how to make a progress report in XSLT? (was "how tPosted 3/15/2023 4:33:44 AMHi, How about running these transforms from a shell script that renames the output file after the transform, so that for the transform, file logA is read and file logB is written out. Then on exit, the shell script removes logA and renames logB to logA? Le lun. 13 mars 2023, C 08 h 51, Jean-Luc . . . Read full entry » how to make a progress report in XSLT? (was "how to maPosted 3/13/2023 12:51:37 PMDear XSLT list members, thanks to all those who answered my message of yesterday evening, available at https://www.biglist.com/lists/lists.mulberrytech.com/xsl-list/archives/202303 /msg00021.html After reading Michael Kay's recommendation of "using xsl:message for this, with a message listen . . . Read full entry » Re: how to make a log file in XSLT?Posted 3/12/2023 9:51:50 PMUpdate the XML log files in an XML database with XQuery update? On Sun, Mar 12, 2023 at 5:42b/PM Dimitre Novatchev dnovatchev@xxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > The requirement that the "log file" must be an XML document is > too-restricting in thi . . . Read full entry » Re: how to make a log file in XSLT?Posted 3/12/2023 9:42:16 PMThe requirement that the "log file" must be an XML document is too-restricting in this problem. This is why people generally don't write their log records as elements of an XML file. There are logging systems that write the log records in a database table (thus the log records from a fa . . . Read full entry » Re: how to make a log file in XSLT?Posted 3/12/2023 9:16:51 PM> In some context I think you can fool Saxon by using different URIs e.g. > append some query string to the input URI > > > <xsl:variable name="current_log_content" select="document($Log_file_name || '?foo=bar')"/> > Indeed you can, but you run the risk . . . Read full entry » Re: how to make a log file in XSLT?Posted 3/12/2023 9:11:47 PMOn Sun, 2023-03-12 at 20:12 +0000, Jean-Luc Chevillard jeanluc.chevillard@xxxxxxxxx wrote: > Dear list members, > > After running the script once, the file would become > +++++++++++++++ > <?xml version="1.0" encoding="UTF-8"?> > <log> > B B < . . . Read full entry » Re: how to make a log file in XSLT?Posted 3/12/2023 8:22:23 PMThe rule that you can't read and write to the same URI is there because in XSLT order of evaluation is undefined, so it would be undefined whether the read or the write comes first. In terms of your specific example, it's undefined whether the global variable (that uses doc()) has already been eva . . . Read full entry » Re: how to make a log file in XSLT?Posted 3/12/2023 8:15:20 PMOn 3/12/2023 9:11 PM, Jean-Luc Chevillard jeanluc.chevillard@xxxxxxxxx wrote: Dear list members, I have been wondering for a long time whether there was a method for automatically recording some elements of information every time I run a given script. As a minimum example, I would start with an em . . . Read full entry » how to make a log file in XSLT?Posted 3/12/2023 8:11:34 PMDear list members, I have been wondering for a long time whether there was a method for automatically recording some elements of information every time I run a given script. As a minimum example, I would start with an empty file +++++++++++++++ <?xml version="1.0" encoding="UTF- . . . Read full entry » Re: having a template remember not to call itself agaiPosted 3/11/2023 4:08:39 PMHi Gerrit, Thanks for the link to Dr. Kay's proposal for checking parameters in template matches! I replied to the comments there: https://github.com/qt4cg/qtspecs/issues/108 Hi everyone, I appreciate the numerous replies! As always, this list is quick to share its grizzled and hard-earned wis . . . Read full entry » Re: Looking for a cleaner way of auditing table cell dPosted 3/11/2023 1:21:33 PMHi Trevor, Since my August 2022 reply to you, Ibve been refining my code that deals with this sort of thing. I now define bouter-tag-typeb and binner-tag-typeb values for each DITA element that specifies what type of element it expects at its exterior and interior boundaries: <xsl:variab . . . Read full entry » Re: Looking for a cleaner way of auditing table cell dPosted 3/10/2023 9:10:38 PMHi, Just noting, this is crying out for Schematron, which takes care of the infrastructure and leaves the test. Indeed, thinking about how the Schematron looks may also lead to a nicer XSLT solution. Cheers, Wendell On Thu, Mar 9, 2023 at 7:38b/PM Bauman, Syd s.bauman@xxxxxxxxxxxxxxxx < xsl . . . Read full entry » Re: Looking for a cleaner way of auditing table cell dPosted 3/10/2023 12:38:19 AM> I can't construct the schema so that this is illegal while the earlier examples are valid. At least I don't think I can. Why not? (Because you are not allowed to change the schema, or because your schema language cannot express this constraint?) Cant do this in the XML DTD language, of cour . . . Read full entry » Re: Looking for a cleaner way of auditing table cell dPosted 3/10/2023 12:02:17 AMI can second the recommendation for BaseX as a tool here: itbs easy to install, it supports XML catalogs out of the box, and you can just point it at a directory and load it up quick and easy. If you donbt need DTD-aware parsing itbs really fast. For example, on our corpus of about 40K DITA doc . . . Read full entry » Re: Looking for a cleaner way of auditing table cell dPosted 3/9/2023 11:29:56 PMo;?If you have a substantial library of documents you want to report on, I would suggest you use an XQuery database like BaseX or eXist that indexes the documents of the work with your XPath selector.If I understand your question, this should select tables with a td with significant (i.e. non white . . . Read full entry » Re: Selecting elements from source document based onPosted 3/6/2023 5:03:51 PM> Thank you Liam, that approach has cut the execution time by about 75%. I'll try Dr Kay's suggestion next and see if that saves any more (although we are using Saxon and he kinda hinted that Saxon would have optimised this already!) > Only if you're using Saxon-EE. Michael Kay Saxonica . . . Read full entry » Re: Selecting elements from source document based onPosted 3/6/2023 4:48:11 PMThank you Liam, that approach has cut the execution time by about 75%. I'll try Dr Kay's suggestion next and see if that saves any more (although we are using Saxon and he kinda hinted that Saxon would have optimised this already!) There's typically less than a dozen paths in the list, so O(nB2) . . . Read full entry » Re: Selecting elements from source document based onPosted 3/6/2023 8:45:27 AM> So, given > <xsl:variable name-"paths-to-match" as="xs:string*" > select="doc('checkpaths.xml')/checkpaths/path" /> > > you can use > /log/logentry[paths/path = $paths=to-match] > > This is O(nB2) on the number of paths, Not if you use . . . Read full entry » Re: Selecting elements from source document based onPosted 3/6/2023 5:36:29 AMOn Mon, 2023-03-06 at 03:12 +0000, Trevor Nicholls trevor@xxxxxxxxxxxxxxxxxx wrote: > > > I would like to produce an output document which consists of a log > containing all the log entries where at least one of the logentry > paths > matches a path in the checkpaths document, and . . . Read full entry » Re: having a template remember not to call itself agaiPosted 3/6/2023 4:33:57 AMWhen I've reached such quandaries in the past, every time, without exception, I eventually learn that I had been overthinking/overengineering the problem. Some time off from the project helps me find a simpler, more elegant approach. Sometimes I replicate the problem on paper or with playing ca . . . Read full entry » Re: Selecting elements from source document based onPosted 3/6/2023 3:51:42 AMOn Mon, Mar 06, 2023 at 03:12:08AM -0000, Trevor Nicholls trevor@xxxxxxxxxxxxxxxxxx scripsit: > The requirement (preferably XSL 2) is to filter a log of source code edits by > a list of paths held in a separate document. I can't believe there's not an > elegant way of doing this in XSL bu . . . Read full entry » Selecting elements from source document based on matchPosted 3/6/2023 3:12:01 AMGreetings The requirement (preferably XSL 2) is to filter a log of source code edits by a list of paths held in a separate document. I can't believe there's not an elegant way of doing this in XSL but I haven't yet managed to find one. For example, given an input document which contains th . . . Read full entry » Re: having a template remember not to call itself agaiPosted 3/5/2023 6:18:16 PMWith all due respect, this seems most likely the result of messy design/algorithm. There is nothing wrong in general to have the same template called many times in a chain of calls. And due to XSLT being a functional language, recursion is one often-used practice. Also, there are many examples wh . . . Read full entry » Re: having a template remember not to call itself agaiPosted 3/5/2023 5:52:47 PMMy instinct when writing a pipeline with multiple steps is to use different modes in each step. I wouldn't characterise fn:transform() as a replacement for modes. I would use it only where one transformation needs to invoke another dynamically. Michael Kay Saxonica > On 5 Mar 2023, at 16:20, . . . Read full entry » Re: having a template remember not to call itself agaiPosted 3/5/2023 5:05:47 PMOn Sun, Mar 05, 2023 at 04:56:56PM -0000, Martin Honnen martin.honnen@xxxxxx scripsit: > > Am 3/5/2023 um 5:40 PM schrieb Graydon graydon@xxxxxxxxx: > > The XSLT 3 approach is the transform function, where you write > > individual stylesheets for each step and call them: > > . . . Read full entry » Re: having a template remember not to call itself agaiPosted 3/5/2023 4:56:50 PMAm 3/5/2023 um 5:40 PM schrieb Graydon graydon@xxxxxxxxx: The XSLT 3 approach is the transform function, where you write individual stylesheets for each step and call them: <xsl:variable name="pass1" as="document-node()"> <xsl:sequence select=" . . . Read full entry » Re: having a template remember not to call itself agaiPosted 3/5/2023 4:40:00 PMOn Sun, Mar 05, 2023 at 04:20:36PM -0000, Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx scripsit: > Is there a more elegant way to handle this that am missing? In XSLT, the order of execution is not known. The result document will be ordered so that the document order of the res . . . Read full entry » Re: having a template remember not to call itself agaiPosted 3/5/2023 4:32:11 PMHi Chris, Michael Kay proposed a way to check (tunnel) parameters when matching in XSLT 4.0: https://github.com/qt4cg/qtspecs/issues/108 We have often used tunnel parameters like $already-processed and xsl:choose that do or do not something based on their values. Michael's proposal can make th . . . Read full entry » having a template remember not to call itself againPosted 3/5/2023 4:20:28 PMHi everyone, I have a stylesheet with many templates that must all chain together and play nice with each other. So I write them in the following form: <xsl:template match="CONDITION1_HERE"> <!-- apply this template's processing first --> <xsl:variable name=&qu . . . Read full entry » XSL-List GuidelinesPosted 3/1/2023 4:03:28 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: cleanup of <div>-elementsPosted 2/27/2023 5:40:22 PMHi, I concur with what Mike Kay says indeed I think it's super important (a phrasing I would not have used in 2003). It's also important to note that projects such as XSpec make it possible to unit test XSLT this way, when without XPec or something like it, unit testing is dauntingly complex for . . . Read full entry » Re: cleanup of <div>-elementsPosted 2/27/2023 5:22:12 PM> In XSLT it is often easy to implement if it is easy to define. Indeed, this applies to any language. But XSLT does have an advantage here, which is that you can incrementally add rules as you discover more and more oddities in the input. If you're dealing with a large number of input files th . . . Read full entry » Re: cleanup of <div>-elementsPosted 2/27/2023 5:12:57 PMHi Monika, The reason Chris asks his question is that this will impact how good your solution can be. In XSLT it is often easy to implement if it is easy to define. The question here is whether you can easily and deterministically distinguish between a div element that should become a p, and one . . . Read full entry » Re: cleanup of <div>-elementsPosted 2/27/2023 4:39:17 PMHi Monika, Will the content between headings always be limited to known "block-level" element types (p, ol, ul, etc.)? * Chris From: Madlik, Monika (LNG-VIE) monika.madlik@xxxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Sent: Monday, February 27, 2023 11:31 AM To: xs . . . Read full entry » cleanup of <div>-elementsPosted 2/27/2023 4:30:52 PMHi, I have a problem with an XML-file that has to be converted. I get XML-files that are semi-structured. So I have the h1/h2-information in it and also tables, lists, ... Paragraphs are tagged with <p> - but not always. Sometimes <p> is missing and instead of it a weird construct of . . . Read full entry » Re: inserting a child element while honoring the parenPosted 2/25/2023 2:10:56 AMHere is an input document: <?xml version="1.0" encoding="utf-8" ?> <topic> <title>My Topic</title> <prolog> <author>chrispy</author> </prolog> <body><p>Hello!</p></body> </topic> and a . . . Read full entry » Re: inserting a child element while honoring the parenPosted 2/25/2023 2:05:26 AMHi everyone, Here is a template to perform content-model-aware element insertion (more to come): <!-- perform content-aware insertion on an element --> <xsl:template match="*" mode="insert-stuff"> <xsl:param name="path" as="xs:string*&quo . . . Read full entry » Re: A beautiful way to populate a variable with N blanPosted 2/24/2023 4:30:28 PMA static way to do this (even in XPath 1.0) is when you know an upper bound for N. Say N <= 1000, then you have a variable: <xsl:variable name="longBlanks" select="' '" /> <!-- 1000 spaces there --> Then we construct any needed such value simply as: . . . Read full entry » Re: A beautiful way to populate a variable with N blanPosted 2/24/2023 3:18:33 PMHi Chiris > That being said, I still enjoy seeing clever uses of the "!" operator! Yes, I also agreed! On 2/25/2023 12:05 AM, Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx wrote: > Hi Makita-san, > > > > That is the form I was about to post too. Marti . . . Read full entry » Re: A beautiful way to populate a variable with N blanPosted 2/24/2023 3:17:44 PM<xsl:variable name="temp" select="string-join((1 to $N)!' ')"/> seems to me the cleanest way of doing it. Michael Kay Saxonica > On 24 Feb 2023, at 14:44, Roger L Costello costello@xxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > > Hi Folks, & . . . Read full entry » Re: A beautiful way to populate a variable with N blanPosted 2/24/2023 3:11:56 PMNot particularly beautiful, but concise: codepoints-to-string((1 to $N)!32) On 24.02.2023 16:04, Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx wrote: Hi Makita-san, That is the form I was about to post too. Martin's suggestion is a novel use of the "!" operator, but my . . . Read full entry » Re: A beautiful way to populate a variable with N blanPosted 2/24/2023 3:04:53 PMHi Makita-san, That is the form I was about to post too. Martin's suggestion is a novel use of the "!" operator, but my OCD seems to not like generating data that is never meaningfully used. Although longer, I feel the "for" loop's intent is a bit easier for future novices to f . . . Read full entry » Re: A beautiful way to populate a variable with N blanPosted 2/24/2023 2:59:18 PMHow about the following? <xsl:variable name="blanks" as="xs:string" select="string-join(for $i in 1 to $N return (' '), '')"/> On 2/24/2023 11:44 PM, Roger L Costello costello@xxxxxxxxx wrote: Hi Folks, $N contains an integer. $blanks is a string variable. T . . . Read full entry » Re: A beautiful way to populate a variable with N blanPosted 2/24/2023 2:48:35 PMAm 2/24/2023 um 3:44 PM schrieb Roger L Costello costello@xxxxxxxxx: Hi Folks, $N contains an integer. $blanks is a string variable. The string is to consist of $N blanks (space characters). Below is one way to populate $blanks. It's an awful solution. Is there a beautiful (simple) solution? < . . . Read full entry » A beautiful way to populate a variable with N blanks?Posted 2/24/2023 2:43:52 PMHi Folks, $N contains an integer. $blanks is a string variable. The string is to consist of $N blanks (space characters). Below is one way to populate $blanks. It's an awful solution. Is there a beautiful (simple) solution? <xsl:variable name="tmp" as="xs:string+"> . . . Read full entry » Re: inserting a child element while honoring the parenPosted 2/23/2023 10:31:00 AMHi Vincent, Wendell, Michael, Hey, that is pretty slick! I had noticed the similarity of the compact RelaxNG<https://www.oasis-open.org/committees/relax-ng/compact-20021121.html> format to regex, but it didnbt click with me that the regex engine itself could be pressed into service for cont . . . Read full entry » Re: inserting a child element while honoring the parenPosted 2/22/2023 9:03:16 PMHi Chris, The idea was from Rick Jelliffe, although I donbt have the exact citation now. Here is a small example: A content model expressed in a RelaxNG-like syntax: <contexts> <context>contrib-group</context> </contexts> <model&g . . . Read full entry » Re: inserting a child element while honoring the parenPosted 2/22/2023 8:47:45 PMChris, The trick is essentially to represent the sequence of elements as a string ...' h1 p p p p h2 p p p p h3 p h1 p p'. Your regex then captures the logic of the content model enforced on this sequence as a pattern over the string. Was it Rick Jelliffe we borrowed this idea from? If not it was . . . Read full entry » Re: inserting a child element while honoring the parenPosted 2/22/2023 8:46:49 PM> On 22 Feb 2023, at 20:38, Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > > Hi Vincent, Wendell, > > I am interested in understanding how regular expressions are used to check/enforce content models. Could you he . . . Read full entry » Re: inserting a child element while honoring the parenPosted 2/22/2023 8:37:47 PMHi Vincent, Wendell, I am interested in understanding how regular expressions are used to check/enforce content models. Could you help me understand this, perhaps with a simple example? * Chris From: Lizzi, Vincent vincent.lizzi@xxxxxxxxxxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxx . . . Read full entry » Re: inserting a child element while honoring the parenPosted 2/22/2023 8:34:49 PM>> With respect to *testing* against (not processing in view of) content models - I hesitate to mention it but there is the approach of writing out the sequence of element names as a string and then testing that against a regex mapped out from the content model. One of several problems with t . . . Read full entry » Re: inserting a child element while honoring the parenPosted 2/22/2023 1:14:59 PMMike, So interesting! Thank you. The list never ceases to deliver up treasures. Cheers, Wendell On Wed, Feb 22, 2023 at 4:37 AM Michael Kay michaelkay90@xxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > > > > With respect to *testing* against (not processing in vi . . . Read full entry » Re: inserting a child element while honoring the parenPosted 2/22/2023 9:37:26 AM> With respect to *testing* against (not processing in view of) content models - I hesitate to mention it but there is the approach of writing out the sequence of element names as a string and then testing that against a regex mapped out from the content model. One of several problems with this . . . Read full entry » Re: inserting a child element while honoring the parenPosted 2/21/2023 11:09:08 PMHey Chris (writing from a different address here), Exactly - I think we already touched on this thread how the union operator (a|b|c) has the effect of sorting in document order? In passing I am noting the difference between (a|b|c)[1]/(.|preceding-sibling::node()) and without that [1] position . . . Read full entry » Re: inserting a child element while honoring the parenPosted 2/21/2023 5:52:46 PMHi Wendell, That's mostly what I did in this template: <!-- add <j> to <topic>, honoring the following content model: topic = a?, b?, c?, j, x?, y?, z?, topic* --> <xsl:template match="topic[not(j)]" mode="add-j"> <xsl:variable name= . . . Read full entry » Re: inserting a child element while honoring the parenPosted 2/21/2023 3:35:29 PMChris, How about (.|preceding-sibling::node), as in $fromhere/(.|preceding-sibling::node()) ? Also useful for counting, as in count(self::h1|preceding-sibling::h1). Cheers, Wendell From: Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> . . . Read full entry » Re: inserting a child element while honoring the parenPosted 2/20/2023 8:28:59 PMHi Eliot, I hadn't known about these operators, thank you! I couldn't see a clean way to use "<<" for a preceding-sibling-or-self:: axis for this specific case, but I will definitely keep these operators in mind for future DiTA processing tasks. * Chris From: Eliot Kimber . . . Read full entry » Re: inserting a child element while honoring the parenPosted 2/20/2023 4:19:06 PMI dont know that its a better solution, but I often use milestone nodes and the << and >> operators to position things: <xsl:variable name=fromHere as=element() select=p[1]/> <xsl:variable name=beforeParaNodes as=node()* select=node()[. << $fromHere]/ . . . Read full entry » Re: How to 'execute' a table without manually convertiPosted 2/20/2023 2:03:20 AMOn Sun, 2023-02-19 at 18:21 +0000, Roger L Costello costello@xxxxxxxxx Alas, as you > know, Microsoft Word tables cannot be embedded into XSLT programs. Well, since these days they are encoded in XML in the Word files, they actually can. In practice nested maps or an xsl:choose or an element s . . . Read full entry » Re: How to 'execute' a table without manually convertiPosted 2/19/2023 6:31:18 PMHi Roger, This can all be expressed as nested maps, and for the "else" part we need to approve and in clude in XPath 4.0 my proposal for "Total Maps" : https://github.com/qt4cg/qtspecs/issues/105 Thanks, Dimitre On Sun, Feb 19, 2023 at 10:20 AM Roger L Costello costello@xxxx . . . Read full entry » Re: How to 'execute' a table without manually convertiPosted 2/19/2023 6:28:15 PMOn Sun, Feb 19, 2023 at 06:20:34PM -0000, Roger L Costello costello@xxxxxxxxx scripsit: > By "better" I mean more assuredness that the code > faithfully/accurately encodes the table. First thing is "is there a function already?" For example, there's no general printf in . . . Read full entry » How to 'execute' a table without manually converting iPosted 2/19/2023 6:20:27 PMHi Folks, The UNIX shell has a printf command. Here's an example: printf "A string %s and a number %d" hello 10 The "..." part is called the format string. Following the format string are arguments. The %s indicates that the first argument (hello) is a string. The %d indicates t . . . Read full entry » inserting a child element while honoring the parent ePosted 2/19/2023 4:30:21 PMHi everyone, I needed to insert a child element while honoring the parent element's content model. The solution took me some time to figure out, so I thought I'd share it here. Consider a <topic> element with the following content model: topic = a?, b?, c?, j?, x?, y?, z?, topic* Given th . . . Read full entry » Re: learned a lesson about XPath variable evaluationsPosted 2/17/2023 1:46:45 AMOn Thu, 2023-02-16 at 23:34 +0000, Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx wrote: > > But if I move the text() evaluation from the <xsl:variable> to the > <xsl:value-of>, then I get "123" instead: As an aside, watch that many people (i don't know . . . Read full entry » Re: Followup question: was Re: XSLT to populate a SAMLPosted 2/17/2023 1:42:02 AMHi, PERFECT :)! I had one attempt where I was close to your first suggestion, but I didn't realized I needed the "//" after the "adrRecord". Thanks, Jim On Thursday, February 16, 2023, 07:13:54 PM EST, Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx <x . . . Read full entry » Re: learned a lesson about XPath variable evaluationsPosted 2/17/2023 12:21:28 AMWe really should be encouraging everyone to use "!" instead of "/" far more often. It's simpler and usually better. Michael Kay Saxonica > On 16 Feb 2023, at 23:34, Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> . . . Read full entry » Re: Followup question: was Re: XSLT to populate a SAMLPosted 2/17/2023 12:13:35 AMHi Jim, I think that would be either of these; <xsl:template match="adrRecord//*[not(*)]"> <xsl:template match="*[not(*)][ancestor::adrRecord]"> Ibd prefer the first form in this case. * Chris From: ohaya ohaya@xxxxxxxxx <xsl-list-service@xxxxxxxxxxxxx . . . Read full entry » Re: Followup question: was Re: XSLT to populate a SAMLPosted 2/17/2023 12:05:33 AMHi, Arrgh :(!! I think that my English translation was incorrect :(.... To be more correct, precise, I actually want all the elements that are not JUST DIRECTLY under/in "adrRecord", but ANYWHERE under/in "adrRecord". My apologies for that :(!! I ran through the suggestion . . . Read full entry » learned a lesson about XPath variable evaluations sortPosted 2/16/2023 11:34:01 PMHi everyone, Given the following input: <?xml version="1.0" encoding="utf-8" ?> <root> <data>1</data> <group> <data>2</data> <group> <data>3</data> <results> <!-- put ancestor . . . Read full entry » Re: Followup question: was Re: XSLT to populate a SAMLPosted 2/16/2023 11:21:29 PMOn Thu, 2023-02-16 at 23:10 +0000, ohaya ohaya@xxxxxxxxx wrote: > B Hi, > > <xsl:template match="*[not(*)] and name(..)='adrRecord'"> You're missing a ] <xsl:template match="*[not(*)] and (name(..) eq 'adrRecord')]"> is probably what i'd write. or, <xs . . . Read full entry » Re: Followup question: was Re: XSLT to populate a SAMLPosted 2/16/2023 11:19:28 PMOh! And <xsl:template match="adrRecord/*[not(*)]"> * Chris From: Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Sent: Thursday, February 16, 2023 6:18 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: Followup . . . Read full entry » Re: Followup question: was Re: XSLT to populate a SAMLPosted 2/16/2023 11:17:50 PMHi Jim, Try this: <xsl:template match="*[not(*)][parent::adrRecord]"> When you stack predicates (the [b&] thingies), they become AND conditions because each filters the sequence as evaluation processes the predicates in rightward order. These might also work (not tes . . . Read full entry » Re: Followup question: was Re: XSLT to populate a SAMLPosted 2/16/2023 11:15:44 PMOn Thu, Feb 16, 2023 at 11:09:57PM -0000, ohaya ohaya@xxxxxxxxx scripsit: > I think that I NOW need something like: > > "it matches any element node not having element node children AND > having parent element named "adrRecord" [snip] > <xsl:template match="*[ . . . Read full entry » Re: Followup question: was Re: XSLT to populate a SAMLPosted 2/16/2023 11:09:50 PMHi, . . . Read full entry » Re: Regular expression to exclude filesPosted 2/16/2023 9:31:34 PMNegative lookahead is the term I was looking for and hadnt found in the XSD and XPath regex discussions. As far as I can tell, j is not a flag for XPath matches() but in any case the Saxon collection URI syntax doesnt appear to provide a way to specify flags as for matches(). Cheers, E. ____ . . . Read full entry » Re: Regular expression to exclude filesPosted 2/16/2023 8:48:25 PMNot going to do that. With the collection() function I can use a predicate to filter the resulting metadata maps: let $family := 'utah', $collectionUri := environment-variable('HOME') || '/git/' || $family || '/doc/source' || '?metadata=yes' || '&match=' || encode-for-uri('.+\.ditamap'), . . . Read full entry » Re: Regular expression to exclude filesPosted 2/16/2023 8:43:36 PMHi Eliot, Normally I would use a negative lookahead for this, which requires the ";j" flag for match(): matches(., '^(?!foo|bar).*\.dita', ';j') The documentation at https://www.saxonica.com/documentation12/#!sourcedocs/collections/collection- directories suggests that collection() u . . . Read full entry » Re: Regular expression to exclude filesPosted 2/16/2023 8:39:58 PMOn Thu, 16 Feb 2023 at 20:37, David Carlisle d.p.carlisle@xxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > On 16/02/2023 20:30, Eliot Kimber eliot.kimber@xxxxxxxxxxxxxx wrote: > > want to match all files with a given extension except those that start > with bfoob o . . . Read full entry » Re: Regular expression to exclude filesPosted 2/16/2023 8:37:09 PMOn 16/02/2023 20:30, Eliot Kimber eliot.kimber@xxxxxxxxxxxxxx wrote: want to match all files with a given extension except those that start with bfoob or bbarb. classically that would be |[^fb]|f[^o]|fo[^o]|b[^a]||ba[^r]).*\.txt David XSL-List info and archive <http://www.mulberrytech. . . . Read full entry » Regular expression to exclude filesPosted 2/16/2023 8:30:32 PMIm using Saxons collection() extension that lets you specify a regular expression to select files within a directory. These are XPath regular expressions so my question is I think a general XPath question. I want to match all files with a given extension except those that start with foo or ba . . . Read full entry » Followup question: was Re: XSLT to populate a SAML AtPosted 2/16/2023 2:51:32 PMHi, It turns out that the incoming XML is slightly different than what I posted originally. It has some nodes before the "adrRecord" node, and the XSLT is picking up elements from inside those other nodes but we only want to produce attributes from inside/under the "adrRecord" . . . Read full entry » [ANN] Balisage 2023 - Call for ParticipationPosted 2/15/2023 4:55:30 PMCall for Participation "Balisage: The Markup Conference 2023b Balisage: where serious markup practitioners and theoreticians meet every summer What: an annual conference where we talk about markup, tools for creating and working with marked up documents, and projects that use markup What? X . . . Read full entry » Re: transforming XSLT files to use XSLT3 featuresPosted 2/11/2023 7:25:24 PMOn Sat, Feb 11, 2023 at 3:34 AM Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > For some reason, I donbt feel inclined to write an XPath grammar parser > in XSLT. But still, some low-hanging fruit can be obtained. > . . . Read full entry » Re: transforming XSLT files to use XSLT3 featuresPosted 2/11/2023 5:23:48 PMBecause XSLT files are themselves XML files, I've been intrigued by the idea of using XSLT to improve its own stylesheets. Two other comparable use-cases worth mentioning: 1. M Ricaud's XSLT-quality: https://github.com/mricaud/xslt-quality. Front-facing is the Schematron schema that can be used t . . . Read full entry » Re: transforming XSLT files to use XSLT3 featuresPosted 2/11/2023 12:39:34 PMAm 2/11/2023 um 12:57 PM schrieb John Lumley john@xxxxxxxxxxxx: On 11/02/2023 11:34, Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx wrote: The approach is limited by its use of template matches and regular expressions. For some reason, I donbt feel inclined to write an XPath grammar . . . Read full entry » Re: transforming XSLT files to use XSLT3 featuresPosted 2/11/2023 11:56:59 AMOn 11/02/2023 11:34, Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx wrote: The approach is limited by its use of template matches and regular expressions. For some reason, I donbt feel inclined to write an XPath grammar parser in XSLT. But still, some low-hanging fruit can be obta . . . Read full entry » transforming XSLT files to use XSLT3 featuresPosted 2/11/2023 11:34:28 AMHi everyone, Because XSLT files are themselves XML files, I've been intrigued by the idea of using XSLT to improve its own stylesheets. In the following DITA Open Toolkit enhancement: #4123: Use some XSLT 3.0 features https://github.com/dita-ot/dita-ot/issues/4123 I provide a stylesheet that pe . . . Read full entry » Re: is xslt "canonicalizable" can it be canonicalized?Posted 2/8/2023 11:24:16 AM> On 8 Feb 2023, at 09:28, Michael Kay mike@xxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > > Note also, John Lumley made an attempt to write an XSLT3-to-XSLT2 translator, which for example converted xsl:iterate to a recursive template. > > Dealing with all the . . . Read full entry » Re: is xslt "canonicalizable" can it be canonicalized?Posted 2/8/2023 10:17:49 AM> My motivation here is to be able to pre-process templates while not having to canonicalize the xslt myself in order to make sure.. for example, that I'm not going to have to handle those two (or many more) methods of doing the same thing with separate template matches in the pre-processor temp . . . Read full entry » Re: is xslt "canonicalizable" can it be canonicalized?Posted 2/8/2023 10:13:08 AM> On 8 Feb 2023, at 01:37, BR Chrisman brchrisman@xxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > > One example, inside a template: > <foo bar="baz"/> > and > <xsl:element name="foo"> > <xsl:attribute name="bar"& . . . Read full entry » Re: is xslt "canonicalizable" can it be canonicalized?Posted 2/8/2023 9:27:50 AMNote also, John Lumley made an attempt to write an XSLT3-to-XSLT2 translator, which for example converted xsl:iterate to a recursive template. Dealing with all the edge cases isn't easy. Michael Kay On 8 Feb 2023, at 08:37, Michael Kay mike@xxxxxxxxxxxx<mailto:mike@xxxxxxxxxxxx> <xsl-li . . . Read full entry » Re: is xslt "canonicalizable" can it be canonicalized?Posted 2/8/2023 8:37:11 AMThere certainly are constructs in XSLT that can be readily translated to other constructs statically (or in a pre-processing phase), and Saxon does this a lot: for example it effectively turns <xsl:if test="X">INST</xsl:if> into <xsl:choose> <xsl:when test=" . . . Read full entry » Re: is xslt "canonicalizable" can it be canonicalized?Posted 2/8/2023 8:05:04 AMOn Tue, Feb 7, 2023 at 9:06 PM Liam R. E. Quin liam@xxxxxxxxxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > On Wed, 2023-02-08 at 01:38 +0000, BR Chrisman brchrisman@xxxxxxxxx > wrote: > > transform. > > There are differences indeed, in the handling of namespac . . . Read full entry » Re: is xslt "canonicalizable" can it be canonicalized?Posted 2/8/2023 5:06:13 AMOn Wed, 2023-02-08 at 01:38 +0000, BR Chrisman brchrisman@xxxxxxxxx wrote: > One example, inside a template: > <foo bar="baz"/> > and > <xsl:element name="foo"> > B <xsl:attribute name="bar">baz</xsl:attribute> > </xsl:elem . . . Read full entry » is xslt "canonicalizable" can it be canonicalized?Posted 2/8/2023 1:37:39 AMOne example, inside a template: <foo bar="baz"/> and <xsl:element name="foo"> <xsl:attribute name="bar">baz</xsl:attribute> </xsl:element> are equivalent (*). (*) I might be missing something here in the example... possible, but my poin . . . Read full entry » Re: What is the Venn diagram for XPath, XQuery, and XPosted 2/2/2023 4:04:33 PMDimitre, We have to sign up for the holodeck VR XSL-List so we can see the diagram in more dimensions - Remember other languages embed XPath as well! Cheers, Wendell From: Dimitre Novatchev dnovatchev@xxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Sent: Wednesday, February 1, 2023 9: . . . Read full entry » Re: What is the Venn diagram for XPath, XQuery, and XPosted 2/2/2023 7:23:07 AMOn Thu, 2023-02-02 at 05:05 +0000, Joel Kalvesmaki director@xxxxxxxxxxxxx wrote: > Liam, I'm laughing so hard. But you forgot to show that the "e" is > shared by two of the three. an, all of "Query" should be in the overlap, oops! ;) Thanks for the bug report! > > . . . Read full entry » Re: What is the Venn diagram for XPath, XQuery, and XPosted 2/2/2023 6:22:06 AMOn Thu, 2023-02-02 at 05:05 +0000, Joel Kalvesmaki director@xxxxxxxxxxxxx wrote: > Liam, I'm laughing so hard. But you forgot to show that the "e" is > shared by two of the three. Haha, the e is part of bXQueryb :) -- Liam Quin,B https://www.delightfulcomputing.com/ Available fo . . . Read full entry » Re: What is the Venn diagram for XPath, XQuery, and XPosted 2/2/2023 5:04:45 AMLiam, I'm laughing so hard. But you forgot to show that the "e" is shared by two of the three. jk On 2023-02-01 17:14, Liam R. E. Quin liam@xxxxxxxxxxxxxxxx wrote: Venn diagram for XQuery, XPath, XQuery Update [1] https://www.holoweb.net/liam/download/xquery-xpath-xquery-update.jpg - . . . Read full entry » Re: What is the Venn diagram for XPath, XQuery, and XPosted 2/2/2023 2:44:17 AMLiam, Great. But this leaves no place for XSLT? :) Thanks, Dimitre On Wed, Feb 1, 2023 at 4:14 PM Liam R. E. Quin liam@xxxxxxxxxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > > Venn diagram for XQuery, XPath, XQuery Update > <https://www.holoweb.net/liam/download . . . Read full entry » Re: What is the Venn diagram for XPath, XQuery, and XPosted 2/2/2023 1:59:28 AMp$# On Wed, Feb 1, 2023 at 7:14 PM Liam R. E. Quin liam@xxxxxxxxxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > > Venn diagram for XQuery, XPath, XQuery Update > <https://www.holoweb.net/liam/download/xquery-xpath-xquery-update.jpg> > > https://www.holoweb . . . Read full entry » Re: What is the Venn diagram for XPath, XQuery, and XPosted 2/2/2023 12:52:55 AMLiam - On Wed, Feb 1, 2023, 7:14 PM Liam R. E. Quin liam@xxxxxxxxxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > > Venn diagram for XQuery, XPath, XQuery Update > <https://www.holoweb.net/liam/download/xquery-xpath-xquery-update.jpg> > > https://www.holowe . . . Read full entry » Re: What is the Venn diagram for XPath, XQuery, and XPosted 2/2/2023 12:14:00 AMVenn diagram for XQuery, XPath, XQuery Update https://www.holoweb.net/liam/download/xquery-xpath-xquery-update.jpg -- Liam Quin,B https://www.delightfulcomputing.com/ Available for XML/Document/Information Architecture/XSLT/ XSL/XQuery/Web/Text Processing/A11Y training, work & consulting. B . . . Read full entry » Re: What is the Venn diagram for XPath, XQuery, and XPosted 2/1/2023 9:20:37 PMMichele, Roger and XSL-List, We could ask a bot to draw us an SVG and watch it lie like a dog. (A happy dog but still a dog.) One key to understanding the subtlety of the question is that XPath and XQuery have both syntactic and semantic aspects. So for example we have a situation where XPath 2.0 . . . Read full entry » Re: Re: What is the Venn diagram for XPath, XQuery, aPosted 2/1/2023 8:29:17 PMOn 2/1/2023 9:05 PM, Roger L Costello costello@xxxxxxxxx wrote: Thanks Martin for the pointer to the Saxon web page on XQuery Update. That web page says this: --------------------------------------------- Saxon implements XQuery Update Facility 1.0, which reached Recommendation status on 17 March . . . Read full entry » Re: Re: What is the Venn diagram for XPath, XQuery, aPosted 2/1/2023 8:05:33 PMThanks Martin for the pointer to the Saxon web page on XQuery Update. That web page says this: --------------------------------------------- Saxon implements XQuery Update Facility 1.0, which reached Recommendation status on 17 March 2011. All features, including optional features, are implemented. . . . Read full entry » Re: Re: What is the Venn diagram for XPath, XQuery, anPosted 2/1/2023 7:49:43 PMOn 2/1/2023 8:47 PM, Roger L Costello costello@xxxxxxxxx wrote: Michael Kay responded to my StackOverflow post [1]: XQuery Update 3.0 is only a WG Note - it's unfinished work. The main new feature relative to 1.0, namely allowing an expression to return both a result and a pending update list, pro . . . Read full entry » Re: What is the Venn diagram for XPath, XQuery, and XPosted 2/1/2023 7:47:11 PMMichael Kay responded to my StackOverflow post [1]: XQuery Update 3.0 is only a WG Note - it's unfinished work. The main new feature relative to 1.0, namely allowing an expression to return both a result and a pending update list, proved controversial and I think it basically hit a block where the . . . Read full entry » Re: What is the Venn diagram for XPath, XQuery, and XPosted 2/1/2023 3:43:12 PMBut where is the actual diagram? :) Sent from Nine<http://www.9folders.com/> ________________________________ From: "Joe Wicentowski joewiz@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Sent: Wednesday, February 1, 2023 8:55 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subj . . . Read full entry » Re: What is the Venn diagram for XPath, XQuery, and XPosted 2/1/2023 2:56:09 PMAm 2/1/2023 um 2:04 PM schrieb Roger L Costello costello@xxxxxxxxx: Note: in all of the following, when I refer to "XQuery" I mean the latest version of XQuery. Ditto for XQuery Update. [True or False] XQuery is a superset of XPath. That is, the XQuery language consists of all the stuff i . . . Read full entry » Re: What is the Venn diagram for XPath, XQuery, and XPosted 2/1/2023 2:54:56 PMHi Roger, I posted an answer to the question you cross-posted to Stack Overflow: https://stackoverflow.com/questions/75311657/what-is-the-venn-diagram-for-xpath-xquery-and-xquery-update Joe On Wed, Feb 1, 2023 at 8:04 AM Roger L Costello costello@xxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxx . . . Read full entry » XSL-List GuidelinesPosted 2/1/2023 2:04:32 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 » What is the Venn diagram for XPath, XQuery, and XQueryPosted 2/1/2023 1:04:06 PMHi Folks, Note: in all of the following, when I refer to "XQuery" I mean the latest version of XQuery. Ditto for XQuery Update. [True or False] XQuery is a superset of XPath. That is, the XQuery language consists of all the stuff in XPath plus more. Eek! I didn't specify the version of . . . Read full entry » Re: matches() method in XPath 1.0Posted 1/31/2023 9:35:15 AMThe spec seems to have been written to allow implementations to support later XPath versions; whether any actual implementations have taken advantage of that extensibility is another question. Michael Kay Saxonica On 31 Jan 2023, at 02:37, Bauman, Syd s.bauman@xxxxxxxxxxxxxxxx<mailto:s.bauman@ . . . Read full entry » Re: matches() method in XPath 1.0Posted 1/31/2023 4:53:29 AMhttps://stackoverflow.com/a/11857166/36305 This XPath 2.0 expression: ends-with($s, $t) Has this equivalent in XPath 1.0: $t = substring($s, string-length($s) - string-length($t) +1) Thanks, Dimitre On Mon, Jan 30, 2023 at 3:30 PM Manuel Souto Pico terminolator@xxxxxxxxx < xsl-list-ser . . . Read full entry » Re: matches() method in XPath 1.0Posted 1/31/2023 2:37:32 AMWhile I am not confident about it, I am not convinced that ITS does not permit use of XPath 2.0. Why else is the @queryLanguage attribute of the <rules> element defined as ( "xpath" | "css" | text )b unless you are permitted to use values other than "xpath" (whi . . . Read full entry » Re: matches() method in XPath 1.0Posted 1/31/2023 12:25:06 AMManuel. XPath 1.0 is pretty limited, but you might be able to accomplish your goal with something like substring-before($filename,$suffix) and not(substring-after($filename,$suffix)) There is no ends-with() in XPath 1.0, regrettably, so one has to concoct one. But I'm not sure about how to do t . . . Read full entry » matches() method in XPath 1.0Posted 1/30/2023 11:30:20 PMDear all, I have a simple question, hopefully someone can help. Given some nodes like this: <text>Some text.</text> <text>foo.svg</text> in XPath 2.0 I can match the ones (like the second) that contain a file name with something like //text[matches(text(), '[^\s]*\.(svg . . . Read full entry » Re: Re: Creating sequence/range text from positionPosted 1/29/2023 2:47:35 AMHere is a pure XPath 3.1 (that means also XQuery) solution. The bulk of the logic is in the function $compactInner, which is just 24 lines. let $doc := <article> <p>Case 1 is <xref ref-type="bibr" rid="r2"/></p> <p>Case 2 is <xref ref-t . . . Read full entry » Re: cursed RTF outputsPosted 1/28/2023 5:46:26 PMMartin Honnen, your analyze-string solution worked perfectly. Thank you! Michael Kay, you are very right about needing to look at the bytes. In the case of RTF I wasn't grocking that this actually needed character map translations - it wasn't enough to simply declare an encoding and process it. A . . . Read full entry » Re: cursed RTF outputsPosted 1/28/2023 5:24:34 PM2004? Rather older than that... So long as we use multiple character encodings, and don't have reliable metadata saying what encoding a file or data transfer is using, this problem will always be with us. And the methodology for solving it will always be the same as it always was: follow the data . . . Read full entry » Re: cursed RTF outputsPosted 1/28/2023 5:07:55 PM>The answer in https://stackoverflow.com/questions/55439948/xslt-convert-specific-characters -of-a-string-individually-to-a-string-includin using a character map or a function to convert e.g. C$ to \'E4 might help. Indeed it seems I will have to do character mapping. Thanks for your very useful . . . Read full entry » Re: cursed RTF outputsPosted 1/28/2023 4:58:52 PMAm 1/28/2023 um 5:43 PM schrieb Jean-Paul Rehr rehrjb@xxxxxxxxx: > Sorry, I confusedB Windows-1250 andWindows-1252.B Windows-1252 does work > for my character set (French). NotwithstandingB that, the > outputB results when opened in rtf do not show up correctly. > > The answer in ht . . . Read full entry » Re: Creating sequence/range text from positionPosted 1/28/2023 4:50:50 PMThanks Vincent, and great to see you at NISO meetings! This works great! I will now spend a couple hours figuring out how you did it (or trying to), because that's how I've learned the little XSLT that I know. Best, Charles From: Lizzi, Vincent vincent.lizzi@xxxxxxxxxxxxxxxxxxxx <xsl-list-ser . . . Read full entry » Re: cursed RTF outputsPosted 1/28/2023 4:50:28 PMAm 1/28/2023 um 5:43 PM schrieb Jean-Paul Rehr rehrjb@xxxxxxxxx: > Sorry, I confusedB Windows-1250 andWindows-1252.B Windows-1252 does work > for my character set (French). NotwithstandingB that, the > outputB results when opened in rtf do not show up correctly. How do you open it exactl . . . Read full entry » Re: cursed RTF outputsPosted 1/28/2023 4:42:51 PMSorry, I confused Windows-1250 and Windows-1252. Windows-1252 does work for my character set (French). Notwithstanding that, the output results when opened in rtf do not show up correctly. On Sat, Jan 28, 2023 at 5:31 PM Martin Honnen martin.honnen@xxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxx . . . Read full entry » Re: cursed RTF outputsPosted 1/28/2023 4:30:41 PMAm 1/28/2023 um 5:23 PM schrieb Jean-Paul Rehr rehrjb@xxxxxxxxx: > It seems I am stuck in 2004 problems. > > I am trying to get an RTF-compliant output from XSLT (3.0) but as > usual, like back in the old mailing lists, characters aren't coming > through. Has this been solved with a . . . Read full entry » cursed RTF outputsPosted 1/28/2023 4:23:16 PMIt seems I am stuck in 2004 problems. I am trying to get an RTF-compliant output from XSLT (3.0) but as usual, like back in the old mailing lists, characters aren't coming through. Has this been solved with a particular encoding yet? My test situation is with this node: <node>C) C( C B( B . . . Read full entry » Re: Creating sequence/range text from positionPosted 1/28/2023 5:50:00 AMHi Charles, Here is a slightly improved version that produces the expected output from your sample input and also copes with a case of the id's listed in @rid not being in sequential order. <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http:// . . . Read full entry » Re: Creating sequence/range text from positionPosted 1/28/2023 5:05:07 AMHi Charles, I think this produces the output that you are expecting. <?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 . . . Read full entry » Creating sequence/range text from positionPosted 1/28/2023 12:04:14 AMHi all, We use a word processor-like XML editor that presents users with generated text for numbered bibliographic references and their in-text citations. However, downstream systems require actual text to be placed. Question is, how do we get it? (Using SaxonEE 10.x) Given <article> . . . Read full entry » Re: New XSLT NOT WORKING was Re: XSLT to populate a SAPosted 1/22/2023 1:54:29 PMI would write not(*) as empty(*) but it means the same thing: <xsl:template match=*[empty(*)]> Cheers, E. _____________________________________________ Eliot Kimber Sr Staff Content Engineer O: 512 554 9368 M: 512 554 9368 servicenow.com<https://www.servicenow.com> LinkedIn<htt . . . Read full entry » Re: New XSLT NOT WORKING was Re: XSLT to populate a SAPosted 1/22/2023 12:04:12 PMMichael et al, Thanks! You all have been super patient with all my questions! Jim On Sunday, January 22, 2023, 05:55:43 AM EST, Michael Kay mike@xxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: I tend to prefer writing this as match="*[not(child::*)]" becaus . . . Read full entry » Re: New XSLT NOT WORKING was Re: XSLT to populate a SAPosted 1/22/2023 10:55:23 AMI tend to prefer writing this as match="*[not(child::*)]" because I think it's clearer to readers who aren't expert. Michael Kay Saxonica On 22 Jan 2023, at 07:28, Martin Honnen martin.honnen@xxxxxx<mailto:martin.honnen@xxxxxx> <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx<mail . . . Read full entry » Re: New XSLT NOT WORKING was Re: XSLT to populate a SAPosted 1/22/2023 7:36:26 AMIt will match an element that has no child elements. On Sat, Jan 21, 2023 at 11:19 PM ohaya ohaya@xxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > Hi, > > I was wondering if someone could explain what: > > <xsl:template match="*[not(*)]"> > > . . . Read full entry » Aw: Re: New XSLT NOT WORKING was Re: XSLT to populatePosted 1/22/2023 7:28:03 AMYes, kind of, it matches any element node not having element node children. -- Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.Am 22.01.23, 08:19 schrieb "ohaya ohaya@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>: Hi, I was wondering if some . . . Read full entry » Re: New XSLT NOT WORKING was Re: XSLT to populate a SAPosted 1/22/2023 7:19:11 AMHi, I was wondering if someone could explain what: <xsl:template match="*[not(*)]"> does? Is that not(*) checking for non-empty nodes? Thanks, Jim On Saturday, January 21, 2023, 05:00:18 AM EST, Martin Honnen martin.honnen@xxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxx . . . Read full entry » Re: New XSLT NOT WORKING was Re: XSLT to populate a SAPosted 1/21/2023 3:32:57 PMJim, "Hidden XSLT" is an interesting thing to call it. What is being referred to by this is the implicit or default behaviors that are wired into an XSLT processor, that do things on your behalf without your asking for it. This is both a blessing and (of course) a curse. To avoid havin . . . Read full entry » Re: New XSLT NOT WORKING was Re: XSLT to populate a SAPosted 1/21/2023 2:34:21 PMHi Martin, Thanks! I was trying to find that function (without knowing it's name, or how to use it exactly). I will test today. Jim On Saturday, January 21, 2023, 05:00:18 AM EST, Martin Honnen martin.honnen@xxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: Am 1/21/2023 um 1 . . . Read full entry » Re: New XSLT NOT WORKING was Re: XSLT to populate a SAPosted 1/21/2023 9:59:58 AMAm 1/21/2023 um 10:02 AM schrieb ohaya ohaya@xxxxxxxxx: Hi, I was wondering, is it possible to add a condition to this: <xsl:template match="/record/adrRecord/*"> for only if the node has no value? If it is possible, how to do that, and also do you all think this would fix the p . . . Read full entry » Re: New XSLT NOT WORKING was Re: XSLT to populate a SAPosted 1/21/2023 9:02:19 AMHi, I was wondering, is it possible to add a condition to this: <xsl:template match="/record/adrRecord/*"> for only if the node has no value? If it is possible, how to do that, and also do you all think this would fix the problem that is happening? Thanks, Jim On Saturd . . . Read full entry » Re: New XSLT NOT WORKING was Re: XSLT to populate a SAPosted 1/21/2023 8:09:15 AMHi, Please ignore the last part of what I said about having the "extraneous data" problem when I ran the XSLT with a larger XML that I have. That is not the case... I was misinterpreting what I was seeing as being the extranseous data, but in fact the problems that I am seeing when run . . . Read full entry » New XSLT NOT WORKING was Re: XSLT to populate a SAMLPosted 1/21/2023 6:56:58 AMI tried what Michael suggested, but it is not working correctly. Here's the XML file: <?xml version="1.0"?> <record> <adrRecord> <PN_ID>1111111</PN_ID> <personnel> <ADM_ORG_CD>urn:NORM:DEPT</ADM_ORG_CD> <DOD_ASSOC_CD>urn:NORM:V . . . Read full entry » Re: XSLT to populate a SAML AttributeStatement from anPosted 1/21/2023 5:14:11 AMHi Michael (et al), You all might find this funny (== "ironic" or "amusing" ), but after showing some of my colleagues what I had done, they are now telling me (a) the names for each of the template matches ARE the same (exactly as you all ASSUMED earlier) plus they realized t . . . Read full entry » Re: ALMOST WORKING was Re: XSLT to populate a SAML AtPosted 1/20/2023 9:36:44 AMAm 1/20/2023 um 12:34 AM schrieb ohaya ohaya@xxxxxxxxx: FYI, the XSLT I posted was just a snippet of the whole XSLT that I needed to make. There were bunch of other template matches that I needed, because there were like 14 or 15, but they were all under /record/adrRecord, but not directly under . . . Read full entry » Re: ALMOST WORKING was Re: XSLT to populate a SAML AtPosted 1/19/2023 11:34:37 PMHi, FYI, the XSLT I posted was just a snippet of the whole XSLT that I needed to make. There were bunch of other template matches that I needed, because there were like 14 or 15, but they were all under /record/adrRecord, but not directly under /record/adrRecord, i.e., there were some under: /re . . . Read full entry » Re: ALMOST WORKING was Re: XSLT to populate a SAML AtPosted 1/19/2023 6:01:09 PMWhile the bgatewayb platform on which you are running the XSLT may well have 2.0 capability, the stylesheet itself says it is 1.0. My system, at least, will not allow me to use a 2.0 function (tokenize()) in a 1.0 stylesheet. If you run an XSLT 2.0 processor, then it will accept a stylesheet th . . . Read full entry » Re: ALMOST WORKING was Re: XSLT to populate a SAML AtPosted 1/19/2023 5:22:26 PMWhile the gateway platform on which you are running the XSLT may well have 2.0 capability, the stylesheet itself says it is 1.0. My system, at least, will not allow me to use a 2.0 function (tokenize()) in a 1.0 stylesheet. But after converting the "1.0" to "2.0" I tried runn . . . Read full entry » Re: ALMOST WORKING was Re: XSLT to populate a SAML AtPosted 1/19/2023 4:06:11 PMMartin, The: <xsl:template match="text()"/> worked perfectly!! Thanks, Jim On Thursday, January 19, 2023, 10:59:02 AM EST, ohaya <ohaya@xxxxxxxxx> wrote: Hi Martin, Ok, thanks!! (for both comments) Jim On Thursday, January 19, 2023, 10:28:31 AM EST, Mar . . . Read full entry » Re: ALMOST WORKING was Re: XSLT to populate a SAML AtPosted 1/19/2023 3:59:17 PMHi Martin, Ok, thanks!! (for both comments) Jim On Thursday, January 19, 2023, 10:28:31 AM EST, Martin Honnen martin.honnen@xxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: Am 1/19/2023 um 2:05 PM schrieb ohaya ohaya@xxxxxxxxx: > I tried the XSLT on the gateway, which do . . . Read full entry » Re: ALMOST WORKING was Re: XSLT to populate a SAML AtPosted 1/19/2023 3:28:12 PMAm 1/19/2023 um 2:05 PM schrieb ohaya ohaya@xxxxxxxxx: I tried the XSLT on the gateway, which does have XSLT 2.0. It looks like it worked, but it's generating some "EXTRANEOUS" output... specifically, it looks like is outputting the VALUE of some the other elements, I am not sure why :(.. . . . Read full entry » ALMOST WORKING was Re: XSLT to populate a SAML AttribPosted 1/19/2023 1:05:13 PMI tried the XSLT on the gateway, which does have XSLT 2.0. It looks like it worked, but it's generating some "EXTRANEOUS" output... specifically, it looks like is outputting the VALUE of some the other elements, I am not sure why :(... 1-Here's the source XML: <record> <adrRe . . . Read full entry » Re: XSLT to populate a SAML AttributeStatement from anPosted 1/19/2023 8:30:09 AMAm 1/19/2023 um 8:58 AM schrieb ohaya ohaya@xxxxxxxxx: BTW, I mentioned I am using xsltproc to do initial testing. Is there a way that I can tell if it support XSLT 2.0? No, xsltproc supports XSLT 1.0 only, but with various EXSLT extension. In the end, if you target XSLT 2.0, I would think that . . . Read full entry » Re: XSLT to populate a SAML AttributeStatement from anPosted 1/19/2023 7:57:57 AMBTW, I mentioned I am using xsltproc to do initial testing. Is there a way that I can tell if it support XSLT 2.0? On Thursday, January 19, 2023, 02:40:48 AM EST, ohaya <ohaya@xxxxxxxxx> wrote: Hi Martin, Actually I think that even without the difference in the name, I am going . . . Read full entry » Re: XSLT to populate a SAML AttributeStatement from anPosted 1/19/2023 7:50:23 AMAm 1/19/2023 um 8:41 AM schrieb ohaya ohaya@xxxxxxxxx: Hi Martin, Actually I think that even without the difference in the name, I am going to have to do one template match per attribute. I didn't post the entire XSLT, but the reason that I am saying that is that in the XML that is the source, not . . . Read full entry » Re: XSLT to populate a SAML AttributeStatement from anPosted 1/19/2023 7:41:03 AMHi Martin, Actually I think that even without the difference in the name, I am going to have to do one template match per attribute. I didn't post the entire XSLT, but the reason that I am saying that is that in the XML that is the source, not all have the same path (e.g. there is personnel, ent . . . Read full entry » Re: XSLT to populate a SAML AttributeStatement from anPosted 1/19/2023 6:49:38 AMAm 1/19/2023 um 4:58 AM schrieb ohaya ohaya@xxxxxxxxx: > Hi All, > > Thanks for the help thus far... I was able to integrate the code I > posted earlier today to construct a saml:AttributeStatement, and I was > able to integrate that with the rest of what I'm doing (there were a > . . . Read full entry » Re: XSLT to populate a SAML AttributeStatement from anPosted 1/19/2023 3:58:14 AMHi All, Thanks for the help thus far... I was able to integrate the code I posted earlier today to construct a saml:AttributeStatement, and I was able to integrate that with the rest of what I'm doing (there were a lot more attributes, etc. So now, I think what I have left is to handle the multi . . . Read full entry » Re: XSLT to populate a SAML AttributeStatement from anPosted 1/18/2023 9:08:51 PMHi, I originally thought that also but didn't know how to add the root to the XSLT (I tried just putting into the XSLT but it said that template had to be top-level). Anyway, so I was also guessing the problem was what you said, so I found a page the mentioned how to add the root and got this XS . . . Read full entry » Re: XSLT to populate a SAML AttributeStatement from anPosted 1/18/2023 8:49:26 PMOn 1/18/2023 9:40 PM, ohaya ohaya@xxxxxxxxx wrote: When I run that with xsltproc I get: <?xml version="1.0"?> <saml:Attribute xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="MY_PN_ID" N . . . Read full entry » Re: XSLT to populate a SAML AttributeStatement from anPosted 1/18/2023 8:40:04 PMI haven't worked with XSLT for years now, and as I said I don't mind breaking this up into pieces. I have been trying to get an XSLT to do the transformation on just the <saml:Attribute> elements individually that are inside the <saml:AttributeStatement>, and the output looks ok, but . . . Read full entry » Re: XSLT to populate a SAML AttributeStatement from anPosted 1/18/2023 8:30:26 PMOn 1/18/2023 9:06 PM, ohaya ohaya@xxxxxxxxx wrote: > > > FYI, if/when I can get this working, the XSLT will be running on a > Gateway machine. I just checked, and I *can* select "2.0" for the > XSLT, but I don't see "2.0+". The tokenize function is part of XPath . . . Read full entry » Re: XSLT to populate a SAML AttributeStatement from anPosted 1/18/2023 8:06:20 PMHi, FYI, if/when I can get this working, the XSLT will be running on a Gateway machine. I just checked, and I *can* select "2.0" for the XSLT, but I don't see "2.0+". Re. "attributes" - you are correct... I mispoke. Thanks, Jim On Wednesday, January 18, 2023 . . . Read full entry » Re: XSLT to populate a SAML AttributeStatement from anPosted 1/18/2023 7:03:31 PMCorrection, I left out the second argument to tokenize(), which in your case should be ':'. Michael Kay > On 18 Jan 2023, at 18:56, Michael Kay michaelkay90@xxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > > Are you able to use XSLT 2.0+ -- that gives you a tokenize() f . . . Read full entry » Re: XSLT to populate a SAML AttributeStatement from anPosted 1/18/2023 6:56:23 PMAre you able to use XSLT 2.0+ -- that gives you a tokenize() function which makes this far easier. In 2.0 it's essentially <xsl:template match="personnel/*"> <saml:Attribute Name="{name()}" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> . . . Read full entry » XSLT to populate a SAML AttributeStatement from an XMLPosted 1/18/2023 5:05:56 PM[I originally sent this to the wrong email address... sorry!] Hi, I have an application where I am retrieving a number of attributes and values from a web service, in the form of an XML file, and I want to create and populate a SAML AttributeStatement from the attributes and values in that XML fi . . . Read full entry » Re: XPath expression that returns a sequence of pairs?Posted 1/17/2023 10:37:57 PM"Roger L Costello costello@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> writes: > Hi Folks, > > I have this XML document: ... > > I want an XPath expression that returns a sequence of > (Target-Latitude, Target-Longitude) pairs; i.e., a pair for each > . . . Read full entry » Re: XPath expression that returns a sequence of pairs?Posted 1/17/2023 9:18:22 PMOn Tue, 2023-01-17 at 20:09 +0000, Roger L Costello costello@xxxxxxxxx wrote: > > I want an XPath expression that returns a sequence of (Target- > Latitude, Target-Longitude) pairs; i.e., a pair for each > <Observation> element. For the XML document shown above, the XPath > sho . . . Read full entry » Re: XPath expression that returns a sequence of pairs?Posted 1/17/2023 8:22:49 PMThe XPath 2.0 data model does not allow sequences of sequences, so there's no obvious way to represent a sequence of pairs -- except as an XML tree, of course. In XPath 3.1 you can return an array. Actually you can return an array of arrays, an array of sequences, or a sequence of arrays. For exam . . . Read full entry » Re: XPath expression that returns a sequence of pairs?Posted 1/17/2023 8:19:13 PMOn 1/17/2023 9:08 PM, Roger L Costello costello@xxxxxxxxx wrote: Hi Folks, I have this XML document: <Track-History> <Track-ID>XYZ</Track-ID> <Observation> <Target-Latitude>10</Target-Latitude> <Target-Longitude>20</Target-L . . . Read full entry » Re: XPath expression that returns a sequence of pairs?Posted 1/17/2023 8:12:59 PMHi Roger, I think sequences are always flattened, and so you would need arrays to do this (XSLT 3.0, XPath 3.1). Arrays can contain anything, including other arrays: https://www.saxonica.com/documentation12/#!expressions/xpath31arrays I've never used arrays, so I can't suggest code to try. - C . . . Read full entry » XPath expression that returns a sequence of pairs?Posted 1/17/2023 8:08:06 PMHi Folks, I have this XML document: <Track-History> <Track-ID>XYZ</Track-ID> <Observation> <Target-Latitude>10</Target-Latitude> <Target-Longitude>20</Target-Longitude> <Observer-Latitude>40</Observer-Latitud . . . Read full entry » [ANN] Saxon 12.0Posted 1/14/2023 2:40:59 PM12.0 is a new major release of SaxonJ, SaxonCS, and SaxonC, all built from the same code base. It is the first time we have released simultaneously for all three platforms, which we have been able to achieve thanks to progress on build and test automation and continuous integration. SaxonC is a li . . . Read full entry » Re: Two possible group-ending-with nodesPosted 1/6/2023 3:47:49 PMMartin, I see your solution in the previous post and it is cleaner using the note variable. Thank you very much! Rick From: rick@xxxxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Sent: Friday, January 6, 2023 10:40 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: Two possi . . . Read full entry » Re: Two possible group-ending-with nodesPosted 1/6/2023 3:40:05 PMThis definitely makes sense. I think it is a group-adjacent problem. Here is my modified input with the correct output: <?xml version="1.0" encoding="UTF-8"?> <root> <p class="CBBodyIndented">Out 1</p> <p class="CBNote&quo . . . Read full entry » Re: Two possible group-ending-with nodesPosted 1/6/2023 3:39:42 PMAm 1/6/2023 um 4:00 PM schrieb rick@xxxxxxxxxxxxxx: > > Martin, > > The notes-content will be one or more of p with class=CBNoteBody or p > class="CBBodyIndented" style="margin-left:96pxb with nothing else in > between. > Perhaps a nested group-adjacent inside . . . Read full entry » Re: Two possible group-ending-with nodesPosted 1/6/2023 3:04:05 PMIt ends the first inner group at the first element because it matches the first condition, p[@class='CBNoteBody']; it ends the second inner group at the second element because it matches the second condition p[@class='CBBodyIndented'][@style='margin-left:96px;'], and it ends the third inner group a . . . Read full entry » Re: Two possible group-ending-with nodesPosted 1/6/2023 2:59:58 PMMartin, The notes-content will be one or more of p with class=CBNoteBody or p class="CBBodyIndented" style="margin-left:96pxb with nothing else in between. Rick From: Martin Honnen martin.honnen@xxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Sent: Friday, January 6, . . . Read full entry » Re: Two possible group-ending-with nodesPosted 1/6/2023 2:52:30 PMAm 1/6/2023 um 3:42 PM schrieb rick@xxxxxxxxxxxxxx: > > Hi All, > > I am trying to add some hierarchy to flat content. I have this as an > input file: > > <?xml version="1.0" encoding="UTF-8"?> > > <root> > > B B B <p class=" . . . Read full entry » Two possible group-ending-with nodesPosted 1/6/2023 2:42:22 PMHi All, I am trying to add some hierarchy to flat content. I have this as an input file: <?xml version="1.0" encoding="UTF-8"?> <root> <p class="CBNote"/> <p class="CBNoteBody"/> <p class="CBBodyIndented . . . Read full entry » Re: [ANN] spaces available in XSLT 3 coursesPosted 1/5/2023 9:20:17 PMOn Sat, 2022-12-03 at 00:24 +0000, Liam R. E. Quin liam@xxxxxxxxxxxxxxxx wrote: > Hello! i have some spaces left for the course "XSLT 3 for XSLT 2 > users" > on > December 13th..15th, and again in January. Update - the December course happened; running the course again this m . . . Read full entry » XSL-List GuidelinesPosted 1/1/2023 7:38:48 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 »
|
PURCHASE STYLUS STUDIO ONLINE TODAY!!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! 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 KnowDoes 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. |