Jump to content

xsl that won't work


clark

Recommended Posts

Hi,Can anyone see the problem with the xsl code below? I'm using it against a large xml file, so have given the xpath expression below also that works when used in XMLSpy. I just don't understand why the code isn't working. I have tried numerous variations of paths, and xslt elements, but to no avail.

<?xml version="1.0" encoding="ISO-8859-1"?><xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"				xmlns:w="http://http://schemas.microsoft.com/office/word/2003/wordml"				xmlns:o="http://urn:schemas-microsoft-com:office:office"				xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint"><xsl:template match="/"><html><body><xsl:for-each select="w:wordDocument/w:body/wx:sect/w:p/w:pPr/w:pStyle"><p><xsl:value-of select="@w:val"/></p>  </xsl:for-each></body></html></xsl:template></xsl:stylesheet>

The XPath expression that returns a result in XMLSpy is: //w:wordDocument/w:body/wx:sect/w:p/w:pPr/w:pStyle[@w:val]It returns word document styles such as TOC1 and tableofFigures.Thanks for your help

Link to comment
Share on other sites

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><?xml-stylesheet type="text/xsl" href="trial2.xsl"?><w:wordDocument xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" w:macrosPresent="no" w:ocxPresent="no" xml:space="preserve" w:embeddedObjPresent="yes">	<o:SmartTagType o:namespaceuri="urn:schemas-microsoft-com:office:smarttags" o:name="State"/>	<o:SmartTagType o:namespaceuri="urn:schemas-microsoft-com:office:smarttags" o:name="country-region"/>	<o:SmartTagType o:namespaceuri="urn:schemas-microsoft-com:office:smarttags" o:name="PlaceName"/>	<o:SmartTagType o:namespaceuri="urn:schemas-microsoft-com:office:smarttags" o:name="City"/>	<o:SmartTagType o:namespaceuri="urn:schemas-microsoft-com:office:smarttags" o:name="place"/>			<w:body>			<wx:sect>				<w:p>					<w:pPr>						<w:pStyle w:val="Heading1"/>						<w:rPr>							<w:rFonts w:ascii="Comic Sans MS" w:h-ansi="Comic Sans MS"/>							<wx:font wx:val="Comic Sans MS"/>							<w:sz w:val="28"/>						</w:rPr>					</w:pPr>					<w:r>						<w:rPr>							<w:rFonts w:ascii="Comic Sans MS" w:h-ansi="Comic Sans MS"/>							<wx:font wx:val="Comic Sans MS"/>							<w:sz w:val="28"/>						</w:rPr>						<w:t>Establishment of the Food hall</w:t>					</w:r>					<aml:annotation aml:id="18" w:type="Word.Bookmark.End"/>				</w:p>			</wx:sect>		</w:body></w:wordDocument>

Also, what would you recommend to use instead of XMLSpy?Thanks again

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...