Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xsltProcess fails matching //section XPath expression #117

Open
pamoller opened this issue Feb 6, 2025 · 0 comments
Open

xsltProcess fails matching //section XPath expression #117

pamoller opened this issue Feb 6, 2025 · 0 comments

Comments

@pamoller
Copy link

pamoller commented Feb 6, 2025

In the following the Deno program xsltProcess fails matching //section XPath expression as expected. //* behaves as excpected.

import { Xslt, XmlParser } from 'npm:xslt-processor'
const xslt = new Xslt();
const xmlParser = new XmlParser();
let result = await xslt.xsltProcess(
    xmlParser.xmlParse('<root id="n12"><section id="n1">1</section><section id="n2">2</section></root>'),
    xmlParser.xmlParse(`<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="text" encoding="UTF-8" />
    <xsl:template match="//section">
        <xsl:value-of select="." />
    </xsl:template>
</xsl:stylesheet>`));
console.log(result);

results in


instead of

12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant