Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDATA section

Status
Not open for further replies.

CodeDigger

Programmer
Jan 7, 2005
11
CA
I have a <Any> element in my Schema to catch any type of content -

<xs:element minOccurs="0" maxOccurs="unbounded" name="MixedDescription">
<xs:complexType mixed="true">
<xs:sequence>
<xs:any processContents="skip" />
</xs:sequence>
</xs:complexType>
</xs:element>

But it does not catch entities like this &ndash; -

<MixedDescription>....some content &ndash; ... content continues</MixedDescription>

XmlSpy, Stylus Studio and Visual Studio all point out that this is an undeclared charater entity.

I came across this idea to implement entites as elments -

but there are a LOT of characters to replace which are possible Xml Character entities, so this is not a practical solution.

What wrapping values with CDATA clause works, but how to declare that in a Biztalk schema? How to instruct Biztalk that one node is a CDATA node and ignore its contents?
 
OK I figured this out via this hint


Use an XSLT library called xmlchar

and in the instance add this line (via pre-processing) (where xmlchar is the href to the library URI)


Code:
<!DOCTYPE ONIXMessage[<!ENTITY % html.4.entities SYSTEM "xmlchar/html4-all.ent">%html.4.entities;]>
<ONIXMessage xmlns:xsi=" xmlns:ch=" ...(other declarations) >


Don't forget to add the xmlns:ch declaration and make sure the DOCTYPE root node is your root node.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top