Using xsd: any for extensible schema

So far, I've handled extensions by defining a placeholder that has the name and value attributes, as shown in the example below

<root>
   <typed-content>
      ...
   </typed-content>
   <extension name="var1" value="val1"/>
   <extension name="var2" value="val2"/>
....
</root>

Now I plan to switch to using xsd: any . I would appreciate if you can help me choose the best approach.

  • What is adding the xsd value: any of my previous approach, if I specify processContents = "strict"
  • Can the EAI / ESB tool / library execute XPATH expressions regarding the elements I return.
  • I see various binding tools handling this separately when creating the binding code. Is this the same case if I include namespace = "http: // mynamespace" and provide a scheme for "http: // mynamespace" during code generation?
  • Does this comply with WS-I?
  • Are there any errors that I am missing?

thank

+3
source share
2 answers
  • Use <xsd:any processContents="strict">gives people the ability to add extensions to their XML instance documents without changing the original schema. This is the critical advantage that it gives you.
  • . , , , , , . , <xsd:any> .
  • <xsd:any> . , , , . . JAXB (RI, ) , .
  • . XML-, XML- WS-I
  • <xsd:any> - , , . , , .
+2

3

  . , , , . . JAXB (RI, ) , .

@XmlAnyElement JAXB. :

@XmlAnyElement - DOM

, XML DOM.

@XMLAnyElement (lax = true) -

lax = true, JAXB , QName, .

+1

Source: https://habr.com/ru/post/1789649/


All Articles