OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
What is the equivalent functional programming function(s) forhopping from element to element via XML "IDREF" references (or XSD "base"references)

Hi Folks,

This XML document has an IDREF attribute that references an ID value:

<?xml version="1.0"?>
        <Book id="isbn-94303-12021-43892">
                <Title>My Life and Times</Title>
                <Author>Paul McCartney</Author>
                <Publisher>McMillan Publishing</Publisher>
        <Book id="isbn-0-440-34319-4">
                <Title>Illusions The Adventures of a Reluctant Messiah</Title>
                <Author>Richard Bach</Author>
                <Publisher>Dell Publishing Co.</Publisher>
        <Book id="isbn-0-06-064831-7">
                <Title>The First and Last Freedom</Title>
                <Author>J. Krishnamurti</Author>
                <Publisher>Harper &amp; Row</Publisher>
            <BookSigning idref="isbn-0-440-34319-4"></BookSigning>

If I start at <BookSigning> then I want to hop to the <Book> that is referenced by the "idref" attribute.

An analogous situation occurs in XML Schema. This XML Schema document has a simpleType that references another simpleType, using the "base" attribute:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";> 

    <xsd:simpleType name= "EarthSurfaceElevation">
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="-1290"/>
            <xsd:maxInclusive value="29035"/>
    <xsd:simpleType name= "BostonAreaSurfaceElevation">
        <xsd:restriction base="EarthSurfaceElevation">
            <xsd:minInclusive value="0"/>
            <xsd:maxInclusive value="120"/>

If I start at the BostonAreaSurfaceElevation <xsd:simpleType> then I want to hop to the <xsd:simpleType> that is referenced by the "base" attribute.

Those are just two examples. Many others could be provided for, not only XML and XML Schema, but for XSLT and others.

The examples illustrate a recurring pattern: start at one element and hop, hop, hop to each element in the chain of references.

How do I cast this recurring pattern into a functional programming mindset? For example, how would it be viewed from the Haskell mindset?


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS