![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - XML to XML: how to remove stylesheet; how to add line ... ?> [Thread Next] Re: XML to XML: how to remove stylesheet; how to add line ... ?>To: NULL Date: 7/2/2004 9:39:00 PM qluo wrote:
>
> excel.xml
> -----------------------
> <?xml version="1.0"?>
> <?mso-application progid="Excel.Sheet"?>
> <Workbook xmlns:html="http://www.w3.org/TR/REC-html40">
> ...
> -----------------------
>
> Current output with my xsl:
> --------------------------
> <?xml version="1.0"?>
> <?xml-stylesheet href="template.xsl" type="text/xsl"?>
> <Workbook xmlns:html="http://www.w3.org/TR/REC-html40">
> ---------------------------
>
> I want to remove the stylesheet and add <?mso...?> line.
> So the desired output will be:
> ----------------------
> <?xml version="1.0"?>
> <?mso-application progid="Excel.Sheet"?>
> <Workbook xmlns:html="http://www.w3.org/TR/REC-html40">
> ----------------------
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml"
indent="yes" />
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="processing-instruction('xml-stylesheet')">
<xsl:processing-instruction
name="mso-application">progid="Excel.Sheet"</xsl:processing-instruction>
</xsl:template>
</xsl:stylesheet>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.709 / Virus Database: 465 - Release Date: 22/06/2004
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
