Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > BOOK: Beginning XML, 4th Ed ISBN: 978-0-470-11487-2
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning XML, 4th Ed ISBN: 978-0-470-11487-2
This is the forum to discuss the Wrox book Beginning XML, 4th Edition by David Hunter, Jeff Rafter, Joe Fawcett, Eric van der Vlist, Danny Ayers, Jon Duckett, Andrew Watt, Linda McKinnon; ISBN: 9780470114872
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning XML, 4th Ed ISBN: 978-0-470-11487-2 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 10th, 2011, 12:31 PM
Registered User
 
Join Date: May 2011
Posts: 4
Thanks: 2
Thanked 0 Times in 0 Posts
Default Textual content in mixed content model

hi

<complexType> definitions can be also used to create mixed content model, which allows us to include both text and element content within a single content model.

But as far as I can tell, if element has mixed content, then we're not able to specify one of the built-in simple types ( such as int ) for this element's textual content. Why is that?

Thank you
  #2 (permalink)  
Old May 11th, 2011, 06:27 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Not sure I fully understand, if you specify that an element can contain mixed content (elements and text) then it can't be restricted to something like an int. For example what simple type would the following be inside myElement?
Code:
<myElement>The quick <b>brown</b> fox</myElement>
or even
Code:
<myElement><b>3</b><i>2</i></myElement>
As an aside mixed content in general is more difficult to process and is usually avoided for data style XML, it's more often found in document style XML.
__________________
Joe
http://joe.fawcett.name/
The Following User Says Thank You to joefawcett For This Useful Post:
flockofcode (May 11th, 2011)
  #3 (permalink)  
Old May 11th, 2011, 03:54 PM
Registered User
 
Join Date: May 2011
Posts: 4
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by joefawcett View Post
Code:
<myElement><b>3</b><i>2</i></myElement>
I thought it would be useful if we would be able, for example, to restrict textual content inside myElement to just int, despite the added complexity of processing the document?!

Anyways, thank you for your help
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Extending an XML Schema content model stolte XML 3 June 24th, 2010 02:16 PM
Mixed content in DTDs GrantRobertson BOOK: Beginning XML, 4th Ed ISBN: 978-0-470-11487-2 0 November 1st, 2009 11:40 PM
mixed content parsing joeri XSLT 2 October 7th, 2007 04:54 PM
Content model imroostercogburn XML 1 August 13th, 2006 02:08 AM
Choosing content depending on content of other ele dsekar_nat XSLT 1 February 27th, 2006 04:58 AM



All times are GMT -4. The time now is 07:16 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.