38,834 questions
Best practices
0
votes
2
replies
31
views
Displaying Information On Browser
I used to display error messages from a xml file directly on MS Explorer web browser and format the output using a xslt file. However, this process seems to be eliminated on MS Edge. I used the ...
0
votes
1
answer
129
views
Indesign table XML convert to HTML table using XSLT 2.0
I want to transform Indesign table XML converts to HTML but I am not getting the correct output and need to handle dynamically aid:crows and aid:ccols. can anyone please suggest the correct table HTML ...
0
votes
1
answer
79
views
How to split the book in the chapters format
In the below example we are trying split the book in the chapters format.
Can anyone help.
INPUT XML:
book.xml
<?xml version="1.0" encoding="UTF-8"?>
<book>
<...
0
votes
1
answer
65
views
How to lookup multiple values of a key in a map in xslt 3.0
I am new to XSLT and I am trying to simply print one of the values of a key in XSLT3.0. Please help me with this.
My XML:
<AggregatedData>
<wd:Report_Data xmlns:wd="urn:com.workday....
0
votes
1
answer
96
views
Prevent a path being added a UDF from a XLAM used in an Excel Template
I have a XLAM file that I installed through the Options -> AddIn Manager and activated in Excel. I also have a template (xslt). In this template I reference a UDF from the AddIn. This works fine.
...
Advice
1
vote
3
replies
78
views
Split single XML document into multiple XML documents
I have a task to split an XML that I'm receiving using XSLT. The input XML is formatted as follows:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<...
1
vote
1
answer
120
views
How to validate XML document against the XML schema using the XmlPrime xslt command-line?
I am starting with Peppol Invoices based on XML. What I need is to be able to locally validate the XML of the invoice document. (I know that on-line validators do exist.) The next step will be the ...
2
votes
2
answers
192
views
What is the biggest number that MSXML can handle in XSLT?
When doing some numerical calculations in XSL templates I stumbled over the fact that a value of 3.600.000.000 which represents the number of microseconds in an hour can be represented in MSXML v6 ...
2
votes
1
answer
72
views
XSLT using count to add s to the string
Is there a better way to do this I am adding the s if the count is not 1 and if it has the 1 I dont add that line.
<xsl:choose>
<xsl:when test=".//Count = 1">
<li&...
7
votes
3
answers
187
views
How can I pass a list of elements as a template's param to work on each on them with a for-each approach in XSLT 1.0?
I am working with XSLT 1.0 through a Java project, and I am unable to update to 2.0. I am attempting to write a Parent template that should call within it a Child template. I wish for the Parent ...
1
vote
3
answers
130
views
What is an example of an XML file merge using Saxon and an XSLT 3.0 stylesheet?
I need to merge Saxon Documentation - merge one node from the source XML file merge.xml into the file merge-test.xml, positioning the node in between two other nodes in the output file output.xml. No ...
1
vote
2
answers
72
views
Sort entries in an XML file using Saxon 12.9 and an XSLT 3.0 stylesheet
I'm trying to sort entries in an XML file using Saxon, Saxon:sort and an XSLT 3.0 stylesheet.
I need to sort the nodes by the date in the <blogger:filename> field, which has the date as part of ...
2
votes
1
answer
71
views
Remove an XML node with Saxon using an XSLT 3.0 stylesheet
What's a simple example of removing a node from an XML file using Saxon 12.9 and an XSLT 3.0 stylesheet?
I've got an XML export from Blogger, and I'm puzzled on how to remove just the COMMENT entries ...
-1
votes
1
answer
78
views
XSLT Transformation is not working as expected
Input XML
<tns:ipartycredit>
<ns3:crPtyRole>ACWINS</ns3:crPtyRole>
<ns3:crPtyRoleIndicator>R</ns3:crPtyRoleIndicator>
<ns3:crPtyInformationTag>57</...
1
vote
1
answer
134
views
XSLT Reset variable [closed]
I have this variable showHeader that I am using to display a header but I only want it to display one time. After it is displayed I want to set it to false but I am not sure how to do that I only want ...
1
vote
2
answers
168
views
xsl:try / xsl:catch - how to abort after the 10th error?
We are processing XML files of the following form with a burst-streamed XSLT-Transformation. Each Dok is independent of the others and a dynamic error in transforming one <Dok>should not ...
1
vote
1
answer
107
views
xslt data is repeating
I am trying to understand why my data is repeating Clinical Content in the output. In the xslt I have a for-each select="//EmailMessageModel so it shouldnt repeat that data because it is in only ...
1
vote
2
answers
73
views
How to use XSLT to group consecutive following elements satisfying a certain condition (colspan)
See the XML code of a table below. My task is to add two attributes (NAMEST and NAMEEND) to every ENTRY element which has one or more consecutive following ENTRY elements with the text "##colspan#...
0
votes
1
answer
81
views
XSLT - For-Each-Group - GroupBY not working on 2 groupby value
I am trying to use XSLT in my application(OIC) where based on input structure, I have to construct an output file which filters the records based on 2 elements.
Input structure:
<?xml version='1.0' ...
1
vote
3
answers
135
views
XSLT: Copy the majority of XML but replace subnode with a new data
There is an outdated section within the data, and I need to replace it. The replacement data is static and needs to go in place of existing Nodes.
<headerNode1>
<headerNode2>
<...
-1
votes
1
answer
75
views
API response has nest array and to be converted into single array with condition in XSLT in OIC
I have nested API response where terminateDate can have value and empty.
Conditions:
Check the array if any one record found that terminateDate falls
within 15 days w.r.t current date then map that ...
1
vote
2
answers
129
views
How to remember change of values in between for-each loops
I am writing a program, that will divide my students into groups. Lets say the groups are A, B, C and D. In each group there can be only so many students. Those numbers I have in a global variable:
&...
-3
votes
1
answer
88
views
Converting a number ofargument tags with different attributes into unique tags
I need to convert an XML file to another format. A system creates an XML log with entries like this, I now know that the format was probably selected to allow extension without changing the schema:
&...
0
votes
2
answers
77
views
How do I add a \usepackage line to the generated latex from an XSL when using Saxon 12?
Using Saxon 12.8, I can compile an XML source to a TEX file. I am using the XSL file for Latex from TEIC/Stylesheets to do this.
My XML source however has some math that will need the amsmath package. ...
1
vote
0
answers
127
views
SaxonC v12.8: SaxonApiException adds multiple times the same error
In the event of an XSLT error (where it lacks a leading '<', for instance), the compileFromString method raises a SaxonApiException. The exception message is fine for v12.5 but not for v12.8 (and ...
0
votes
2
answers
103
views
How to use XSLT to count consecutive following elements satisfying a certain condition
See the XML code of a table below. My task is to add an attribute (MOREROWS) to every ENTRY element which has one or more consecutive following rows with the text "##rowspan##" in the ENTRY ...
0
votes
1
answer
68
views
I want to check the content in between to match regex condition in XSLT
In @xlink:href contains 10.1513/AnnalsATS.202508-879ED text will come different types of doi numberes in many file, How to replace it in regex mode to match the below condition. Please anyone help on ...
2
votes
2
answers
78
views
Performance of adding an entry to a large map [closed]
I have a large sequence of maps: 15,000 rows of 85 columns, initially created from sql:
<xsl:variable name="original-sequence" select="sql:prepared-query($connection, $sql)()"/&...
0
votes
1
answer
59
views
How to Pass parameters in XSL pipeline running in Saxon HE 12
I have a pipeline. XSL, which should run multiple XSLT transformations on one input, I want to pass some parameters to the child XSLs used in the pipeline.xsl
Problem: The parameters are not passed to ...
0
votes
2
answers
77
views
xpath filtering misleading misconception behavior [closed]
I have noticed this xpath misleading behavior problem,
for this expression:
elemA[ not(elemB) ]
it has two meanings:
1. yes show all elemA filtered all childs elemB. eg: select all elements but ...
3
votes
1
answer
102
views
Import and parse XSLT file using XML
I am trying to import a legacy configuration file into SQL Server table that is in XML that also has an XSLT transform file. I have imported the XML config using .nodes and XPath syntax with a lot of ...
1
vote
1
answer
72
views
XSLT for-each with using last and aggregation
I am not sure if this is possible with XSLT but I am trying to get the below XML into a format where it is name, title, date (if same date then only get date once), last value of In time (might not be ...
0
votes
2
answers
107
views
XML transformation that loads XSL from embedded link
Is it possible to execute an XML transformation without a .xlst file, but to load that file from a XML stylesheet link embedded in the XML file?
Currently I am loading the transformation from the file ...
0
votes
0
answers
50
views
Why error about adding an “attribute” after adding a “node” when the “copy” has the attribute wildcard first?
When running the below XSLT
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xquery="http://www.w3.org/2005/xpath-functions"...
0
votes
0
answers
96
views
my Chrome shows XML file with XSLT while i did nothing about it?
Have interesting question and its also a problem for me now.
One of my customer has XML file with XSLT file. They were using edge with ie compatible mode to see these files. Because modern browsers ...
1
vote
1
answer
54
views
How can I access an API endpoint in XSLT if the API requires some authentication headers in the request
I can use the XSLT document() function to access external resources, so long as any authentication can be passed via the URL, e.g.
https://api.domain.com/call_x/id?api-key=abcd1234
However if the ...
0
votes
1
answer
81
views
Saxon XSLT processing URI issue
I have a component written i .NET/C# that does XSLT processing using SaxonCS. This component works fine when running it in a Windows host application. But when I run it within a docker container I get ...
0
votes
1
answer
33
views
XSLT 1.0 Report distinct values from XML
This is a sample of data from my XML table:
<table>
<tr>
<td>LCC/8700087542</td>
<td>010E</td>
<td>LHAO</td>
<td>HWAA</td>
<td>Add</...
1
vote
2
answers
111
views
Creating a tree of XSD elements without duplicates
I'm building an XSD viewer using XSLT. The viewer should list all elements hierarchically, and I am currently stuck on deduplicating sub-elements which appear more than once in their parent (e.g. due ...
1
vote
1
answer
54
views
What is adding a whitespace to the end of the output string for this XPath?
Using the latest Saxon parser.
This is a snip of a larger XML file.
<osm>
<node id="38275590">
<tag k="name" v="Wimbledon"/>
</node&...
1
vote
1
answer
67
views
How do I get value of one node's attribute based on value of another nodes attribute?
Using Saxon parser freebie.
This is a snip of a larger XML file.
<osmChange>
<modify>
<node id="28377390">
<tag k="name" v="Holywell"/>...
0
votes
2
answers
111
views
How do I set the SystemId for an XSLT stylesheet in memory
(Inspired by an old question)
I have some stylesheets that use the anonymous document('') function to implement look-up tables.
<!-- example the lookup table data -->
<ref:data xmlns:ref=&...
1
vote
3
answers
157
views
Splitting an XML document in C# at a child node level in hierarchy
I need to split a single batched XML document into individual XML documents based on a nested child node, but each document needs to retain all of the information at the parent levels.
Parent document:...
2
votes
2
answers
58
views
Transpose rows into columns using xslt with associated values
I want to use xslt to transpose my input to generate a header for my csv file while printing associated values in the rows
Here is my sample XMl
<?xml version="1.0" encoding="UTF-8&...
2
votes
4
answers
105
views
How can I determine if a sequence is an ordered subsequence of another sequence in XPATH 2.0?
In XPath 2.0, how can I determine if a sequence is a contiguous subsequence of another sequence?
For example ('1','2') is a contiguous subsequence of ('a','b','1','2','3','4')
Here, I am not ...
0
votes
1
answer
57
views
XML Transformation in akka
I am trying to transform an XML inside an Akka Flow, using javax.xml.transform.Transformer:
Flow<ByteString, ByteString, NotUsed> transformXml(@NonNull final Source<ByteString, ?> xslt) {
...
2
votes
2
answers
89
views
Why does my XSLT return empty namespace xmlns=""?
Why do I get the xmlns=""? I've tried putting the namespace in many other places and messed with the prefix but can't seem to remove the empty xmlns="" attributes.
XML:
<?xml ...
1
vote
2
answers
70
views
xml-to-json number-formatter error when using input paran
I have the following stylesheet
<xsl:stylesheet
version="1.0"
xmlns:test="test"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:xs="http://...
0
votes
1
answer
71
views
Issue when converting XML to PDF [closed]
I have an issue when converting one XML document to PDF.
If I remove "title" from from the sample below it converts just fine.
<list type="bulleted">
<title>Key:<...
0
votes
0
answers
88
views
XML Indentation removal - reinsertion of spaces
I am having difficulty as I try to remove indentation in an XML document. I am attempting to do this by employing 2 techniques:
Adding <xsl:strip-space elements="*"/>
Applying “...