[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: "Joe Fawcett" <joefawcett@xxxxxxxxxxx>
Date: Tue, 25 Sep 2007 14:45:54 +0100
Re:  Processing Stylesheet with multiple namespaces
Michael

Okay, this was your base XML:

<?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>


This was my suggested XSLT: <?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 select="@*|node()"/>
    <!-- or <xsl:apply-templates /> if you don't want attributes -->
   </w:pict>
 </xsl:template>

 <xsl:template match="w:OLEObject"/>
 <xsl:template match="@o:ole"/>

</xsl:stylesheet>

It's odd that when I run it using .net XslCompiledTransform the o:ole is removed from the v:shape yet when you run it it isn't.

Joe
http://joe.fawcett.name



From: Michael Daniloff <mdanilof@xxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Processing Stylesheet with multiple namespaces
Date: Mon, 24 Sep 2007 17:21:23 -0700 (PDT)

Joe,

I went back to that post today, copied that
stylesheet, ran the code once again and it left
"o:ole" attribute in the result tree.

I know that the version that I posted in reply to Abel
isn't very elegant and it doesn't make a lot of sense
to me but it completes the task for now.


Thanks,


Michael



------- original message --------------


Date: Sat, 22 Sep 2007 15:06:51 -0500 To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> From: "Joe Fawcett" <joefawcett@xxxxxxxxxxx> Subject: Re: Processing Stylesheet with multiple namespaces Message-ID: <BAY123-DAV35A710C60348EA10CB2A4D9B40@xxxxxxx>

Michael

That's not the stylesheet I posted, as Abel points out
you have extra
apply-templates that are not needed.

Joe




____________________________________________________________________________________
Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games.
http://sims.yahoo.com/

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.