How do i designate in XSD that an element only contains CDATA?

前端 未结 2 481
无人共我
无人共我 2021-01-01 10:28

How can I represent the following in XSD.


    

相关标签:
2条回答
  • 2021-01-01 11:04
    <element name="price-update" type="string"></element>  
    

    is about as close as you can get.

    (I thought it best to move the answer out of the comments and into an actual answer).

    0 讨论(0)
  • 2021-01-01 11:13

    A CDATA tag is merely a means of escaping data as a text node. Therefore you cannot stipulate that you require a CDATA node.

    From a DOM perspective, the following documents are identical:

    <doc>value</doc>
    

    and

    <doc><![CDATA[value]]></doc>
    
    0 讨论(0)
提交回复
热议问题