Hi All
Sorry if this is obvious to you.
I've been using xslt for two days now and I am stuck.
I have some xml as below
<?xml version="1.0"?>
<rdf:RDF
xmlns:db="http://localhost:2020/resource/"
xmlns:omap="file:///C:/d2r-server-0.3.1/outlookmap.ttl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:emap="file:///C:/d2r-server-0.3.1/eudoramap.ttl#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:out="http://localhost:2020/resource/outlook/"
xmlns:eud="http://localhost:2020/resource/eudora/">
<eud:ENTRIES rdf:about="http://localhost:2020/resource/ENTRIES/Diane/Barnes">
<eud:ENTRIES_WORKWEBADDRESS>
http://www.landamericafinancial.com </eud:ENTRIES_WORKWEBADDRESS>
<eud:ENTRIES_FULLNAME>Diane Barnes</eud:ENTRIES_FULLNAME>
<eud:ENTRIES_WORKORGANIZATION>LandAmerica Financial</eud:ENTRIES_WORKORGANIZATION>
<eud:ENTRIES_OTHERPHONE>(714) 551-3743</eud:ENTRIES_OTHERPHONE>
<eud:ENTRIES_NICKNAME>Diane</eud:ENTRIES_NICKNAME>
<eud:ENTRIES_OTHEREMAIL rdf:resource="mailto:diane.barnes@landamericafinan cial.com"/>
<eud:ENTRIES_COUNTRY>US </eud:ENTRIES_COUNTRY>
<eud:ENTRIES_WORKFAX>(666) 371-9322 </eud:ENTRIES_WORKFAX>
<eud:ENTRIES_WORKCITY>Quebec</eud:ENTRIES_WORKCITY>
<eud:ENTRIES_WEB>
http://www.landamericafinancial.com/Diane </eud:ENTRIES_WEB>
<eud:ENTRIES_WORKZIP>70596 </eud:ENTRIES_WORKZIP>
<eud:ENTRIES_MOBILE>(705) 625-6032 </eud:ENTRIES_MOBILE>
<eud:ENTRIES_WORKMOBILE>(607) 280-8253 </eud:ENTRIES_WORKMOBILE>
<eud:ENTRIES_PHONE>(328) 852-8160 </eud:ENTRIES_PHONE>
<eud:ENTRIES_CITY>Victoria</eud:ENTRIES_CITY>
<eud:ENTRIES_LASTNAME>Barnes</eud:ENTRIES_LASTNAME>
<eud:ENTRIES_WORKSTATE>MO</eud:ENTRIES_WORKSTATE>
<eud:ENTRIES_EMAIL1 rdf:resource="mailto:
[email protected]"/>
<eud:ENTRIES_ZIP>62819-8803</eud:ENTRIES_ZIP>
<eud:ENTRIES_WORKPHONE>(658) 698-1087 </eud:ENTRIES_WORKPHONE>
<eud:ENTRIES_WORKCOUNTRY>US </eud:ENTRIES_WORKCOUNTRY>
<eud:ENTRIES_ADDRESS>313 Jefferson Ave.</eud:ENTRIES_ADDRESS>
<eud:ENTRIES_FAX>(770) 631-3744 </eud:ENTRIES_FAX>
<eud:ENTRIES_WORKADDRESS>3277 Washington Road</eud:ENTRIES_WORKADDRESS>
<eud:ENTRIES_FIRSTNAME>Diane</eud:ENTRIES_FIRSTNAME>
<rdfs:label>ENTRIES #Diane/Barnes</rdfs:label>
<eud:ENTRIES_STATE>LA</eud:ENTRIES_STATE>
</eud:ENTRIES>
</rdf:RDF>
I am trying to get some xslt produce the following
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:owl="http://www.w3.org/2002/07/owl#">
<rdf:Description rdf:about="http://localhost:2020/resource/ENTRIES/Diane/Barnes">
<rdf:type>
<owl:Class rdf:about="http://localhost:2020/resource/eudora/ENTRIES"/>
</rdf:type>
<eud:ENTRIES_WORKWEBADDRESS xmlns:eud="http://localhost:2020/resource/eudora/" >
http://www.landamericafinancial.com </eud:ENTRIES_WORKWEBADDRESS>
<eud:ENTRIES_FULLNAME xmlns:eud="http://localhost:2020/resource/eudora/" >Diane Barnes</eud:ENTRIES_FULLNAME>
<eud:ENTRIES_WORKORGANIZATION xmlns:eud="http://localhost:2020/resource/eudora/" >LandAmerica Financial</eud:ENTRIES_WORKORGANIZATION>
<eud:ENTRIES_OTHERPHONE xmlns:eud="http://localhost:2020/resource/eudora/" >(714) 551-3743</eud:ENTRIES_OTHERPHONE>
<eud:ENTRIES_NICKNAME xmlns:eud="http://localhost:2020/resource/eudora/" >Diane</eud:ENTRIES_NICKNAME>
<eud:ENTRIES_OTHEREMAIL xmlns:eud="http://localhost:2020/resource/eudora/" rdf:resource="mailto:diane.barnes@landamericafinan cial.com"/>
<eud:ENTRIES_COUNTRY xmlns:eud="http://localhost:2020/resource/eudora/" >US </eud:ENTRIES_COUNTRY>
<eud:ENTRIES_WORKFAX xmlns:eud="http://localhost:2020/resource/eudora/" >(666) 371-9322 </eud:ENTRIES_WORKFAX>
<eud:ENTRIES_WORKCITY xmlns:eud="http://localhost:2020/resource/eudora/" >Quebec</eud:ENTRIES_WORKCITY>
<eud:ENTRIES_WEB xmlns:eud="http://localhost:2020/resource/eudora/" >
http://www.landamericafinancial.com/Diane </eud:ENTRIES_WEB>
<eud:ENTRIES_WORKZIP xmlns:eud="http://localhost:2020/resource/eudora/" >70596 </eud:ENTRIES_WORKZIP>
<eud:ENTRIES_MOBILE xmlns:eud="http://localhost:2020/resource/eudora/" >(705) 625-6032 </eud:ENTRIES_MOBILE>
<eud:ENTRIES_WORKMOBILE xmlns:eud="http://localhost:2020/resource/eudora/" >(607) 280-8253 </eud:ENTRIES_WORKMOBILE>
<eud:ENTRIES_PHONE xmlns:eud="http://localhost:2020/resource/eudora/" >(328) 852-8160 </eud:ENTRIES_PHONE>
<eud:ENTRIES_CITY xmlns:eud="http://localhost:2020/resource/eudora/" >Victoria</eud:ENTRIES_CITY>
<eud:ENTRIES_LASTNAME xmlns:eud="http://localhost:2020/resource/eudora/" >Barnes</eud:ENTRIES_LASTNAME>
<eud:ENTRIES_WORKSTATE xmlns:eud="http://localhost:2020/resource/eudora/" >MO</eud:ENTRIES_WORKSTATE>
<eud:ENTRIES_EMAIL1 xmlns:eud="http://localhost:2020/resource/eudora/" rdf:resource="mailto:
[email protected]"/>
<eud:ENTRIES_ZIP xmlns:eud="http://localhost:2020/resource/eudora/" >62819-8803</eud:ENTRIES_ZIP>
<eud:ENTRIES_WORKPHONE xmlns:eud="http://localhost:2020/resource/eudora/" >(658) 698-1087 </eud:ENTRIES_WORKPHONE>
<eud:ENTRIES_WORKCOUNTRY xmlns:eud="http://localhost:2020/resource/eudora/" >US </eud:ENTRIES_WORKCOUNTRY>
<eud:ENTRIES_ADDRESS xmlns:eud="http://localhost:2020/resource/eudora/" >313 Jefferson Ave.</eud:ENTRIES_ADDRESS>
<eud:ENTRIES_FAX xmlns:eud="http://localhost:2020/resource/eudora/" >(770) 631-3744 </eud:ENTRIES_FAX>
<eud:ENTRIES_WORKADDRESS xmlns:eud="http://localhost:2020/resource/eudora/" >3277 Washington Road</eud:ENTRIES_WORKADDRESS>
<eud:ENTRIES_FIRSTNAME xmlns:eud="http://localhost:2020/resource/eudora/" >Diane</eud:ENTRIES_FIRSTNAME>
<rdfs:label xmlns:eud="http://localhost:2020/resource/eudora/" >ENTRIES #Diane/Barnes</rdfs:label>
<eud:ENTRIES_STATE xmlns:eud="http://localhost:2020/resource/eudora/" >LA</eud:ENTRIES_STATE>
</rdf:Description>
You can see in the original xml that the email1 node has a attribute.
I am using the following xslt
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<xsl:strip-space elements="*"/>
<xsl:output indent="yes"/>
<xsl:template match="rdf:RDF">
<xsl:apply-templates select="*"/>
</xsl:template>
<xsl:template match="*[@rdf:about]">
<rdf:Description rdf:about="{@rdf:about}">
<rdf:type>
<owl:Class rdf:about="{namespace-uri(.)}{local-name()}"/>
</rdf:type>
<xsl:apply-templates select="node()"/>
</rdf:Description>
</xsl:template>
<xsl:template match="node()">
<xsl:copy>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
The problem I am having is that the email1 line does not include the rdf:resource attribute.
I have tried copy-of with select="." but that includes all of the xmlns values given at the top of the xml file.
I have tried a variety of things and sometime I get the dat values without the tags, othertimes I get the tags without the data.
This is the closest I have got.
How do I keep the rdf:resource attribute of the email1 tag
Thanks in advance
Phil ashworth