Wrox Programmer Forums
| 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 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 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
 
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)
 
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




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 2nd, 2009 12:40 AM
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 05:58 AM





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