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 February 27th, 2006, 12:15 PM
Authorized User
 
Join Date: Dec 2005
Posts: 71
Thanks: 10
Thanked 0 Times in 0 Posts
Default DTD base XSLT Grouping

Hi All,

Wrting an XSLT using DTD.

Following is MY DTD

DTD
------------------------------------------------------------
Parent Elements:
==================
<!ELEMENT poem (stanza|poemline|by|para)*>
--------------------------------------------------------------

Sub Elements (child Elements):
===============================
<!ELEMENT stanza (poemline)+>
<!ELEMENT poemline (#PCDATA|emph|indent|link|sup|sub|footnote)*>
<!ELEMENT by (#PCDATA|sign|phrefnm|emph|link)*>
<!ELEMENT sign (#PCDATA|emph)*>
<!ELEMENT phrefnm (#PCDATA|emph)*>

<!ELEMENT para (#PCDATA|emph|link|x|br|figure|box|map
            |chart|scheme|illust|table
            |listgrp|transgrp|bioname|sup|sub|objidref|bibliog raphy
            |deflist|extract|verse|quote|algorthm|poem
            |equation|convt|footnote|indent)*>


<!ELEMENT transgrp (heading?, (transref|foreign|trans|orgsents|x|br|link)*)>

<!ELEMENT foreign (#PCDATA|emph|sub|sup|br|equation|link|indent|tran sref|footnote)*>

<!ELEMENT link (#PCDATA|emph|sup|br)*>
-----------------------------------------------------------------------

My Comments.
1. Element poem is introducing element (i.e.) it is generated with XSLT.
2. Element poem will contains a sub-elements link stanza, poemline, by, sign, phrefnm, para
3. Similarly the sub element will contains or not contains some of its generic DTD sub element for e.g.
    <poem>
    <stanza>
    <poemline/><link/>
    <poemline/>
    <para>
        <chart/>
        <transgrp>
            <heading/>
            <foreign>
            <transref/>
            <equation>
                .......
            </equation>
            </foreign>
        </stanza>
    </poem>


My Question?

1. Is that possible write a dynamic XSLT based on DTD(i.e.) Specifically on GROUPING.

<!ELEMENT foreign (#PCDATA|emph|sub|sup|br|equation|link|indent|tran sref|footnote)*> these cases

2. When I came across grouping I got with breaking outputs when I introduce other grouping element inside a grouping.
3. Any of XSLT GURU can help .I hope

Regards and Thanks,
ROCXY


__________________
Thanks,
Rocxy.
 
Old February 27th, 2006, 07:21 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I'm afraid it's very hard to understand your question. I don't understand what you mean by "grouping" - it doesn't seem related to the usual use of the term in XSLT. You have shown an element declaration that permits a list of possible children such as emph, sub, etc: you can of course write template rules to process these elements.

XSLT stylesheets have no access to the DTD. Of course, when you write a stylesheet then you will design it to handle a particular input structure, but that's the only way the DTD comes into it.

I'm not sure what you mean by a "dynamic XSLT", and if the following is a question "When I came across grouping I got with breaking outputs when I introduce other grouping element inside a grouping." then I'm afraid I don't know what it's asking.



Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Grouping with XSLT 1.0 rodmcleay XSLT 1 January 14th, 2008 11:42 PM
XSLT Grouping vernc XSLT 2 October 2nd, 2007 03:59 AM
Can XSLT read DTD/schema and Generate XSLT.. ROCXY XSLT 1 November 6th, 2006 09:39 AM
XSLT 1.0 Grouping kwilliams XSLT 0 January 11th, 2006 06:30 PM
XSLT Grouping Help Missy XSLT 0 December 14th, 2005 10:28 PM





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