Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] XPath Against OpenXML and OpenOffice Spreadsheets?

From: "Vyacheslav Sedov" <vyacheslav.sedov@--------->
To:
Date: 6/4/2008 8:41:00 AM
hi,

XQuery is better for this task - you can try eXist
(http://exist.sourceforge.net/) for data retrieving.

Look like it capable for zip-files processing (odt&docx files is zip-arhives)

With best wishes,
Slav

P.S. About namespaces - XPath 2.0 support * for namespace prefixes -
so you can use select="//*:table-cell | //*:c" but i think this is not
very good idea

On Wed, Jun 4, 2008 at 12:46 AM, Jay Bryant <jay@xxxxxxxxxxxx> wrote:
> Hi, Ronnie
>
> I've done quite a bit of XSLT work against both OpenOffice and Excel, and
> what you describe is certainly possible.
>
> If you want to run them together (hard to imagine the case where you would),
> you'd do:
>
> <xsl:value-of select="path/to/your/column[string-length(.) &gt; 20]"/>
>
> If you want each value on its own line, you could do:
>
> <xsl:template match="path/to/your/column[string-length(.) &gt; 20]">
> <xsl:value-of select="."/><xsl:text>
> </xsl:text>
> </xsl:template>
>
> or
>
> <xsl:for-each select="path/to/your/column[string-length(.) &gt; 20]">
> <xsl:value-of select="."/><xsl:text>
> </xsl:text>
> </xsl:for-each>
>
> If you need to process the same nodes with some other template as well, you
> can add a mode to one or the other template.
>
> Remember that both Excel and OpenOffice have multiple namespaces, so your
> path statement will be much longer, but that's the general idea.
>
> (I didn't test any of that, so it might suffer from a typo or something.)
>
> HTH
>
> Jay Bryant
>
> ----- Original Message ----- From: "Ronnie Royston" <rhroyston@xxxxxxxxx>
> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> Sent: Tuesday, June 03, 2008 3:34 PM
> Subject: [xsl] XPath Against OpenXML and OpenOffice Spreadsheets?
>
>
>> All I need to do is retrieve the string value of every cell of column
>> "A" whose string length is greater than 20 characters in length.
>>
>> Anyone know how to use XPath to retrieve this from an Excel 2007 file?
>> What about getting these values from OpenOffice.org's CALC
>> spreadsheet via XPath?
>>
>> Regarding the OpenXML - I've been all over MSDN and it appears to
>> require an understanding of .rels files and convoluted mappings
>> between different sub-files???  I know I can use ADO and Microsoft's
>> Jet Provider to read from an Excel file (and just about anything else)
>> but I thought that using pure XML technologies would be much cooler.
>>
>> Is XQuery a better fit for this task?
>>
>> Even a hint of where to go and look would be appreciated.
>>
>> - Ronnie


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent