Web Design and Development Forums

xsl - how to retrieve IDREF data?

This is a discussion on "xsl - how to retrieve IDREF data?" within the XML, RSS & Atom section. This forum, and the thread "xsl - how to retrieve IDREF data? are both part of the Program Your Website category.


Go Back   Webforumz.com > Program Your Website > XML, RSS & Atom

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Sep 6th, 2006, 02:20   #1 (permalink)
New Member
 
Join Date: Sep 2006
Location: Columbus, OH
Posts: 1
xsl - how to retrieve IDREF data?

Hi,
I have an xml document that contains a list of events and uses ID and IDREF to normalize people or persons. So one person could be involved in two different events and they are referenced through IDREF.

have the xml document and xsd shown below.

I would like to use xsl to denormalize this and display the list or collection of events with the person's data (basically name) brought into the event. If one person is involved in multiple events then their data would displayed multiple times.


How could I do this with xsl?


Thanks!!
VmusicV

The xml document is first and then the schema
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<events xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="some_folder\foreign-key.xsd">
    <event>
        <start-date>2022-10-01</start-date>
        <end-date>2022-10-01</end-date>
        <event-type>birth</event-type>
        <event-id>EID0001</event-id>
        <event-people role-type="father">ID0001</event-people>
        <event-people role-type="mother">ID0002</event-people>       
        <location></location>
    </event>
    <event>
        <start-date>2005-08-12</start-date>
        <end-date>2005-08-12</end-date>
        <event-type>birth</event-type>
        <event-id>EID0002</event-id>
        <event-people role-type="self">ID0001</event-people>
        <event-people role-type="attendee">ID0002</event-people>       
        <event-people role-type="attendee">ID0006</event-people>       
        <location></location>
    </event>   
    <persons>
        <person>
            <person-name name-type="first">Bill</person-name>
            <person-name name-type="last">Walters</person-name>           
            <person-id>ID0001</person-id>
        </person>

        <person>
            <person-name name-type="first">Jane</person-name>
            <person-name name-type="last">Walters</person-name>           
            <person-id>ID0002</person-id>
        </person>   
        <person>
            <person-name name-type="first">George</person-name>
            <person-name name-type="last">Johnson</person-name>           
            <person-id>ID0003</person-id>
        </person>       
        <person>
            <person-name name-type="first">Jim</person-name>
            <person-name name-type="last">Kaminski</person-name>           
            <person-id>ID0004</person-id>
        </person>
        <person>
            <person-name name-type="first">Sally</person-name>
            <person-name name-type="last">Smith</person-name>           
            <person-id>ID0005</person-id>
        </person>
        <person>
            <person-name name-type="first">Alex</person-name>
            <person-name name-type="last">Hernandez</person-name>           
            <person-id>ID0006</person-id>
        </person>                           
    </persons>
</events>
and the xsd or schema
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:element name="events">
           <xs:complexType>
            <xs:sequence>
                <xs:element name="event" type="event" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element name="persons">
                   <xs:complexType>
                        <xs:sequence>
                            <xs:element name="person" type="person" maxOccurs="unbounded"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="person-name">
         <xs:complexType>
            <xs:sequence>
                <xs:element name="name-type">
                    <xs:simpleType>
                        <xs:restriction base="xs:string">
                            <xs:enumeration value="last"/>
                            <xs:enumeration value="first"/>
                            <xs:enumeration value="middle"/>
                            <xs:enumeration value="nick"/>
                            <xs:enumeration value="alias"/>
                            <xs:enumeration value="full"/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:element>
                <xs:element name="name-text"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:complexType name="person">
        <xs:annotation>
            <xs:documentation>An individual human</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="person-name" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:simpleContent>
                        <xs:extension base="xs:string">
                            <xs:attribute name="name-type" use="required">
                                <xs:simpleType>
                                    <xs:restriction base="xs:string">
                                        <xs:enumeration value="first"/>
                                        <xs:enumeration value="last"/>
                                        <xs:enumeration value="middle"/>
                                        <xs:enumeration value="maiden"/>
                                    </xs:restriction>
                                </xs:simpleType>
                            </xs:attribute>
                        </xs:extension>
                    </xs:simpleContent>
                </xs:complexType>
            </xs:element>
            <xs:element name="person-id" type="xs:ID"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="event">
        <xs:annotation>
            <xs:documentation>A planned or unplanned activity that people are involved in </xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="start-date" type="xs:date"/>
            <xs:element name="end-date" type="xs:date"/>
            <xs:element name="event-type">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="school graduation"/>
                        <xs:enumeration value="school attendance"/>
                        <xs:enumeration value="military service"/>
                        <xs:enumeration value="death"/>
                        <xs:enumeration value="birth"/>
                        <xs:enumeration value="baptisim"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>
            <xs:element name="event-description" type="xs:string" minOccurs="0"/>
            <xs:element name="event-id" type="xs:ID"/>
            <xs:element name="event-people" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:simpleContent>
                        <xs:extension base="xs:IDREF">
                            <xs:attribute name="role-type" use="required">
                                <xs:simpleType>
                                    <xs:restriction base="xs:string">
                                        <xs:enumeration value="father"/>
                                        <xs:enumeration value="doctor"/>
                                        <xs:enumeration value="pastor"/>
                                        <xs:enumeration value="mother"/>
                                        <xs:enumeration value="self"/>
                                        <xs:enumeration value="planner"/>
                                        <xs:enumeration value="attendee"/>
                                        <xs:enumeration value="member"/>
                                    </xs:restriction>
                                </xs:simpleType>
                            </xs:attribute>
                        </xs:extension>
                    </xs:simpleContent>
                </xs:complexType>
            </xs:element>
            <xs:element name="location" type="location"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="location">
        <xs:annotation>
            <xs:documentation>A general or specific geographic place</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="location-name" minOccurs="0"/>
            <xs:element name="address-line-1" minOccurs="0"/>
            <xs:element name="address-line-2" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="country">
        <xs:annotation>
            <xs:documentation>A country of the planet earth</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="name"/>
            <xs:element name="iso-country-code">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="AF"/>
                        <!-- and others -->
                      </xs:restriction>
                </xs:simpleType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="US-State">
        <xs:sequence>
            <xs:element name="state-abbreviation">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="AL"/>
                        <!-- and others -->
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>
            <xs:element name="state-name"/>
        </xs:sequence>
    </xs:complexType>
</xs:schema>
VmusicV is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Oct 3rd, 2006, 07:11   #2 (permalink)
New Member
 
Join Date: Oct 2006
Location: Pune, India
Posts: 3
Re: xsl - how to retrieve IDREF data?

can you please explain in detail what is the expected display of events? Which info needs to be displayed in what manner? That can help to suggest any solution. Regards.
svk2006 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
xsl, retrieve, idref, data

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] ASP - AJAX (Retrieve Database Value Without Refreshing The Page) Monie ASP Forum 19 Jan 21st, 2008 00:07
How to retrieve your wordpress password Pádraig Webforumz Cafe 10 Aug 9th, 2007 11:55
Need a way to save/retrieve info browserman File Based Storage and Others 4 Jun 7th, 2007 12:12
Get Data From CSV to MS SQL DB Brain-Chemical MSSQL & Access 3 Feb 16th, 2006 06:25
sql data to xml bfelix XML, RSS & Atom 0 Jan 18th, 2006 17:39



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 14:50.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59