Note that there are some explanatory texts on larger screens.

plurals
  1. POXSLT Document function returns empty result on Maven POM
    text
    copied!<p>Greetings!</p> <p>I want to extract some properties from different Maven POMs in a XSLT via the document function. The script itself works fine but the document function returns an empty result for the POM as long as I have the <em>xmlns="http://maven.apache.org/POM/4.0.0"</em> in the project tag. If I remove it, everything works fine.</p> <p>Any idea how the make this work while leaving the xmlns attribute where it belongs or why this doesn't work with the attribute in place?</p> <p>Here comes the relevant portion of my XSLT:</p> <pre><code>&lt;xsl:template match="abcs"&gt; &lt;xsl:variable name="artifactCoordinate" select="abc"/&gt; &lt;xsl:choose&gt; &lt;xsl:when test="document(concat($artifactCoordinate,'-pom.xml'))"&gt; &lt;abc&gt; &lt;ID&gt;&lt;xsl:value-of select="$artifactCoordinate"/&gt;&lt;/ID&gt; &lt;xsl:copy-of select="document(concat($artifactCoordinate,'-pom.xml'))/project/properties"/&gt; &lt;/abc&gt; &lt;/xsl:when&gt; &lt;xsl:otherwise&gt; &lt;xsl:message terminate="yes"&gt; Transformation failed: POM "&lt;xsl:value-of select="concat($artifactCoordinate,'-pom.xml')"/&gt;" doesn't exist. &lt;/xsl:message&gt; &lt;/xsl:otherwise&gt; &lt;/xsl:choose&gt; </code></pre> <p></p> <p>And, for completeness, a POM extract with the "bad" attribute:</p> <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;!-- ... --&gt; &lt;properties&gt; &lt;proalpha.version&gt;[5.2a]&lt;/proalpha.version&gt; &lt;proalpha.openedge.version&gt;[10.1B]&lt;/proalpha.openedge.version&gt; &lt;proalpha.optimierer.version&gt;[1.1]&lt;/proalpha.optimierer.version&gt; &lt;proalpha.sonic.version&gt;[7.6.1]&lt;/proalpha.sonic.version&gt; &lt;/properties&gt; &lt;/project&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload