xsl-list
[Top] [All Lists]

RE: Dmoz xml structure sort

2004-04-21 09:39:34
WOOPS Scratch that the last one was the wrong doc.
HERE is the correct xml
<?xml version="1.0" encoding="UTF-8"?>
<iThink.ePulp xmlns:r="http://www.w3.org/TR/RDF/";
xmlns:d="http://purl.org/dc/elements/1.0/";
xmlns="http://directory.mozilla.org/rdf";>
        <Content>
                <Topic r:id="Base">
                        <Tag catid="1"/>
                        <d:Title>Home</d:Title>
                        <Far
r:resource="http://www.ithinkdesigns.com/news/";>
                                <d:Title>iThink Designs, inc. Produces a hit
with Impact Web site</d:Title>
                                <d:Description>iThink Designs, Inc. a small
internet firm out of Williamsburg Va, produced Impact's Web site to meet the
demands of the modern potential student.</d:Description>
                        </Far>
                        <Near r:resource="Base/General_Information/">
                                <d:Title>General Information</d:Title>
                                <d:Description>More
Information</d:Description>
                        </Near>
                        <Near r:resource="Base/StudentLife/">
                                <d:Title>Student Life</d:Title>
                                <d:Description>More
Information</d:Description>
                        </Near>
                        <Near r:resource="Base/Missions/">
                                <d:Title>Missions</d:Title>
                                <d:Description>More
Information</d:Description>
                        </Near>
                        <Near r:resource="Base/Community/">
                                <d:Title>Community</d:Title>
                                <d:Description>More
Information</d:Description>
                        </Near>
                        <Near r:resource="Base/Academics/">
                                <d:Title>Academics</d:Title>
                                <d:Description>More
Information</d:Description>
                        </Near>
                        <Near r:resource="Base/News/">
                                <d:Title>News &amp; Events</d:Title>
                                <d:Description>More
Information</d:Description>
                        </Near>
                        <Near
r:resource="Base/General_Information/Contact_Us.html">
                                <d:Title>Contact Us</d:Title>
                                <d:Description>More
Information</d:Description>
                        </Near>
                </Topic>
                <Topic r:id="Base/General_Information">
                        <tag catid="2"/>
                        <d:Title>General Information</d:Title>
                        <Near
r:resource="Base/General_Information/About_us.html">
                                <d:Title>About Us</d:Title>
                                <d:Description>More
Information</d:Description>
                        </Near>
                        <Near
r:resource="Base/General_Information/Contact_us.html">
                                <d:Title>Contact Us</d:Title>
                                <d:Description>More
Information</d:Description>
                        </Near>
                        <Near
r:resource="Base/General_Information/Letter_from_the_Director.html">
                                <d:Title>Letter from the Director</d:Title>
                                <d:Description>More
Information</d:Description>
                        </Near>
                        <Near
r:resource="Base/General_Information/History.html">
                                <d:Title>History</d:Title>
                                <d:Description>More
Information</d:Description>
                        </Near>
                        <Near
r:resource="Base/General_Information/What_We_Believe.html">
                                <d:Title>What We Believe</d:Title>
                                <d:Description>More
Information</d:Description>
                        </Near>
                        <Near
r:resource="Base/General_Information/Staff_Directory.html">
                                <d:Title>Staff Directory</d:Title>
                                <d:Description>More
Information</d:Description>
                        </Near>
                </Topic>
                <Topic r:id="Base/News">
                        <tag catid="7"/>
                        <Title local="en-US">News &amp; Events</Title>
                </Topic>
        </Content>
</iThink.ePulp>

-----Original Message-----
From: Mukul Gandhi [mailto:mukulgandhi2003(_at_)yahoo(_dot_)co(_dot_)in] 
Sent: Sunday, April 18, 2004 9:55 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Dmoz xml structure sort

Hi John,

If I understood the problem correctly, this could be
the solution.

<xsl:for-each select="Topic">
    <xsl:if test="not(narrow)">
         <xsl:copy-of select="." />
    </xsl:if>
</xsl:for-each>

Regards,
Mukul

 --- John Hamman <John(_at_)iThinkdesigns(_dot_)com> wrote: > Hi
all.
I have a navigational site tree xml page similar to
Dmoz.org.
And its made up like this below. I am new to xpath
and am having problems
finding a solution to this.

My file looks similar to this.

<Topic id="Base">
                      <tag catid="1"/>
                      <Title local="en-US">Home</Title>
                      <narrow resource="Base/General_Information"/>
                      <narrow resource="Base/StudentLife"/>
                      <narrow resource="Base/Missions"/>
                      <narrow resource="Base/Community"/>
                      <narrow resource="Base/Academics"/>
                      <narrow resource="Base/News"/>
              </Topic>
              <Topic id="Base/General_Information">
                      <tag catid="2"/>
                      <Title local="en-US">General Information</Title>
                      <narrow
resource="Base/General_Information/About_us"/>
                      <narrow
resource="Base/General_Information/Contact_us"/>
                      <narrow

resource="Base/General_Information/Directors_Letter"/>
                      <narrow
resource="Base/General_Information/History"/>
                      <narrow

resource="Base/General_Information/What_We_Beleive"/>
                      <narrow

resource="Base/General_Information/Staff_Directory"/>
              </Topic>
              <Topic id="Base/General_Information/About_us">
                      <tag catid="8"/>
                      <Title local="en-US">About Us</Title>
              </Topic>
              <Topic id="Base/General_Information/Contact_us">
                      <tag catid="9"/>
                      <Title local="en-US">Contact Us</Title>
              </Topic>
...
...
...


And I want to acheave results like this if I had a
dynamic variable like 
"Base/General_Information/About_us"

<Topic id="Base/General_Information/About_us">
                      <tag catid="8"/>
                      <Title local="en-US">About Us</Title>
              </Topic>
              <Topic id="Base/General_Information/Contact_us">
                      <tag catid="9"/>
                      <Title local="en-US">Contact Us</Title>
              </Topic>
              <Topic
id="Base/General_Information/Directors_Letter">
                      <tag catid="10"/>
                      <Title local="en-US">Letter From the
Director</Title>
              </Topic>
              <Topic id="Base/General_Information/History">
                      <tag catid="11"/>
                      <Title local="en-US">History</Title>
              </Topic>
              <Topic
id="Base/General_Information/What_We_Beleive">
                      <tag catid="12"/>
                      <Title local="en-US">What We Beleive</Title>
              </Topic>
              <Topic
id="Base/General_Information/Staff_Directory">
                      <tag catid="13"/>
                      <Title local="en-US">Staff Directory</Title>
              </Topic>

Can someone point me in the right direction?
john



--+------------------------------------------------------------------
XSL-List info and archive: 
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to:
http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--
 

________________________________________________________________________
Yahoo! India Matrimony: Find your partner online.
http://yahoo.shaadi.com/india-matrimony/

--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--




<Prev in Thread] Current Thread [Next in Thread>