 |
 |
 |
Hello,
I need to transform following xml instance to RDF:
<gemq:catalogingOrganization>
<foaf:name>Learn North Carolina</foaf:name>
<foaf:phone>919-962-8888</foaf:phone>
<foaf:homepage>http://www.learnnc.org</foaf:homepage>
<foaf:mbox>mailto:mthibault@l...</foaf:mbox>
</gemq:catalogingOrganization>
<gemq:catalogingOrganization>Carolina Center</gemq:catalogingOrganization>
The expected rdf output might be:
<gemq:catalogingOrganization>
<foaf:name>Learn North Carolina</foaf:name>
<rdfs:label>Learn North Carolina</rdfs:label>
<foaf:phone rdf:resource="http://www.unc.edu"/>919-962-8888</foaf:phone>
<foaf:homepage
rdf:resource="http://www.unc.edu"/>http://www.learnnc.org</foaf:homepage>
<foaf:mbox>mailto:mthibault@l...</foaf:mbox>
</gemq:catalogingOrganization>
<gemq:catalogingOrganization>Carolina Center</gemq:catalogingOrganization>
So, if gemq:catalogingOrganization has any foaf element, xslt needs to show.
If gemq:catalogingOrganization does not have any foaf element, xsl needs
only to show the values.
Could you help me with this?
Here is my xsl.
<xsl:template match="gemq:catalogingOrganization">
<xsl:choose>
<xsl:when test="foaf:name">
<foaf:name>
<xsl:value-of select="normalize-space(foaf:name)"/>
</foaf:name></xsl:when>
<xsl:when test="foaf:phone">
<foaf:phone>
<xsl:attribute name="rdf:resource">
<xsl:value-of select="normalize-space(foaf:phone)"/> </xsl:attribute>
</foaf:phone></xsl:when>
<xsl:when test="foaf:mbox">
<foaf:mbox>
<xsl:value-of select="normalize-space(foaf:mbox)"/>
</foaf:mbox></xsl:when>
<xsl:when test="foaf:homepage">
<foaf:homepage>
<xsl:attribute name="rdf:resource">
<xsl:value-of select="normalize-space(foaf:homapge)"/> </xsl:attribute>
</foaf:homepage></xsl:when>
<xsl:otherwise><gemq:catalogingOrganization><xsl:value-of
select="normalize-space(.)"/></gemq:catalogingOrganization></xsl:otherwise>
</xsl:choose>
</xsl:template>
Thanks a lot,
Best regards,
Oknam Park
|
 | 

|  |
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.
|  |
| |
 |
 |
 |