xsl-list
[Top] [All Lists]

XML to XFDF Problem

2005-12-01 02:18:00
Hi all,

I will try to be brief, as I don't want to bore you all :)

Basically this is the scenario.

I have a raw xml file which I am trying to translate into xfdf, I am
using Stylus Studio (Latest Version) to do this and I am selecting the
.net processor to parse the xml.

Now in the beginning I was using the built-in processor as I didn't know
any better, I had my xslt file working perfectly to output exactly what
I needed. But when our developer tried to use this code within his .net
app the output was totally different.

I then brought the code back to stylus and changed to the .net
processor. I got the same result as my developer, the output was totally
messed up.

After much investigation I am convinced it is down to one thing.....the
<xfdf> tag. An xfdf file should follow this format...

<?xml version="1.0" encoding="UTF-8"?> <xfdf
xmlns="http://ns.adobe.com/xfdf/"; xml:space="preserve"> Xml stuff goes
here </xfdf>

If remove the <xfdf xmlns="http://ns.adobe.com/xfdf/";
xml:space="preserve"> tag from the start and the closing one at the
bottom, my xml looks fine and how I expect except it but it is obviously
missing the essential tag for it to work with Acrobat.

My question to you all is this. Is there any way I can get my xfdf tags
into the xml file without the parser going nuts when it hits them?

Below is the non-working file.

I hope someone can help.

Many Thanks

Simon Russell

<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
exclude-result-prefixes="xml">
<xsl:output method="xml" encoding="UTF-8" = indent="yes">
</xsl:output> 
<xsl:template match="/">
        <xfdf xmlns="http://ns.adobe.com/xfdf/"; xml:space="preserve">
                <xsl:element name="f">
                        <xsl:attribute name="href">
                                <xsl:value-of select="/doc_template"/>
                </xsl:attribute>
                </xsl:element>
                <xsl:element name="ids">
                        <xsl:attribute
name="original">7A0631678ED475F0898815F0A818CFA1</xsl:attribute>
                        <xsl:attribute
name="modified">BEF7724317B311718E8675B677EF9B4E</xsl:attribute>
                </xsl:element>
        <xsl:element name="fields">
        <xsl:for-each select="/NewDataSet/results/node()">
                <xsl:element name="field">
                                <xsl:attribute name="name">
                                        <xsl:value-of
select="name()"></xsl:value-of>
                                </xsl:attribute>
                                <xsl:element name="value">
                                        <xsl:value-of
select="."></xsl:value-of>
                                </xsl:element>
                </xsl:element>
        </xsl:for-each>
        </xsl:element>
        </xfdf>
</xsl:template>
</xsl:stylesheet>

All information contained in this e-mail is Company Confidential.


Voted one of the Sunday Times 2005 100 Best Companies To Work For 

COMPANY CONFIDENTIAL UNLESS STATED OTHERWISE. 

Any opinions expressed in this message are those of the sender only and do not 
necessarily represent the views or opinions of FIRSTPLUS Financial Group or any 
associated companies.

Registered Office: 1 Churchill Place, London E14 5HP 

Registration Number: 3315543

The information contained in this message and any attachments is intended 
solely for the use of the individual or entity to whom it is addressed. It may 
contain privileged and confidential information and if you are not the intended 
recipient you must not copy, distribute or take action reliant on it. If you 
have received the e-mail in error please notify 
Administrator(_at_)FIRSTPLUS(_dot_)CO(_dot_)UK


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>