Validate XPath on variable
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 32
- Joined: Wed Jan 25, 2006 5:43 pm
Validate XPath on variable
Hi,
can anybody tell me if something like the following is possible? I'm reading the content of an XML-file into a variable and would like to validate if an XPath expression which is defined in the context actually matches a node within the variable's temporary tree.
$srcContent contains the expected data und XPathExpr contains an XPath that, if applied to the document, would find a match. Nevertheless if combined as above it's just not working.
Any help is truly appreciated.
Cheers,
Alex
can anybody tell me if something like the following is possible? I'm reading the content of an XML-file into a variable and would like to validate if an XPath expression which is defined in the context actually matches a node within the variable's temporary tree.
Code: Select all
<xsl:template name="ValidateXPath">
<xsl:param name="root"/>
<xsl:for-each select="$root/msg:Entry">
<xsl:variable name="SrcFile" select="concat( '../xml/' , msg:InputFile)"/>
<xsl:variable name="SrcContent">
<xsl:copy-of select="document($SrcFile)/child::*[1]"/>
</xsl:variable>
<xsl:for-each select="msg:Values/msg:Value">
<xsl:if test="not($SrcContent[msg:XPathExpr])">
<xsl:message >No Match: </xsl:message>
<xsl:message select="msg:XPathExpr"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
Any help is truly appreciated.
Cheers,
Alex
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service