Clarity

  • 1.  XOG error: [Error] :0:0: uncompleted content model. expecting:

    Posted Nov 30, 2015 03:30 AM

    When I try to XOG in a portlet, I get the below error message:

    [Error] :0:0: uncompleted content model. expecting: <nls>

     

    On notepad++, when I try to validate the xml, I get the below error:

     

     

    Any clue on this ?

     

    NJ



  • 2.  Re: XOG error: [Error] :0:0: uncompleted content model. expecting:

    Posted Nov 30, 2015 03:47 AM

    My logic when dealing with unhelpful error messages is something like ; Does the XML render OK in IE? If not then its mal-formed XML - check the syntax.

     

    If it does render OK in IE, but doesn't XOG, then its a 'Clarity thing' (there were some old bugs around that error message (ref. CLRT-22616)) - but you can remove "chunks" of the XML to tryt to narrow down where in the XML it is causing problems (for example in a portlet-write, remove the portlet and just try XOG-ing the query?).



  • 3.  Re: XOG error: [Error] :0:0: uncompleted content model. expecting:

    Posted Nov 30, 2015 09:41 AM

    Instead of using this:

    <?xml version="1.0" encoding="UTF-8"?>

    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_read.xsd">

      <Header version="8.0" action="read" objectType="contentPack" externalSource="NIKU">

        <args contentType="view" name="order_by_1" value="code"/>

        <args name="documentLocation" value="C:\niku"/>

      </Header>

      <PortletQuery>

        <Filter name="code" criteria="EQUALS">xxxx</Filter>

      </PortletQuery>

    </NikuDataBus>

     

    I used this to xog out the portlet, and was then able to xog in the portlet to the desired environment:

    <?xml version="1.0" encoding="UTF-8"?>

    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_read.xsd">

      <Header version="8.0" action="read" objectType="contentPack" externalSource="NIKU">

        <args contentType="view" name="order_by_1" value="code"/>

        <args name="documentLocation" value="C:\niku"/>

        <args name="no_dependencies" value="true"/>

      </Header>

      <PortletQuery>

        <Filter name="code" criteria="EQUALS">xxxx</Filter>

      </PortletQuery>

    </NikuDataBus>

     

    NJ



  • 4.  Re: XOG error: [Error] :0:0: uncompleted content model. expecting:

    Posted Nov 30, 2015 01:40 PM

    As a fond user of Notepad++ myself there are some things about the XML plugins for it which limit its use for analysing some specific problems.

     

    The first/main one where Clarity is concerned are the schemas-referencing-schemas hierarchy of files and how they'll be parsed.  In my experience, overcoming one of those problems often just leads to another.  The other one - unrelated to this problem - is with it usually requiring XML well-formed documents for doing anything with, when sometimes you just want to work with an XML fragment file (e.g. no single root element).  That one I usually overcome by adding a dummy <root>..</root> wrapper around things.

     

    It looks like you've found a way to avoid including the XML in your output that was causing you a problem, but if that is content you still need to include somewhere/somehow then you can hopefully get more clues from my replies to you here: https://communities.ca.com/people/nick_darlington/blog/2015/02/09/identifying-the-location-of-a-xog-file-parsing-error-i…

     

    Hopefully that article ( Identifying the location of a XOG file parsing error (invalid XML data)  ) will also be of use to others when trying to pinpoint the source of these problems (even though I too sometimes resort to slicing the XML into pieces to perform a process-of-elimination effort to find the affected area(s)).



  • 5.  Re: XOG error: [Error] :0:0: uncompleted content model. expecting:

    Posted Nov 30, 2015 07:01 PM

    Just wondering if

      <args name="documentLocation" value="C:\niku"/>

    is valid and spefically if \ is not an HTML escape code which causes the  problem.

     

    Does the first xml work? and does the open in the browser  without problems?

     

    Converting the escape codes  in

    &lt;nls&gt;

    to normal gives

    < nls >

     

    which again suggests and something other  is expected than what is in the  sequence of the  second xml file.



  • 6.  Re: XOG error: [Error] :0:0: uncompleted content model. expecting:

    Posted Dec 01, 2015 10:18 AM

    The \ character is fine from a HTML or XML standards standpoint, it isn't considered to be an escape character or similar as it is in some other languages.

     

    The only place it may trip up would be further downstream in the processing, if (and only if) the code that uses that entry to try and create or read any files in that location, and for the sake of C/C++/Java runtimes, it was expecting to use the value literally since then it would need to have been escaped like c:\\niku in order to work.  These runtimes are also what allow for a unix-styled path to work against OS's that wouldn't normally support them (e.g. c:/niku).

     

    I've not looked at this specific operation to see if an escaped or unix-style path would be necessary though, so this is just a blanket statement on the topic.

     

    Browsers will often not apply an XML schema definition against the data they are showing in the browser window; instead they supply their own XSLT in order to perform syntax highlighting and colouring of the data they show (and in IE's case the collapse/expand javascript snippets).  As such, the browser can only tell you if the XML is formed at a basic level (i.e. just as a bunch of XML characters, are they well-formed or not, such as missing end tags).

     

    The complaint in this case comes in a stage that occurs after that where the XML is then validated against a schema, and it is found not to contain specific elements or other items where they were supposed to go.  To resolve that, if the file isn't small enough to simply 'eyeball' it for a reason, then you will need to employ an XML parsing library that can perform multiple schema-definition validation parsing for you, which the msv.jar referenced in my posting will try and do for you (though it's just a developer library with a couple of command prompt invocations - it's not a rich or user-friendly client).