I have an xml file which contains following:
<?xml version="1.0"?>
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:mods="http://www.loc.gov/mods/v3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xlink="http://www.w3.org/1999/xlink">
<titleInfo><title>A-Title-01</title></titleInfo>
</mods>
And an XSL file:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<h2>Description</h2>
<p>Hello</p>
<p><xsl:value-of select="titleInfo/title"/></p>
</xsl:template>
</xsl:stylesheet>
My problem is I don't get the title value in the xHTML. I could only see
Description
Hello
But If I remove default namespace from the xml like this:
<?xml version="1.0"?>
<mods xmlns:mods="http://www.loc.gov/mods/v3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xlink="http://www.w3.org/1999/xlink">
<titleInfo><title>A-Title-01</title></titleInfo>
</mods>
and change the style sheet's match to <xsl:template match="/mods">
I can see the title value.
But I can not remove the default namespace from the xml because xml is generated by a form and it won't work if I remove the default namespace. I don't even have a clue how to get around this or if I am doing something wrong. Please help.
Thanks in Advance.