Have you tried using the full url to the xml file? Even if it's on the local server, I think you need to specify an url as the function does perform a WebRequest.
If that doesn't help, you can always output the error that gets returned from the function.
Error xml returned in case of exception is
<error url="url">error</error>
where url is the parameter fed to the function and the error is the error message returned from the exception (if it has occured)
traversing external xml file
Im using an externale xml file as a data source, but having trouble getting the data i need in thye right order...
my source is as follows:
<xsl:variable name="kulturkalender">myfile.xml</xsl:variable>
<xsl:template match="/">
<xsl:variable name="kalender" select="umbraco.library:GetXmlDocumentByUrl($kulturkalender, 50000)" />
<ul>
<xsl:apply-templates select="$kalender//arrs" />
</ul>
</xsl:template>
<xsl:template match="arrs">
<xsl:if test="position() <= 100">
<li >
<xsl:value-of select="@genre"/><br/>
<strong><xsl:value-of select="arr/kunstner"/></strong>
</li>
</xsl:if>
</xsl:template>
My xml is as follows:
<arrlist>
<arrs genre="Musik">
<arr ArrNr="4640717">
<kunstner>Torsdagskoncerter på Østergade, Herning.</kunstner>
</arr>
<arr ArrNr="4743104">
<kunstner>Jens Christian Wandt på Hjerl Hede.</kunstner>
</arr>
</arrs>
</arrlis>
What im looking to get is list the "@genre" on every "arr" so it lists like:
<ul>
<li>Musik<br/>Torsdagskoncerter på Østergade, Herning</li>
<li>Muisk<br/>Jens Christian Wandt på Hjerl Hede.</li>
</ul>
im on 4.5.1 by the way
Have you tried using the full url to the xml file? Even if it's on the local server, I think you need to specify an url as the function does perform a WebRequest.
If that doesn't help, you can always output the error that gets returned from the function.
Error xml returned in case of exception is
where url is the parameter fed to the function and the error is the error message returned from the exception (if it has occured)
Hope this helps.
Regards,
/Dirk
Sorry for not being clear.
I typed my example as compact as possible...
my real url to the xml is a full url, i just didnt want to post it here. Im getting data out of it ok.
I'm just unable to get the "genre" attribute rendere in each <li>
Hope this makes sense.
I'll try and beat Chriztian to it, and he'll probably be around later to come up with a much better solution.
I assume the problem isn't getting the xml, if it is, take a look at what Dirk has written.
So try this (this is done off the top of my head, so I haven't tested it):
I'm not sure what sort order you want the result in ?!
Works like a charm, Thanks
Ha ha - good one, Steen :-)
/Chriztian
is working on a reply...