Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jonas Høiby 62 posts 53 karma points
    Sep 23, 2009 @ 12:36
    Jonas Høiby
    0

    xml output on .aspx page import into xslt ..?

    i have this page in my CMS:

    http://umbraco.dev/xml/staysNewsFeed.aspx

     

    which contains a single usercontrol that outputs XML like this:

    <?xml version="1.0" encoding="utf-8"?>
    <Root>
      <Stay>
        <Country>something</Country>
        <City>something</City>
        <Description>something</Description>
        <Price>something</Price>
        <youSave>something</youSave>
        <youSaveText>something</youSaveText>
      </Stay>
    </Root>

    so basicly the aspx file is an xml file in disguise .. :P ..

     

    but how do i go about importing this xml into an xslt file in the CMS? :-)

     

    if i just use the "umbraco.library:GetXmlDocumentByUrl($url)" i get an error like this:

    System.Xml.XmlException: There is no Unicode byte order mark. Cannot switch to Unicode. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res) at System.Xml.XmlTextReaderImpl.CheckEncoding(String newEncodingName) at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl) at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) at System.Xml.XmlDocument.Load(XmlReader reader) at umbraco.library.GetXmlDocumentByUrl(String Url)

     

    How do I go about this issue? :-)

  • dandrayne 1138 posts 2262 karma points
    Sep 23, 2009 @ 12:43
    dandrayne
    0

    Hmm.  I'd check the encoding of the page when you view it in a browser and make sure it's utf-8 and with a correct MIME type.  In firefox you can do this by loading the page and going to TOOLS > PAGE INFO in the menus.  If your mimetype needs changed you there is a package for doing just that in umbraco utilities.

    You can also try

    <xsl:variable name="yourVariable" select="document('/path/to/page.aspx')"/>

    And see if you get a different result.

  • Jonas Høiby 62 posts 53 karma points
    Sep 23, 2009 @ 13:29
    Jonas Høiby
    0

    in the code it says:

     

    <?xml version="1.0" encoding="utf-16"?>

     

    but when i goto tools > page info:

    it says UTF-8

     

    what is going on here? :-s

     

  • Jonas Høiby 62 posts 53 karma points
    Oct 20, 2009 @ 12:48
    Jonas Høiby
    0

    used an XSLT extension for this import .. :-)

Please Sign in or register to post replies

Write your reply to:

Draft