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 May 31st, 2005, 04:43 AM
Authorized User
 
Join Date: May 2005
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ignore this post...its crap!

Apologies about this post...I would delete it if I could but I can't!

The real question is here:
http://p2p.wrox.com/topic.asp?TOPIC_ID=31176
 
Old May 31st, 2005, 05:18 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

It's not clear why you are having difficulty with this. If you show us your attempt so far, we can perhaps tell you where you are going wrong.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old May 31st, 2005, 05:23 AM
Authorized User
 
Join Date: May 2005
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ahh, wasn't quite sure if you wanted to see my html or not!
I guess I figured that the problem was more to do with the DFD than anything else! Apologies!

<HTML>
<BODY>
<XML ID="dsoBookList" SRC="test.xml"></XML>


<TABLE DATASRC="#dsoBookList" border="1" CELLSPACING=0 WIDTH=100%>
<THEAD>
<TR>
     <TH ALIGN="LEFT">Title
     </TH>
     <TH ALIGN="LEFT">Author(s)
     </TH>
</TR>
</THEAD>
<TBODY>
<TR>
     <TD valign="top"><SPAN DATAFLD="TITLE"></SPAN>&nbsp;</TD>
          <TD>
               <TABLE DATASRC="#dsoBookList" DATAFLD="AUTHORLIST" CELLSPACING=0>
                    <TBODY>
                         <TR>
                              <TD>
                                   <SPAN DATAFLD="FIRST_NAME">
                                   </SPAN>&nbsp;
                                   <SPAN DATAFLD="LAST_NAME">
                                   </SPAN>
                              </TD>
                         </TR>
                    </TBODY>
               </TABLE>
          </TD>
     </TR>
</TBODY>
</TABLE>
</BODY>
</HTML>

It is by grace we are saved!
 
Old May 31st, 2005, 05:56 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I rather assumed that you were having difficulty writing the XSLT code, and that's what you wanted help with.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old May 31st, 2005, 06:38 AM
Authorized User
 
Join Date: May 2005
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Let me start by saying that I am an Idiot!

Now that we have that out of the way maybe I can start again! Unfortunately I have confused myself with all of my testing!

Put the below code into an xml file called test.xml

<?xml version="1.0" ?>
<!DOCTYPE PERSONS [
  <!ELEMENT PERSONS (ITEM+)>
  <!ELEMENT ITEM (TITLE, NAME*)>
  <!ELEMENT TITLE (#PCDATA)>
  <!ELEMENT NAME (#PCDATA)>
]>

<PERSONS>
     <ITEM>
          <TITLE>Hege Refsnes </TITLE>
      <NAME>Martin</NAME>
      <NAME>Williams</NAME>
      <NAME>Cheryl</NAME>
      <NAME>Caprialdi</NAME>
     </ITEM>
</PERSONS>

Now create a html file with this in:
<HTML>
<BODY>
<XML ID="dsoBookList" SRC="test.xml"></XML>

<TABLE DATASRC="#dsoBookList" border="1" CELLSPACING=0 WIDTH=100%>
<THEAD>
<TR>
     <TH ALIGN="LEFT">Title
     </TH>
     <TH ALIGN="LEFT">Author(s)
     </TH>
</TR>
</THEAD>
<TBODY>
<TR>
     <TD valign="top"><SPAN DATAFLD="TITLE"></SPAN>&nbsp;</TD>
          <TD>
               <TABLE DATASRC="#dsoBookList" DATAFLD="NAME" CELLSPACING=0>
                    <TBODY>
                         <TR>
                              <TD>
                                   <SPAN DATAFLD="NAME">
                                   </SPAN>&nbsp;
                              </TD>
                         </TR>
                    </TBODY>
               </TABLE>
          </TD>
     </TR>
</TBODY>
</TABLE>
</BODY>
</HTML>

The output gives you the one row showing the title with 4 blank rows where the names should be! I guess my problem is that it knows how many names there are but its not showing their value!

It is by grace we are saved!





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to select only the parent tag and ignore the c Prem Rajesh Kumar XSLT 3 November 6th, 2007 12:53 PM
Ignore Comma in Line Input echovue Access 4 November 2nd, 2005 10:16 AM
cin being skipped. ignore() not working UberNewf Visual C++ 0 June 28th, 2005 04:27 PM
delete/ignore empty column crmpicco Excel VBA 1 May 4th, 2005 08:01 AM
How to skip/ignore null(\0) chars from stream? peri C# 2 December 28th, 2004 09:01 PM





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