Jump to content

How to see if a node is from a specific type/name?


Recommended Posts

I am making a transform file to filter out specific tags from a documentmy xml file looks like this:<classification> <internal>blabla</internal> <confidential>blub</confidential> <internal>blublu</internal></classification>i am trying to only transform the <internal> tags for example...i am trying something like this for example to see if the current node is part of the <internal> tag:<xsl:when test=".=/CLASSIFICATION/INTERNAL">or<xsl:when test=".=INTERNAL">and i have tried alot more toobut none of it wants to work...can anybody plz help me out?thx

Link to comment
Share on other sites

i found a way to filter those tags out:

<?xml version="1.0"?><xsl:stylesheet version="1.0"	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"	xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"	xmlns:s="urn:classification">    <xsl:template match="/">        <w:wordDocument>            <w:docPr>                <w:showXMLTags w:val="off" />            </w:docPr>            <xsl:apply-templates />        </w:wordDocument>    </xsl:template>    <xsl:template match="s:CLASSIFICATION">        <w:body>            <s:CLASSIFICATION>  <xsl:for-each select="s:INTERNAL | text()">                    <w:p>                          <w:r>                              <w:t><xsl:value-of select="." /></w:t>                          </w:r>               </w:p>	  </xsl:for-each>            </s:CLASSIFICATION>        </w:body>    </xsl:template></xsl:stylesheet>

but now a new problem arrises:this transform file only seems to work on simple xml files when opening them with word...when i save a word doc in xml, and then attach my schema to it with the transform files, it doesnt display the XML document tab in the word task panealso it seems like the transform file looses all wordml tagsits driving me insane how sucky this all works, in meanwhile ive made a simple vb macro that does exactly what i want without the stupid transform files...but ill keep on havin a look at this post if any good answers come bythx in advance

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...