clarify problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mihiri
    New Member
    • May 2007
    • 31

    #1

    clarify problem

    how to solve this problem Assignment.xml: 3:20: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentati on'. Saw 'Assignment'. this is repeat for all tags
    this is the xml document
    [code=xml]<?xml version="1.0" encoding="UTF-8" ?>
    <SONG>
    <TITLE>Assignme nt</TITLE>
    <COMPOSER>Jacqu es Morali</COMPOSER>
    <COMPOSER>Hen ri Belolo</COMPOSER>
    <COMPOSER>Victo r Willis</COMPOSER>
    <PRODUCER>Jacqu es Morali</PRODUCER>
    <!-- This is a comment. -->
    <LENGTH>6:20</LENGTH>
    <YEAR>1978</YEAR>
    <ARTIST>Villa ge People</ARTIST>
    </SONG>
    <!-- You can tell what album I was
    listening to when I wrote this example -->[/code]
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    #2
    Welcome to TSDN.

    how much did u proceed????

    kind regrds.
    dmjpro.

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Originally posted by mihiri
      how to solve this problem Assignment.xml: 3:20: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentati on'. Saw 'Assignment'. this is repeat for all tags
      this is the xml document
      <?xml version="1.0" encoding="UTF-8" ?>
      <SONG>
      <TITLE>Assignme nt</TITLE>
      <COMPOSER>Jacqu es Morali</COMPOSER>
      <COMPOSER>Hen ri Belolo</COMPOSER>
      <COMPOSER>Victo r Willis</COMPOSER>
      <PRODUCER>Jacqu es Morali</PRODUCER>
      <!-- This is a comment. -->
      <LENGTH>6:20</LENGTH>
      <YEAR>1978</YEAR>
      <ARTIST>Villa ge People</ARTIST>
      </SONG>
      <!-- You can tell what album I was
      listening to when I wrote this example -->
      Moved to XML forum .

      Comment

      • dorinbogdan
        Recognized Expert Contributor
        • Feb 2007
        • 839

        #4
        Please give more details about how did you get the error.

        Comment

        • Entropy
          New Member
          • Sep 2007
          • 3

          #5
          Has anyone resolved this? I had something similar. I am using Xerces in Websphere to parse a file full of application configuration info. The process has worked many times in the past. I resently moved my XML file into the package as a system resource, and that worked fine but then recently I suddenly get streams of

          "[Error] :5:22: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentati on'. Saw 'jdbc:db2:ABO'. "

          One for each node in the XML file. This occurs as I invoke

          parser.parse(ne w InputSource(xml File));

          on the DOMParser object. This began as I was reorganizing the project a bit, and changing classpaths and so forth, but I don't see how those changes should be impacting this behavior as it plainly finds BOTH the XML file AND the DOMParser. Still, I MUST have done something during that process, but have no idea what.

          If you have a solution please email bmulholland@cas severn.com as i do not regularly read these forums.

          Comment

          • jkmyoung
            Recognized Expert Top Contributor
            • Mar 2006
            • 2057

            #6
            The element field is probably not cast to an xs:string.

            Comment

            • Entropy
              New Member
              • Sep 2007
              • 3

              #7
              Originally posted by jkmyoung
              The element field is probably not cast to an xs:string.
              Can you elaborate on that? Do you mean I have to do something as I parse it in Java? Or is this something wrong with the XML source?

              Note that I am not doing anything fancy with XSLT nor even using a schema. This is plain XML. More to the point the code did not change, nor did the XML source. I just fiddled with how I broke my project up.

              I do have more info from yesterday...I noticed that the failure only occurs when I perform the parse from a piece of code I am deploying to the server's lib directory because it is a custom registry in WAS. Now, this same bit of code HAS worked in that environment before, but whatever I broke only affects this deployable, not the regular EAR.

              I must have broken some classpath setting or something, but the messages I get are infuriatingly unhelpful AND I can tell from the debug that both the XML file AND Xerces are being successfully loaded before the problems occur.

              Comment

              • jkmyoung
                Recognized Expert Top Contributor
                • Mar 2006
                • 2057

                #8
                Normally these errors come from validating against a schema.

                It could be that you are automatically drawing the schema file from somewhere.
                Assuming you're using Java Xerces, you could try creating a new project and seeing if that works. Alternatively, you could try setting a different parser, but I'm assuming your code is based on the behaviour of that particular xml parser.

                Comment

                • Entropy
                  New Member
                  • Sep 2007
                  • 3

                  #9
                  To help those in the future with this problem (I googled all over and found nothing) what happened to me is pretty simple and I feel a little silly with how simple it turned out to be.

                  While I was retooling I must have removed the import for DOMParser and used exclipse's prompting mechanism to reinclude it (I am guessing because I don't remember changing it at all). The problem is that it found two different DOMParsers and I must have accidentally chosen the wrong one. One was org.apache.xerc es.parsers.DOMP arser. The other was org.apache.xerc es.impl.xs.dom. DOMParser. The former works fine, the latter gives the error I sited.

                  Comment

                  Working...