Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT 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 September 28th, 2012, 09:57 AM
Registered User
 
Join Date: Jun 2012
Posts: 5
Thanks: 2
Thanked 0 Times in 0 Posts
Default checking mixed content model

Hi,

I wish to check an element <p> whether it is mixed content model or not. Is there any function, if not please provide the XPATH. For instance, lets take the following XML:

<root>
<p>abc<i>italic</i>xyz</p>
</root>


Thanks!
 
Old September 28th, 2012, 10:18 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

There is no way in XPath to check whether the schema or DTD allows mixed content. But you can tell whether an element $e actually has mixed content (in a particular instance) using the text

Code:
$e/text() and $e/*
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
The Following User Says Thank You to mhkay For This Useful Post:
riteshdubey5 (September 28th, 2012)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Textual content in mixed content model flockofcode BOOK: Beginning XML, 4th Ed ISBN: 978-0-470-11487-2 2 May 11th, 2011 03:54 PM
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





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