[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Processing Stylesheet with multiple namespaces

Subject: RE: Processing Stylesheet with multiple namespaces
From: cknell@xxxxxxxxxx
Date: Thu, 20 Sep 2007 16:12:53 -0400
RE:  Processing Stylesheet with multiple namespaces
I ran your stylesheet with Saxon 8.7.3 and the o:ole attribute did not appear in the output. I then put back the w: namespace on 

<xsl:apply-templates select="OLEObject"/>

which became

<xsl:apply-templates select="w:OLEObject"/>

and this too, did not appear in the output.

There is nothing wrong with your stylesheet. There is something wrong with your XSLT processor.
-- 
Charles Knell
cknell@xxxxxxxxxx - email



-----Original Message-----
From:     Michael Daniloff <mdanilof@xxxxxxxxx>
Sent:     Thu, 20 Sep 2007 12:37:51 -0700 (PDT)
To:       xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:   Processing Stylesheet with multiple namespaces

XSLT 1.0
Processor: MSXML
 
I have the following XML file (fragment):
 
<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
<w:document
xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
xmlns:w10="urn:schemas-microsoft-com:office:word"
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml">
 <w:body>  
  
  <w:p w:rsidR="007D3364" w:rsidRDefault="007D3364"
w:rsidP="007D3364">
   <w:pPr>
    <w:pStyle w:val="NormalWeb"/>
   </w:pPr>
   <w:r>
    <w:t>sample</w:t>
   </w:r>
   <w:r w:rsidR="00200227">
    <w:object w:dxaOrig="9689" w:dyaOrig="6866">
     <v:shapetype id="_x0000_t75"
coordsize="21600,21600" o:spt="75"
o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe"
filled="f" stroked="f">
      <v:stroke joinstyle="miter"/>
      <v:formulas>
       <v:f eqn="if lineDrawn pixelLineWidth 0"/>
       <v:f eqn="sum @0 1 0"/>
       <v:f eqn="sum 0 0 @1"/>
       <v:f eqn="prod @2 1 2"/>
       <v:f eqn="prod @3 21600 pixelWidth"/>
       <v:f eqn="prod @3 21600 pixelHeight"/>
       <v:f eqn="sum @0 0 1"/>
       <v:f eqn="prod @6 1 2"/>
       <v:f eqn="prod @7 21600 pixelWidth"/>
       <v:f eqn="sum @8 21600 0"/>
       <v:f eqn="prod @7 21600 pixelHeight"/>
       <v:f eqn="sum @10 21600 0"/>
      </v:formulas>
      <v:path o:extrusionok="f" gradientshapeok="t"
o:connecttype="rect"/>
      <o:lock v:ext="edit" aspectratio="t"/>
     </v:shapetype>
     <v:shape id="_x0000_i1025" type="#_x0000_t75"
style="width:484.5pt;height:343.5pt" o:ole="">
      <v:imagedata r:id="rId4" o:title=""/>
     </v:shape>
     <w:OLEObject Type="Embed"
ProgID="Word.Document.12" ShapeID="_x0000_i1025"
DrawAspect="Content" ObjectID="_1234025626"
r:id="rId5"/>
    </w:object>
   </w:r>
  </w:p>  
 </w:body>
</w:document>

 
In my stylesheet I'm trying to replace <w:object>
element with <w:pict> element.
 
Also, I have to get rid off <w:OLEObject> element
and drop "o:ole" attribute from the <v:shape> element
 
Here is my stylesheet:
 
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 
xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:o="urn:schemas-microsoft-
com:office:office"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
xmlns:w10="urn:schemas-microsoft
-com:office:word"
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
exclude-result-prefixes="ve o r m v wp w10 w wne">
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="w:object">
    <w:pict>      
      <xsl:apply-templates/>     
      
      
      <xsl:apply-templates select ="@o:ole"/>
      
    </w:pict>
  </xsl:template>
  
  <xsl:template match="OLEObject"/>
  <xsl:template match="@o:ole"/>  
  
</xsl:stylesheet>
 
The output is all right except that the <v:shape>
element still has attribute "o:ole" present
 
Another thing is that I had to drop "w" prefix for the
OLEObject element to get the desired output.
 
Thanks,
 
Michael



       
____________________________________________________________________________________
Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&sid=396545469

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.