Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 16th, 2004, 04:18 PM
Authorized User
 
Join Date: Jun 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSD - String values that contain '<' and '>'

Hello,

My xml scheme contains an element that has no attributes and takes on string values as shown below.

...
<xs:element name="start" type=xs:string"></element>
...

My xml file looks like this,

<start>
Hello, notice that this text contains <b>html</b>
</start>

Notice that the value contains html. Validating this xml against my schema returns an error saying that "<b> is not a child element of <start>".

Is there a way to define the data type 'xs:string' to take on html text literally and not treat it as elements of the schema?

Please advise,

Bobby

 
Old November 17th, 2004, 05:31 PM
Authorized User
 
Join Date: Nov 2004
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to jkmyoung
Default

since you don't really have any restriction on the string you could use <xs:any> inside of start.

 
Old November 17th, 2004, 05:56 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Or put the contents in a cdata section, otherwise you must escape the characters.

--

Joe (Microsoft MVP - XML)
 
Old March 10th, 2005, 07:01 AM
Authorized User
 
Join Date: Jan 2005
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JelfMaria
Default

<xs:element name="start" type="xs:string"></element>
...

try thiz:)






Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 8: <asp:image> inside <a> & ext.CSS (pg. 274) epc BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 July 12th, 2008 04:37 AM
How to enter <...,1> values into table. RaCheer SQL Language 1 February 5th, 2006 11:59 PM
<style> tags in a <body> vs. <div> bcat BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 March 27th, 2005 08:50 AM
<marquee><b>About CHAT App. in PHP4</b></marquee> Ramkrishna PHP How-To 1 September 11th, 2004 07:01 AM
<STRONG> vs <B> and <EM> vs <I> anshul HTML Code Clinic 12 September 1st, 2004 05:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.