f:json-document() returning empty document

FXSL Help
2009-05-11
2013-04-15
  • Alessandro Vernet

    I am playing with f:json-document(), but fail to get it to return something even for a simple document. My stylesheet looks like this: http://pastie.org/474219. I am running this on Saxon 8.8. Am I missing something?

    Alex

     
    • Dimitre Novatchev

      There is an example how to use this fuction. It is the testFunc-json-document.xsl file in the Tests folder:

         http://fxsl.cvs.sourceforge.net/viewvc/fxsl/fxsl-xslt2/Tests/testFunc-json-document.xsl?revision=1.1&view=markup

      When applied on any XML file (not used) this transformation produces the correct result.

      One potential factor that could cause your problem is the use of relatively old version of Saxon -- please use a 9.x version of Saxon.

      Also, the link in your message is unreachable.

      Cheers,
      Dimitre Novatchev

       
      • Alessandro Vernet

        Dimitre,

        Thank you for the quick response. For now, I am stuck with Saxon 8 (until we upgrade to 9). This looks like an awesome library, and I am sure I will be back to it.

        Alex

         
  • Anonymous - 2010-01-27

    Dimitre,

    I'm having a similar problem.
    I've been using the latest version of the json-document() function.

    When I use it with Saxon 9, all is well, my JSON document gets parsed and I get an XML tree in return.
    However, I only use Saxon in my dev environment (within Oxygen). In production, I need to run the same stylesheet with AltovaXML 2010.  That's where things stop working…
    AltovaXML chokes on a few things

    XTTE0570: Error in XPath 2.0 expression at xsl:variable - as
    f\func-json-document.xsl
    Line 236, Character 35
    Type error, value does not match a required type as specified by the matching rules in 2.5.4 SequenceType Matching. - 'xs:string'
    

    This is in the declaration of variable "vRegExJSON"

    I tried removing the type declaration, and when doing so, it chokes on the content of the func-lrParse.xsl file

    XTTE0570: Error in XPath 2.0 expression at xsl:variable - as
    f\func-lrParse.xsl
    Line 62, Character 35
    Type error, value does not match a required type as specified by the matching rules in 2.5.4 SequenceType Matching. - 'xs:string'
    

    This time, it's the declaration of the "vToken" variable.

    If I remove that type declaration as well, it stops choking, but the function json-document() now returns nothing.
    If I try it in Saxon at that stage, it works exactly as before…

    I'm wondering if you have any idea what the problem could be?

     
  • Dimitre Novatchev

    Wabiloo,

    There are numerous bugs in Altova, so I am not using them. Try (if possible), to turn off their schema-awareness support.

     
  • tsuba

    tsuba - 2012-03-26

    Hi,

    I am having the same problem as avernet but I am using IBM'S XML Feature Pack for Websphere 7. I have tried running the test cases, turning on the debug variables, etc. but I cannot figure out what is going wrong. I don't get error messages, but I don't get output either.

     

Log in to post a comment.