I'm having some trouble with this code <ul> <xsl:for-each select="document('news1.xml')/items/link-text"> <li><xsl:value-of select="." disable-output-escaping="yes"/></li> </xsl:for-each> </ul>
The XSL file containing this code and the news1.xml file containing the link-text items I want to get are in the same directory. The code works ok when I preview the XSL in Dreamweaver, but it totally fails (there is not HTML at all) when I create HTML from this XLS file in Alfresco.
I've replaced the code above with <xsl:value-of select="document('news1.xml')"/> to see what happens. Again, works in Dreamweaver but completely fails when I create HTML in Alfresco.
I'm stumped. What I'm trying to do is have this file tied to a XSD style sheet that codes the body of the page, and then use the code above to get content from a different XML file that contains all of the news items.
Thanks for any assistance you might be able to provide.
As far as I can tell the syntax should be <ul> <xsl:for-each select="parseXMLDocuments("news1", "/items/link-text")"> <li><xsl:value-of select="." disable-output-escaping="yes"/></li> </xsl:for-each> </ul>
but I'm getting an error SAXParseException: Expected whitespace (au-with-news-test.xsl, line 148, column 42)
Yes, you will get an error when previewing in DreamWeaver, as parseXMLDocuments relies on our virtualization server to execute the code for this contained within the user's sandbox.
What you can do to get to work in DreamWeaver is point DreamWeaver to the virtualization server URL to your user's sandbox. Then it should preview properly in DreamWeaver as well.
The code says look in the current directory for any documents that were created by the News web form. If you find any, parse them out and look for the heading and the list items. Apply a <H2> to the heading and make all of the list-items into a list.
It seems to work well.
My next question is - When I change the news XML instance file (the one with the data in it), how do I get Alfresco to push the change to pages that are referencing my news XML instance file?