Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1017

No Namespace Recognition in Root element

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 2.6.2
    • None
    • XML Schema API
    • None
    • java version "1.4.2_05"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
      Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

    Description

      I try to parse a xml string containing namespaces referring to external entities. the root element uses already a namespace declared in its attributes. from my understanding this should work without problems:

      SAXParserFactory fact = SAXParserFactory.newInstance();
      fact.setNamespaceAware(true);
      fact.setValidating(true);
      fact.setFeature("http://xml.org/sax/features/validation", true);
      fact.setFeature("http://apache.org/xml/features/validation/schema", true);
      fact.setFeature("http://apache.org/xml/features/validation/schema-full-checking", true );
      fact.setFeature("http://apache.org/xml/features/continue-after-fatal-error", true );
      SAXParser parser = fact.newSAXParser();
      parser.parse(new InputSource(new StringReader(
      "<?xml version=\'1.0\' ?><env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\">
      <env:Header>
      <mm7:TransactionID xmlns:mm7=\"http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-3\">transactionId_123</mm7:TransactionID>
      </env:Header>
      <env:Body>
      <SubmitReq xmlns=\"http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-3\">
      <MM7Version>5.3.0</MM7Version>
      <SenderIdentification>
      <VASPID>test_value</VASPID>
      <VASID>73052</VASID>
      <SenderAddress>bill.clinton@whithouse.gov</SenderAddress>
      </SenderIdentification>
      <Recipients>
      <To><Number>491715498385</Number></To>
      </Recipients>
      <Priority>High</Priority>
      <Subject>The winner takes it all</Subject>
      <Content href=\" =cid:AAAA\"/>
      <Content href=\" =cid:10365435.1093426025607.apache-soap.p15142460.pureserver.info\"/>
      </SubmitReq>
      </env:Body>
      </env:Envelope>")), new DefaultHandler() );

      what I receive is:

      org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'env:Envelope'.

      Attachments

        Activity

          People

            Unassigned Unassigned
            phil42 phil42
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: