Skip to content

Handling XML from external namespaces intermingled (with potentially different namespaces) #422

@ronaldtse

Description

@ronaldtse

This is from:

There are XML from external namespaces intermingled in RNG that need round-tripped.

Since these things can happen anywhere, we need to think how this works. Do we allow other elements to occur in XML we parse? As an extension mechanism?

  9) RELAX NG Specification Tests For October 26 version of the spec. For October 26 version of the spec. Section 3 For October 26 version of the spec. Section 3: Tests for foreign element and attribute handling. Section 3 compliance - correct schema round-trip
     Failure/Error: expect(regenerated).to be_equivalent_to_xml(schema_xml)
     
       Expected XML to be equivalent, but it wasn't.
     
       Diff:
        <?xml version="1.0"?>
        <element xmlns="http://relaxng.org/ns/structure/1.0" name="foo">
       -  <empty>
       -    <ext xmlns="http://www.example.com">
       -      <element xmlns="http://relaxng.org/ns/structure/1.0"/>
       -    </ext>
       -  </empty>
       +  <empty/>
        </element>
     # ./spec/rng/spectest_spec.rb:93:in `block (4 levels) in process_test_suite'


  10) RELAX NG Specification Tests For October 26 version of the spec. For October 26 version of the spec. Section 3 For October 26 version of the spec. Section 3: Tests for foreign element and attribute handling. Section 3 compliance - correct schema round-trip
      Failure/Error: expect(regenerated).to be_equivalent_to_xml(schema_xml)
      
        Expected XML to be equivalent, but it wasn't.
      
        Diff:
         <?xml version="1.0"?>
        -<grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:eg="http://www.example.com">
        -  <eg:comment/>
        -  <eg:comment/>
        +<grammar xmlns="http://relaxng.org/ns/structure/1.0">
           <start>
        -    <eg:comment/>
             <element>
        -      <eg:comment/>
        -      <eg:comment/>
               <name>foo</name>
        -      <eg:comment/>
               <data type="string"/>
        -      <eg:comment/>
        -      <empty>
        -        <eg:comment/>
        -        <eg:comment/>
        -      </empty>
        -      <eg:comment/>
        -      <eg:comment/>
        +      <empty/>
             </element>
        -    <eg:comment/>
           </start>
        -  <eg:comment/>
         </grammar>
      # ./spec/rng/spectest_spec.rb:93:in `block (4 levels) in process_test_suite'

Originally posted by @ronaldtse in lutaml/rng#4 (comment)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions