[erlang-questions] Can anyone help with this irksome erlsom problem?

Alan Evans alanrevans@REDACTED
Thu Apr 19 11:15:05 CEST 2018

Hello Erlang experts,

I'm having  a problem trying to parse some XML using the excellent 
erlsom tool, I don't know if it's me, erlsom, XML, XSD or something else 
that's giving me issues.

The XML I'm trying to parse looks like this and the problem I have is 
with the xsi:type attribute on the Value element, oh and by the way, I 
can't change the XML as it coming from a 3rd party.

<soap:Envelope xmlns:cwmp="urn:dslforum-org:cwmp-1-0"
<cwmp:ID soap:mustUnderstand="1">1410271757429_7070_2008420083</cwmp:ID>
<ParameterList soap-enc:arrayType="cwmp:ParameterValueStruct[1]">
<Value xsi:type="xsd:string"></Value>

The error I get is:

34> erlsom:scan_file(Xml, ModelIn).
{error,[{exception,{error,"Type not found in hierarchy: in:ValueElement"}},

The XSD I'm using is here: https://pastebin.com/VrBx0j0f
It is based of the the standard TR069 XSD but I had to modify it to make 
the Value element a complexType in order to add the attribute.

Value was defined as

   <xs:element name="Value" type="xs:anySimpleType"/>

and is now defined as

   <xs:complexType name="ValueElement">
       <xs:extension base="xs:anySimpleType">
         <xs:attribute name="xsi:type" type="xs:string">

A session showing the problem is here: https://pastebin.com/APSLK4ry

Many thanks for reading this far.



This email has been checked for viruses by Avast antivirus software.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180419/9ce9a436/attachment.htm>

More information about the erlang-questions mailing list