Hello all... I'm having a problem with converting my xml file to xsl using Saxon 9 on Windows 7. So far I have created this xsl file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes"/>
<xsl:template match="/">
<xsl:for-each select="drugs/drug">
<xsl:result-document method = "hml"
href="file:///C:/Users/X201/Desktop/drugbank/drugbank.xml">
<xsl:value-of select="'
'"/>
<drug>
<xsl:value-of select="'
'"/>
<drugbank-id>
<xsl:value-of select="'
'"/>
<xsl:value-of select="drug/drugbank-id"/>
<xsl:value-of select="'
'"/>
</drugbank-id>
<xsl:value-of select="'
'"/>
<name>
<xsl:value-of select="'
'"/>
<xsl:value-of select="drug/name"/>
<xsl:value-of select="'
'"/>
</name>
<xsl:value-of select="'
'"/>
<description>
<xsl:value-of select="'
'"/>
<xsl:value-of select="drug/description"/>
<xsl:value-of select="'
'"/>
</description>
<xsl:value-of select="'
'"/>
<mechanism-of-action>
<xsl:value-of select="'
'"/>
<xsl:value-of select="drug/mechanism-of-action"/>
<xsl:value-of select="'
'"/>
</mechanism-of-action>
<xsl:value-of select="'
'"/>
</drug>
<xsl:value-of select="'
'"/>
</xsl:result-document>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
When I try to open my xml file in Chrome nothing comes up. This leads me to believe that my xls file is not well-formed and I have found no help on the interwebs.
These are the elements that I want to pull of my xml file and to show up in my browser:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" version="2.0" href="drugbank.xsl"?>
<drugs xmlns="http://drugbank.ca" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="1.4" xs:schemaLocation="http://www.drugbank.ca/docs/drugbank.xsd">
<drug type="biotech" created="2005-06-13 07:24:05 -0600" updated="2013-05-12 21:37:25 -0600" version="3.0">
<drugbank-id>DB00001</drugbank-id>
<name>Lepirudin</name>
<description>Lepirudin is identical to natural hirudin except for substitution of leucine for isoleucine at the N-terminal end of the molecule and the absence of a sulfate group on the tyrosine at position 63. It is produced via yeast cells.
</description>
<cas-number>120993-53-5</cas-number>
<synthesis-reference></synthesis-reference>
<indication>For the treatment of heparin-induced thrombocytopenia</indication>
<pharmacology>Lepirudin is used to break up clots and to reduce thrombocytopenia. It binds to thrombin and prevents thrombus or clot formation. It is a highly potent, selective, and essentially irreversible inhibitor of thrombin and clot-bond thrombin. Lepirudin requires no cofactor for its anticoagulant action. Lepirudin is a recombinant form of hirudin, an endogenous anticoagulant found in medicinal leeches.</pharmacology>
<mechanism-of-action>Lepirudin forms a stable non-covalent complex with alpha-thrombin, thereby abolishing its ability to cleave fibrinogen and initiate the clotting cascade. The inhibition of thrombin prevents the blood clotting cascade. </mechanism-of-action>
Any tips would be most appreciated, and thanks...