Libxml 1.0 Issue 3 #287

Closed
opened 2024-06-04 15:58:57 +02:00 by binkowsp · 1 comment

No error, no output

XML

<?xml version="1.0" encoding="UTF-8"?>
<a:authors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns="http://www.demo.com/author"
           xmlns:a="http://www.demo.com/author"
           xmlns:p="http://www.demo.com/person"
           xsi:schemaLocation="http://www.demo.com/author author.xsd">
    <a:author id="1">
        <p:firstName>William</p:firstName>
        <p:lastName>Shakespeare</p:lastName>
        <a:dateOfBirth>1564-04-23</a:dateOfBirth>
        <a:dateOfDeath>1616-04-23</a:dateOfDeath>
    </a:author>
    <a:author id="2">
        <p:firstName>J.K.</p:firstName>
        <p:lastName>Rowling</p:lastName>
        <a:dateOfBirth>1965-07-31</a:dateOfBirth>
    </a:author>
    <a:author id="3">
        <p:firstName>Paulo</p:firstName>
        <p:lastName>Coelho</p:lastName>
        <a:dateOfBirth>1947-08-24</a:dateOfBirth>
    </a:author>
    <a:author id="4">
        <p:firstName>Stephen</p:firstName>
        <p:lastName>King</p:lastName>
        <a:dateOfBirth>1947-09-21</a:dateOfBirth>
    </a:author>
    <a:author id="5">
        <p:firstName>Tom</p:firstName>
        <p:lastName>Clancy</p:lastName>
        <a:dateOfBirth>1947-04-12</a:dateOfBirth>
        <a:dateOfDeath>2013-10-01</a:dateOfDeath>
    </a:author>
    <a:author id="6">
        <p:firstName>Napoleon</p:firstName>
        <p:lastName>Hill</p:lastName>
        <a:dateOfBirth>1883-09-26</a:dateOfBirth>
        <a:dateOfDeath>1970-11-08</a:dateOfDeath>
    </a:author>
</a:authors>

XSLT

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
        version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:old="http://www.demo.com/author"
        xmlns:a="http://marklogicacademy.ml/library/authors/v2">
    <xsl:template match="node()|@*">
        <xsl:copy copy-namespaces="no">
            <xsl:apply-templates select="node()|@*"/>
        </xsl:copy>
    </xsl:template>
    <xsl:template match="old:*">
        <xsl:element name="{name()}" namespace="http://marklogicacademy.ml/library/authors/v2" >
            <xsl:apply-templates select="node()|@*"/>
        </xsl:element>
    </xsl:template>
</xsl:stylesheet>
No error, no output XML ``` <?xml version="1.0" encoding="UTF-8"?> <a:authors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.demo.com/author" xmlns:a="http://www.demo.com/author" xmlns:p="http://www.demo.com/person" xsi:schemaLocation="http://www.demo.com/author author.xsd"> <a:author id="1"> <p:firstName>William</p:firstName> <p:lastName>Shakespeare</p:lastName> <a:dateOfBirth>1564-04-23</a:dateOfBirth> <a:dateOfDeath>1616-04-23</a:dateOfDeath> </a:author> <a:author id="2"> <p:firstName>J.K.</p:firstName> <p:lastName>Rowling</p:lastName> <a:dateOfBirth>1965-07-31</a:dateOfBirth> </a:author> <a:author id="3"> <p:firstName>Paulo</p:firstName> <p:lastName>Coelho</p:lastName> <a:dateOfBirth>1947-08-24</a:dateOfBirth> </a:author> <a:author id="4"> <p:firstName>Stephen</p:firstName> <p:lastName>King</p:lastName> <a:dateOfBirth>1947-09-21</a:dateOfBirth> </a:author> <a:author id="5"> <p:firstName>Tom</p:firstName> <p:lastName>Clancy</p:lastName> <a:dateOfBirth>1947-04-12</a:dateOfBirth> <a:dateOfDeath>2013-10-01</a:dateOfDeath> </a:author> <a:author id="6"> <p:firstName>Napoleon</p:firstName> <p:lastName>Hill</p:lastName> <a:dateOfBirth>1883-09-26</a:dateOfBirth> <a:dateOfDeath>1970-11-08</a:dateOfDeath> </a:author> </a:authors> ``` XSLT ``` <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:old="http://www.demo.com/author" xmlns:a="http://marklogicacademy.ml/library/authors/v2"> <xsl:template match="node()|@*"> <xsl:copy copy-namespaces="no"> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template> <xsl:template match="old:*"> <xsl:element name="{name()}" namespace="http://marklogicacademy.ml/library/authors/v2" > <xsl:apply-templates select="node()|@*"/> </xsl:element> </xsl:template> </xsl:stylesheet> ```
Collaborator

fixed in #297

fixed in #297
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: R11/release11-tools#287
No description provided.