RE: [xsl] extracting data from html part result...

Subject: RE: [xsl] extracting data from html part result...
From: omprakash.v@xxxxxxxxxxxxx
Date: Thu, 12 May 2005 21:13:23 +0530
Hi,
         See this revised xml snippet and xslt. I have included only the
revised portions as the change is small.

Your top level html element should be

<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
         ^^^ <!-- change here no prefix -->
<head>
   <title>Announcements</title>
and so on

and in your xsl file,

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns:a="atg.uwe.ac.uk"
    xmlns="http://www.w3.org/1999/xhtml";
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^      <!-- change here xhtml
namespace declared -->
   exclude-result-prefixes="a">
the rest being the same as in the earlier post.

The problem with the earlier version being since a prefix was declared,
then all elements in the input and the stylesheet need to have the "xhtml:"
prefix.

Note: Please feel free to correct me if Iam wrong

Cheers,
prakash




                                                                                                                   
                    "Aron Bock"                                                                                    
                    <aronbock@hot        To:     xsl-list@xxxxxxxxxxxxxxxxxxxxxx                                   
                    mail.com>            cc:     (bcc: omprakash.v/Polaris)                                        
                                         Subject:     RE: [xsl] extracting data from html part result...           
                    05/12/2005                                                                                     
                    08:54 PM                                                                                       
                    Please                                                                                         
                    respond to                                                                                     
                    xsl-list                                                                                       
                                                                                                                   
                                                                                                                   




Aaron, sorry, I did see that, but assumed it was your output rather than
your input.  I should have paid closer attention.

First, try this.  This input:


<html xmlns:xhtml="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
<head>
   <title>Announcements</title>
   <link type="text/css" rel="stylesheet"

href="
http://my.uwe.ac.uk/uPortal/media/org/jasig/portal/layout/AL_TabColumn/integratedModes/myuwe/skin/myuwe.css
"/>
</head>
<body>
    <div id="announcements">
        <h1>myUWE System Announcements</h1>

        <p>Module Marks are now available for the following modules:</p>

        <table>
            <tr><td>UZYRKF-40-3</td><td>Advanced Radiotherapy
Studies</td></tr>
            <tr><td>UZYRKC-30-3</td><td>Evaluating Physiotherapy &amp;
Practice</td></tr>
            <tr><td>UZYRJN-40-2</td><td>Developing Clinical Reasoning &amp;

Practice</td></tr>
            <tr><td>UZYRJR-20-2</td><td>Fieldwork 2</td></tr>
            <tr><td>UZYRJ9-40-2</td><td>Psychosocial Challenges to
Occupation</td></tr>
        </table>
    </div>
</body>
</html>

With this XSL (yours, modified slightly)

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns:a="atg.uwe.ac.uk"
    exclude-result-prefixes="a">

    <xsl:output indent="yes" method="xml" omit-xml-declaration="yes"/>

    <xsl:template match="/">
               <xsl:copy-of select="html/body/div[@id = 'announcements']"/>
    </xsl:template>
</xsl:stylesheet>

Will copy the div and its contents.

Notice that I've added a "xhtml" prefix to the namespace declaration in
your
input.

So the reason you were not getting any output previously is because the
input was in one namespace, and the processor was looking in another.

Unfortunately I'm not versed in the subtleties of processing wrt namespaces

(I've been at this just a few months myself, and I haven't read up
enough...), so hopefully somebody more versed than I can comment.

Regards,

--A


>From: Aaron Johnson <Aaron2.Johnson@xxxxxxxxx>
>Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>Subject: RE: [xsl] extracting data from html part result...
>Date: Thu, 12 May 2005 15:27:05 +0100
>
>Aron...
>
>Both xsl and html samples are in the email.

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/






This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. 
If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately.
You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification,
distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited.

Visit Us at http://www.polaris.co.in

Current Thread