umbraco.library:GetXmlDocumentByUrl is getting error
Hi.
I'm having a problem with umbraco.library:GetXmlDocumentByUrl. I have this variable: <xsl:variable name="xname" select="umbraco.library:GetXmlDocumentByUrl('https://services.web.info.dk/api/prod/?user=lxxx&password=xxx&format=xml', 3600)"/> and this is working just fine.
But i need to get this in afterwards: &sincedays=10 For this I have this variable: <xsl:variable name="sourceURLxml" select="umbraco.library:GetXmlDocumentByUrl(concat($xname, '&sincedays=14'))"/>
But here the error comes. When saving the XSLT file this is written: System.UriFormatException: Invalid URI: The Uri scheme is too long. at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind) at System.Net.WebRequest.Create(String requestUriString) at umbraco.library.GetXmlDocumentByUrl(String Url)
I can't use &sincedays=10 in the first variable that's why I'm using concat in the second variable.
umbraco.library:GetXmlDocumentByUrl is getting error
Hi.
I'm having a problem with umbraco.library:GetXmlDocumentByUrl.
I have this variable: <xsl:variable name="xname" select="umbraco.library:GetXmlDocumentByUrl('https://services.web.info.dk/api/prod/?user=lxxx&password=xxx&format=xml', 3600)"/> and this is working just fine.
But i need to get this in afterwards: &sincedays=10
For this I have this variable: <xsl:variable name="sourceURLxml" select="umbraco.library:GetXmlDocumentByUrl(concat($xname, '&sincedays=14'))"/>
But here the error comes.
When saving the XSLT file this is written:
System.UriFormatException: Invalid URI: The Uri scheme is too long.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Net.WebRequest.Create(String requestUriString)
at umbraco.library.GetXmlDocumentByUrl(String Url)
I can't use &sincedays=10 in the first variable that's why I'm using concat in the second variable.
Hope any one can tell why the error comes.
/pth
Hi Palle,
This fails because you're already fetching XML in the first variable, and then you're using that XML as the URL in the second one - try this instead:
/Chriztian
Hi Chriztian.
Of course. Got it working.
Thanks
/pth
is working on a reply...