I'm yet searching for some time for a solution for a problem with some database exports looking as follows:
<DATA>
<ROW>
<ID>36342</ID>
<TIMESTAMP1>2017-11-24 14:54:51</TIMESTAMP1>
<TIMESTAMP2>2017-11-24 14:54:51</TIMESTAMP2>
<NOTES>please try <variable_name> inside <function></NOTES>
</ROW>
<ROW>
<ID>36341</ID>
<TIMESTAMP1>2017-11-24 12:51:50</TIMESTAMP1>
<TIMESTAMP2>2017-11-24 12:51:50</TIMESTAMP2>
<NOTES>Otherwise <option> could also be</NOTES>
</ROW>
</DATA>
The real data in use is in fact a Support Database, means there are multiple place holders in hundreds of thousands of Entrys (NOTES2), so of course I cannot change any content. Also the Notes can contain any number of place holders, including none.
Now the problem is about, how to be able to understand any Content of "NOTES" as plain text, ignoring all XML lookalikes like <function>
, <variable_name>
and <option>
. (and of course many others)
What I've got yet:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xsd:element name="DATA" sql:is-constant="1" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ROW" sql:relation="document" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ID" type="xsd:string" />
<xsd:element name="TIMESTAMP1" type="xsd:string" />
<xsd:element name="TIMESTAMP2" type="xsd:string" />
<xsd:element name="NOTES" type="string" >
<xsd:complexType>
<xsd:sequence>
<xsd:any processContents="skip" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
I have to add that I am in fact not an expert in XML/XSD. I'm only able to understand what I read. What I do read is, any Tag found inside "NOTES" should be skipped on interpretion. But unfortunately the Parser says:
'type' cannot be present with either 'simpleType' or 'complexType'
So of course the error message tells me to delete the entity "type" of the Element "NOTES", but if I do so the error is:
Text is not allowed in the context of element 'NOTES' according to DTD/Schema.
So how would I now get the full content of such an element?
Best regards Marius