Questions tagged [xslt]

XSLT, also known as Extensible Stylesheet Language Transformations, is a flexible language used to convert XML structured documents into various output formats. It supports transformations to XML, HTML, plain text, and even JSON in the case of XSLT 3. To address any queries related to XSLT, please use either the xslt-1.0, xslt-2.0, or xslt-3.0 tags according to relevance.

Does an element such as <xsl:url-param name="color" /> exist?

Is it possible to send a request to a page with the following URL? http://www.server.com/show.xml?color=red&number=two Would something like the following work?: I am a fan of the color <xsl:url-param name="color" /> and the number <xsl:url- ...

Using AngularJS within XSLT: Unrecognized prefix 'true' encountered

I have a button that uses ng-repeat. Inside this button, I am applying an active class based on the default product. <button type="button" ng-model="selectedProductGroup" ng-repeat="item in pgroup |unique: 'Product' track by $index" ng-click= ...

Obtaining address information from a textor

I've been searching for a solution to my problem, but haven't come across one yet. The issue is similar to this query: Extract address from string However, I'm struggling to modify the php code in order to resolve my specific problem. Usin ...

Using XSLT to convert HTML into the desired text format

It has been almost two decades since my last encounter with XSLT. I am attempting to transform documents, like the HTML snippet below, into the desired output. <p> おばあさんは、とても <ruby><rb>喜</rb><rp>(</rp ...

Creating an XML response to generate an HTML dropdown menu in PHP

My onChange function in javascript calls a PHP file to fetch UPS rates and update an HTML dropdown list. Everything was working fine until I needed to add an item to the options list based on a comparison. Javascript: function fetch_UPS(el){ var zip = ...

Reduce XSLTProcessor output by 50%

I have a persistent problem (from my perspective, at least). Every time I use XSLTProcessor.transformToFragment, the output is consistently halved compared to the input. For example, when I receive 200 entries in an XML file as a response from a webservi ...

XSLT: Tips for preventing the use of self-closing tags within HTML attributes

I am new to XSLT and I'm currently troubleshooting an issue with some XSLT code (version 2.0) that was written a few years ago. Here is a snippet of the XSLT code: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ...

XML, XTL, and HyperText Markup Language (HTML)

I am facing a challenge with transforming a list in an XML file into an HTML view using XSLT. The nesting of the lists is causing issues and the output is not meeting my requirements. XML: <book-part> <list id="ch4list2" list-type="simple"> & ...

Transform XML data into JSON format including arrays using WSO2

Looking to transform XML data into JSON format with XSLT, I noticed that when there is only a single node in the XML, the resulting JSON does not include an array. However, if there are multiple nodes present, they are displayed as an array. For example, ...

Transform JSON into XML with XSLT 3.0 while handling ampersands in element keys

Using XSLT, our goal is to convert JSON to XML: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://www.w3.org/2005/xpath-functions/math" xmlns:xs="http://www.w3.org/2001/XMLS ...

Converting XML to JSON with the help of XSLT transformation

I am currently working on a project that involves converting XML to JSON using XSLT. Here is a snippet of the XML I am trying to convert: <some_xml> <a> <b> <c foo="bar1"> <listing n="1">a</listing> <list ...

Connecting to an element within a separate node (XSLT)

I have an XML document that includes a list of companies. My goal is to use XSLT to create links that point to the <link> child of the next company node. To provide a clearer picture, here is a snippet of sample XML data I am working with: <portf ...

Strange issue encountered when utilizing Worklight along with XSL transformation on a JSON response

I'm facing an unusual issue that I can't seem to resolve. Here is an example of a JSON response that I am dealing with. "values": [ { "time": "2014-02-26T09:01:00+01:00", "data": [ "A", "B" ] }, // additional objec ...

employ varying XSL stylesheets to display an XML document in a separate window

My issue involves an XML file being transformed by a specific XSL file (XSLT 1.0), which in turn includes multiple other XSL files with various templates. The challenge is to add a button to the rendered XML that, when clicked, opens the same XML in a ...

Transferring the final space from a node containing a mixture of content to a separate

Having a multitude of HTML files generated by MS Word, my objective is to modify the contents in order to extract data and perform other tasks. In an HTML paragraph with mixed content, I have noticed that spaces after italicized or bold words also become ...

What is the method to make xsl:function return a string value containing HTML tags?

I am currently working on converting a Java function into an XSL:Function specification. The function is responsible for adding HTML tags around substrings. I have encountered some challenges in this process: while the Java code works perfectly with inline ...

The xslt code is failing to invoke the JavaScript function

I am currently utilizing xslt for the transformation of xml to html. Below is an example of an .xml file. <ImportOrganizationUtility-logging> <log-session module-name="ImportOrganizationUtility" end="17:54:06" start="17 ...

Display the XML nodes for every element within a singular row

I am trying to extract the category and hours values from all nodes in this XML file and display them as comma-separated values on a single row using XSLT. XML <?xml version="1.0" encoding="UTF-8"?> <course> <subcourse> & ...

Using XSLT to format HTML tables for printing

In my current project, I am developing an XSLT that retrieves a list of items from an XML file and generates an HTML table for each item. The issue I am facing is that when I attempt to print the document, the tables at the end of the page get cut off and ...

Issue with xsl:include functionality in a Firefox extension

I've been working on a Firefox extension that utilizes XSL transformations with no issues. However, I encountered a problem when trying to perform an xsl:include from the XSL stylesheet. Upon importing the XSL stylesheet containing an xsl:include stat ...

Parsing an XML array using XSLT and implementing a universal template for nested elements to convert from XML to JSON

My task involves converting a number of XML files into the appropriate JSON format using XSLT. While I've managed to convert everything successfully, one issue remains with arrays. I need to create templates that are versatile enough to handle any sce ...

Using XSLT to generate default XML nodes when a corresponding JSON element is missing

I am working with JSON structured as follows: { "Message" : { "dynamicFields" : [ { "alias" : "TEST_ALIAS", "value" : "VALUE" } , { "alias" : "CAR", "value" : "TOYOTA" } ] } } My XSLT style ...

The expression '<xsl:value-of select="document(content)//title"/>' results in a null node response

Can someone assist me in retrieving the title of a basic HTML document in order to create a sitemap? I have been receiving an empty value every time I try. Upon inspecting the issue, it appears that the document(content) is returning document nodes. It s ...

Converting XML to HTML with the help of XSLT transformation customization

I need assistance in adjusting the XSLT 1.0 transform within the provided xsl file to create an HTML version of the table coded in the attached XML file. The generated HTML output file should display the table from the XML file with alternating row backgro ...

Assign the value of a leaf node as an attribute

Check out this XML file (test.xml): <product> <node> <region_id> <node>1</node> </region_id> <region_time> <node>27</node> <node>02</node> <node> ...

changing html numbered list to xml format

Looking to convert HTML ordered lists with different types into XML markup? <ol type=a> <li>This is list item a</li> <li>this is list item b</li> </ol> <ol type=i> <li>This is list item 1</ ...

Learn the process of generating sequential heading numbers for topic headings in each HTML document using DTA or XHTML

I attempted to include hierarchical numbers for topic headings in dita2xhtml_eclipsehelp.xsl. (DITA OT HTML output) However, I am facing difficulty in producing numbers similar to the following in each html file: 1 heading text 1.1 heading text 1.1.1 Head ...

"Optimizing XSL stylesheets by implementing conditional row styles to prevent redundant

Is there a way to display rows that are older than 2 years from today in bold without repeating the code? I know the condition I need, but I'm struggling with avoiding duplicating all the code just for a different style. This is the code I have: & ...

Creating a function for loading dynamic content in XSLT can be achieved by following these steps

When I call the function collapseandexpand() for static elements only, it does not work. Now, how can I create the same function to handle dynamic content in xslt? Javascript Code: <script language="javascript" type="text/javascript> <xsl:text&g ...

Looking to transfer XML data to JSON format? I also have CDATA content that needs to be included!

I recently encountered an issue while using XML to JSON conversion in XSLT. Despite having a specific XSLT template to convert my XML to JSON, I faced a problem where the CDATA content was getting lost. <?xml version="1.0" encoding="UTF-8" ?> &l ...

Tips for preventing the automatic insertion of tbody tag by Firefox?

My webpage is being rendered client-side using XSL and XML sent by the server. I'm encountering a problem with Firefox adding an implicit tbody tag. The issue arises because my XSL generates certain tbody tags based on certain conditions. However, Fi ...

Unused DIV elements in jQueryUI are identified using XSLT

Just a heads-up, I'm new to xslt so please bear with me if this seems like a silly question. In my xsl:template I have created a div element like this: <div id="objectLocked"> This object is locked by another user. Do you want to remove the lo ...

Select all nodes in XPath except for the `figure` node

I am currently utilizing the scrapy framework with python 3.7.9 to scrape articles from various Britannica websites. Below are the provided links for reference: link1 link2 For extracting text, I am implementing the XPath expression //section[@id='r ...

Encountering a problem where updating the selected option in a dropdown does not properly refresh the HTML

I am currently working with a dropdown menu containing countries. Initially, the selected item is set to Ukraine. <select id="country" name="country"> <option value="US">USA</option> <option value="UG">Uganda</option> ...

What are some effective ways to extract additional information from lxml error messages?

Due to the inability to use an XSL IDE, I have developed a simple Python script utilizing lxml in order to convert XML files using a specified XSL transformation and save the output to a new file. Here is the code snippet (excerpted): p = XMLParser(huge_t ...

Is there a simple method to convert XML to HTML and then store the resulting HTML file?

Looking to utilize an XML file for creating HTML emails? I can create an XSL file to convert it to HTML, but am unsure how to save or copy the resulting HTML. Simply viewing the source of the XML file shows the original XML source, not the transformed HTML ...

What is the process for retrieving the property tag from TEST-result.xml in junit-frames.xsl?

<?xml version="1.0" encoding="UTF-8"?> <testsuite errors="0" failures="0" hostname="xxx19" name="MyProject.TestSuite" tests="2" time="105.112" timestamp="2012-04-30T11:32:18"> <properties> <property name="java.vendor" value="Orac ...

What is the best method for modifying an XML document without altering its associated XSL stylesheet?

I am working with XML data retrieved from a URL: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="/style.xsl"?> ....etc... To display the data in HTML format, I added the second line referencing the style.xsl file ...

Grab the webpage's URL by collecting the link from the src attribute of the script tag using XSLT

Can XSLT be used to extract a URL link specified within the src attribute of a script tag in an HTML file? Here is an example of the HTML file: <HTML> <BODY> <SCRIPT language="javascript" src="http://myspace.com" type="text/javascript"> ...

Are there any XSLT schemas out there that generate JSON output that complies with the JSON-API standards

I am currently working on an API service that requires data in a simple XML format and must generate requests that are compliant with the JSON-API standards. Upon researching, I found that xslt3.0 now includes the new function xml-to-json, which allows fo ...

A step-by-step guide to incorporating expandable and collapsible images within a div element using X

I have successfully created dynamic divs with some data that expand and collapse perfectly. Now I am looking to add expand and collapse images on these divs. I am relatively new to designing in xslt. <xsl:template match="category[key!='org.model.C ...

Creating a customized display on a webpage using XML and XSL to generate unique

Looking to utilize my xml file for generating various xsl pages. <movies> <movie> <name>Shark tank</name> <movie> <movie> <name>Tank Shark</name> <movie> ...

Distribute identical files to multiple output destinations

Currently, I am utilizing XSLT from the terminal to construct two distinct XHTML documents within their respective folder structures (e.g. "doc-1-folder", "doc-2-folder"). My goal is to generate a local output with each build and also have the outputs sent ...

Is Jackson a suitable tool for conducting XSLT transformations?

Within our projects, we utilize Jackson for mapping between JSON and Java objects, as well as Jettison for converting XML input streams to JSON objects. One common scenario involves applying an XSLT transformation on an XML document to create a "JSONized" ...

Extracting the value of an attribute from an XML element and converting it into an HTML unordered list with

Here is an example of an xml file structure: <root> <child_1 entity_id = "1" value="Game" parent_id="0"> <child_2 entity_id="2" value="Activities" parent_id="1"> <child_3 entity_id="3" value="Physical1" parent_id="2"> ...

Assistance with PHP and XPath

Looking for assistance with using XPath in PHP. I am seeking guidance on accomplishing the following tasks within any given HTML content: Eliminate all tables and their contents Get rid of everything that comes after the first h1 tag Retain only paragra ...

Using a table row as a counter in HTML

I am looking for a way to automatically assign IDs to table rows using XSLT in a systematic manner. The idea is to have the ID consist of a string followed by a counter, like this: <table> <tr id="Row1"> # it can be only a number => id=" ...

Guide to presenting XML information from a web address using XSLT

I am currently working with dynamic XML sports data from a URL in a Yahoo API, and I want to display and sort a selection of this data on my website using XSLT. This is my first time dealing with XML and XSLT, and while testing, I have managed to correctly ...

PHP's 'importStyleSheet' function is a useful tool

I am having trouble running the importStyleSheet function and keep getting a warning message when I try to execute it: Warning: XSLTProcessor::importStylesheet() expects parameter 1 to be object, boolean given. The file paths are correct. Below is the c ...

What is the method for incorporating various font sizes within tooltip content?

I need assistance with making the number of days (Difference_In_Days, Difference_In_DaysRev) appear in a larger font than the rest of the text within a tooltip. I attempted to include a <span style="font-size:25px;"> tag in the mess variable, but enc ...

Tips for sending parameters to XSLT using a Javascript function

Despite my efforts to find a solution in various online posts, I haven't been able to resolve the issue. The challenge lies in my HTML file that includes a JavaScript function for parsing XML and rendering XSLT. I have multiple 'records' in ...

Using AJAX to showcase XML and XSL content

I’m currently working on displaying my XML and XSL on an HTML page using AJAX. The XML is pulling through to the HTML page just fine, but I’m encountering issues with getting the XSL to display properly. Below is my XML code: <tv_guide> <cha ...

Having trouble loading xml/xsl files on IE11? Consider enabling compatibility mode to ensure smooth rendering on your xml/xsl page

On my website, I have a page that displays XML from an XSL document. Strangely, it works perfectly on IE8 but not on IE11 - the page appears blank even though the XML is present when viewing the source. Interestingly, if I enable compatibility mode for the ...

The efficiency of XSL Template is significantly impacting loading time

Hello there, I am facing a challenge with my webpage's loading speed due to the code provided below. Can you assist me in optimizing it? <xsl:template match="Category" mode="CategorySelectorScript"> <xsl:variable name="ThisCateg ...

Is there a way to access the content of a drop-down menu in JavaScript besides using ".value"?

Trying to create a table with rows that change dynamically but columns that are fixed. There's a drop-down menu whose content is based on an xml file. When I use .value to access the current content of my drop-down menu, it works fine in Firefox but n ...

Evaluate numerical values using xsl:choose function

Using XSL version 1.0, I am populating an HTML table with percentage values from XML. My goal is to display the highlighted color of the percentages based on a condition, but the condition is not being processed as expected, leading to the exclusion of the ...

Is there a problem with the string comparison in my JavaScript code?

I am dealing with various XML files specific to different operating systems. Here is an excerpt from the SunOS XML: <osname>SunOS </osname> This data is extracted using jQuery: var osname = $(this).find('osname').text(); However ...

Using XSL variables in JavaScript code

I've noticed that there have been similar questions asked, but none of the solutions seem to help in my case. So, I have this variable named 'var': <xsl:variable name="var"> val </xsl:variable> Now, I want to use it like thi ...

Converting XML to JSON using WSO2 Conversion Tools

Whenever I attempt to convert XML to Json using XSLT mediator in WSO2, an error message stating "Payload could not be written as JSON" keeps appearing. Can someone provide assistance with resolving this issue? Appreciate any help in advance. ...

Tips on effectively managing sibling nodes with unique behavior on the initial one

Greetings and thank you for taking the time to read and assist. While I have gained a good understanding of how XSLT 1.0 processes XML, there is one issue that continues to baffle me. The problem arises from having a template that matches the first node ...

Has anyone come across an XSLT that can effectively convert Apple Pages files into high-quality HTML?

When Apple’s word processor/DTP app Pages saves its files, it does so as zipped folders with an XML file containing the content and attachments like images stored as separate files. I am interested in converting this content into HTML format, using < ...

Issue with converting valid JSON to XML using XSLT 3.0 json-to-xml() function

The following JSON appears to be valid, but when attempting to transform it using XSLT 3.0's json-to-xml() function, an error related to the JSON syntax is encountered. { "identifier": { "use": "<div xmlns=\"http://www ...

A guide on displaying multiple XML files within a JHipster React Application

I'm working with a large collection of XML files (approximately 100 files) that I need to display within a React application, complete with navigation and styling. These XMLs may contain links to other XML files for navigation purposes, as well as ref ...

Struggling with making JSON function in XSL

Attempting to retrieve the XML content... <user-types> <section id="11" handle="user-types">User types</section> <entry id="9"> <name mode="unformatted" handle="home-owner" word-count="2" lang="en" handle-en="hom ...

Discover the magic of unlocking XML content with the power of XSL!

Hello, I am currently working on transforming an XML archive using an XSL archive. My goal is to generate a table displaying the content of the XML, but I am encountering difficulties in showing the values of two columns named "complexity" and "subject". B ...

Verify if the final (or initial) node containing a child with a specific value

Using XSLT 1.0, I have transformed the given XML into an array of JSON objects: <a id="x"> <active>Yes</active> </a> <a id="y"> <active>No</active> </a> <a id="z"> <active>Yes</act ...

What is the correct way to display my data in a table using XSLT?

Here is the desired look I'm aiming for I am still learning about xml/xsl, so please point out any errors kindly (: Below is a snippet from an xml file: <weather yyyymmdd="20200616"> <year>2020</year> <month>06< ...

Obtaining an XML element within an XSLT transformation

I need to retrieve the value of an XML element within XSL. Although my JavaScript is able to select one XML document, there are elements in other documents that I also require. I am uncertain if this task is feasible or if my syntax is incorrect. This is ...

Converter between JSON formats

Let's consider a situation. The required data format for input and output is JSON. // Input { "OldObject": { "Time": 1351160457922, "Name": "OName", "quantity": 100, "price": 10 } } // Output { "NewObject": { "Time": 1351 ...

Incorporate javascript into your XML transformations with XSLT

I need help with inserting JavaScript in XSLT. Here is an example of what I am trying to do: <xsl:variable name="comboname" select="@name" /> <script type="text/javascript"> var z{$comboname} = {$comboname}; </scri ...

Exploring an XML document with HTML

I have an XML file that is paired with an XSL file. The resulting output can be located here. I am working on creating an HTML webpage where users can input a search query, such as 'Year < 2009', into a search box. The table above will then disp ...

Converting XML hierarchy into a flat HTML table using XSLT

Looking for a way to transform hierarchical XML into an HTML table? Here's the challenge: <node text="a" value="1"> <node text="gga" value="5"> <node text="dh" value="9"> <node text="tyfg" value="4"> < ...

Transform the initial HTML table row into a header row for every table by utilizing XSLT

My XML file contains HTML content that I need to manipulate. Previously, I used <xsl:copy-of select="customFields/customField[@name='mainContent']/html"/> to bring the content to the correct location. Now, I have a new requirement to conver ...

XSLT selecting the remaining elements in a tokenized array

In my XSL document, I have a requirement to generate a hyperlink with text that includes a line break, resulting in two separate sentences. To achieve this, I am utilizing the tokenize function to split words based on whitespace character. <xsl:variab ...

Ways to make a jsonp request without including the 'callback' in the URL

I've been working on retrieving information from an Icecast Radio station using their API, which offers the status-json.xsl endpoint to access this data. Despite the format being in xsl, I suspect it returns a JSON file. However, I've encountere ...