Difference between revisions of "U16.xsl"

From TEIWiki
Jump to navigation Jump to search
(New page: == Summary == This is a quick XSLT script for removing the namespaces from any document. It will remove the prefix as well. I think I picked it up off the XSL-List run by mulberry-tech. ...)
 
Line 1: Line 1:
 
== Summary ==
 
== Summary ==
This is a quick XSLT script for removing the namespaces from any document.
 
It will remove the prefix as well.  I think I picked it up off the XSL-List
 
run by mulberry-tech.  This is sometimes a good first step to remove namespaces
 
from a set of files some of which use namespaces and some of which don't.
 
  
Add any comments to the 'discussion' tab.
+
This converts a TEI P5 transcription of part of a biblical manuscript to HTML. It makes use of the msDescription element.
  
 
== Required Input ==
 
== Required Input ==
  
This document will take any XML file, not just TEI XML, and remove a namespace from it if it exists.  
+
The input is a TEI P5 transcription of part of a biblical manuscript found [http://purl.org/tfinney/Freer/U16.xml here].
If there are entities in the document, these will naturally be expanded.
 
  
 
== Expected Output ==
 
== Expected Output ==
  
Same document, but with the namespaces and namespace prefix removed.
+
An HTML version of the transcription.
  
 
== Known Restrictions or Problems ==
 
== Known Restrictions or Problems ==
Obviously, if you need the namespaces then this might not be as useful to you.  For example, where
+
 
you have documents which use elements from different namespaces with the exact same local-name (for example,
+
This is only known to work with the transcription linked above.
TEI's <title> and HTML's <title> then flattening the document to remove
 
namespaces would be problematic.
 
  
  
 
== Stylesheet ==
 
== Stylesheet ==
<pre>
 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
<xsl:output method="xml" indent="no"/>
 
 
<xsl:template match="/|comment()|processing-instruction()">
 
    <xsl:copy>
 
      <xsl:apply-templates/>
 
    </xsl:copy>
 
</xsl:template>
 
 
<xsl:template match="*">
 
    <xsl:element name="{local-name()}">
 
      <xsl:apply-templates select="@*|node()"/>
 
    </xsl:element>
 
</xsl:template>
 
  
<xsl:template match="@*">
+
The stylesheet is found [http://purl.org/tfinney/Freer/U16.xsl here].
    <xsl:attribute name="{local-name()}">
 
      <xsl:value-of select="."/>
 
    </xsl:attribute>
 
</xsl:template>
 
</xsl:stylesheet>
 
</pre>
 
  
 
[[Category:XSLT]]
 
[[Category:XSLT]]

Revision as of 06:37, 29 April 2008

Summary

This converts a TEI P5 transcription of part of a biblical manuscript to HTML. It makes use of the msDescription element.

Required Input

The input is a TEI P5 transcription of part of a biblical manuscript found here.

Expected Output

An HTML version of the transcription.

Known Restrictions or Problems

This is only known to work with the transcription linked above.


Stylesheet

The stylesheet is found here.