GetXMLDocument Newbie Issue (can't even get the basics working)
Hi all,
I have tried the wiki entries and even some code from the forum but can't get this to work so clearly doing something daft. To start getting it to return the data would be fantastic and then I will work away to get my more complex end solution, hopefully with not too many questions along the way!!
note: myexcess.com is not public, its an internal DNS address but can return the XML in IE if I type the address in on the server.
It's probably just a namespace issue - you need to declare a prefix for the (albeit weird) namespace that the root element of the XML is wrapped in - and then you need to use that prefix when addressing said element:
It has been doing my head in..... The weird namespace is mainly from the fact that I do the core work for my application in Biztalk, schemas are managed there so may as well keep it consistent. The ul and li was me stabbing in the dark at the end.
Will give this a go now and let you know.
I have got the hard bit to do next, that should be interesting, but not for today.
GetXMLDocument Newbie Issue (can't even get the basics working)
Hi all,
I have tried the wiki entries and even some code from the forum but can't get this to work so clearly doing something daft. To start getting it to return the data would be fantastic and then I will work away to get my more complex end solution, hopefully with not too many questions along the way!!
note: myexcess.com is not public, its an internal DNS address but can return the XML in IE if I type the address in on the server.
Thanks in Advance!!!
XML
XSLT:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets tagsLib BlogLibrary ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<!-- start writing XSLT -->
<xsl:variable name="MyFeed" select="umbraco.library:GetXmlDocumentByUrl('http://myexcess.com/Agency_Price_Lookup_output.xml')" />
<ul>
<html>
<body>
<h2>Excess Products</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Product</th>
</tr>
<xsl:for-each select="$MyFeed/Agency/ProductDetails">
<tr>
<li><td><xsl:value-of select="ProductID"/></td></li>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</ul>
</xsl:template>
</xsl:stylesheet>
Hi Steve,
It's probably just a namespace issue - you need to declare a prefix for the (albeit weird) namespace that the root element of the XML is wrapped in - and then you need to use that prefix when addressing said element:
(I removed som strange <ul> & <li> stuff that probably shouldn't go there - feel free to add them back in, if needed...)
/Chriztian
Many Thanks Chriztian,
It has been doing my head in..... The weird namespace is mainly from the fact that I do the core work for my application in Biztalk, schemas are managed there so may as well keep it consistent. The ul and li was me stabbing in the dark at the end.
Will give this a go now and let you know.
I have got the hard bit to do next, that should be interesting, but not for today.
Steve.
Works a treat, thanks Chriztian.
Works a treat, thanks Chriztian.
is working on a reply...