Closed Bug 684686 Opened 13 years ago Closed 13 years ago

XSLT processor isn't working properly in XUL for certain type

Categories

(Core :: XSLT, defect)

1.9.2 Branch
x86
Windows XP
defect
Not set
trivial

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: kart2006, Unassigned)

References

Details

Attachments

(1 file)

Attached file input.xsl
User Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.218 Safari/535.1

Steps to reproduce:

I'm using Firefox 3.6 version and I'm working on my FF extension. I want to use many XSL files to serialize my xml file. In the beginning I used to run all the files separately using XSLT processor in XUL, it works. Then I want to combine all the files as a single file and when i tested it, the XSLT processor in XUL is not functioning well. 


Actual results:

The output is not correct. I used to test all my XSL files using ECLIPSE XSLT processor to validate and it works fine. Even after I have combined all my XSL files and it didn't work.


Expected results:

It suppose to generate a proper XML output file. I have attached my xsl file and here you can find my input xml file and the original output file generated by ECLIPSE XSLT processor and finally the improper output generated by XUL XSLT processor.

input.xml:

<?xml version="1.0" encoding="windows-1250"?>
<CONTACTS>
    <CONTACT>
        <FirstName>Arun</FirstName>
        <LastName>Arun_niit</LastName>
        <EMail>nuraaa_iceee@yahoo.co.in</EMail>
    </CONTACT>
    <CONTACT>
        <FirstName>Arun</FirstName>
        <LastName>Arun_niit</LastName>
        <EMail>nuraaa_iceee@gmail.com</EMail>
    </CONTACT>
    <CONTACT>
        <FirstName>KumarVeera</FirstName>
        <LastName>Veera Kumar</LastName>
        <EMail>KUMARg_8111@yahoo.com</EMail>
    </CONTACT>
    <CONTACT>
        <FirstName>MarbellaFunkybuddha</FirstName>
        <LastName>Funkybuddha Marbella</LastName>
        <URL>http://www.facebook.com/profile.php?id=1123301493096451</URL>
    </CONTACT>
    <CONTACT>
        <FirstName>Rangarajkarthik</FirstName>
        <LastName>karthik Rangaraj</LastName>
        <EMail>kart2006@gmail.com</EMail>
        <EMail>karthikrangaraj@yahoo.com</EMail>
    </CONTACT>
    <CONTACT>
        <FirstName>Rangaraj</FirstName>
        <LastName>karthik </LastName>
        <EMail>kart2006@gmail.com</EMail>
        <EMail>karthikrangaraj@yahoo.com</EMail>
    </CONTACT>
</CONTACTS>

Original output XML:


<?xml version="1.0" encoding="UTF-8"?>
<CONTACTS>
<CONTACT>
<CUS-ID>PDE-ID00000</CUS-ID>
<FirstName>Arun</FirstName>
<LastName>Arun_niit</LastName>
<Facebook-ID/>
<yahoo>nuraaa_iceee@yahoo.co.in</yahoo>
<gmail>nuraaa_iceee@gmail.com</gmail>
</CONTACT>
<CONTACT>
<CUS-ID>PDE-ID00000</CUS-ID>
<FirstName>KumarVeera</FirstName>
<LastName>Veera Kumar</LastName>
<Facebook-ID/>
<yahoo>KUMARg_8111@yahoo.com</yahoo>
</CONTACT>
<CONTACT>
<CUS-ID>PDE-ID00000</CUS-ID>
<FirstName>MarbellaFunkybuddha</FirstName>
<LastName>Funkybuddha Marbella</LastName>
<Facebook-ID>111123301493096451</Facebook-ID>
<URL>http://www.facebook.com/profile.php?id=111123301493096451</URL>
</CONTACT>
<CONTACT>
<CUS-ID>PDE-ID00000</CUS-ID>
<FirstName>Rangarajkarthik</FirstName>
<LastName>karthik Rangaraj</LastName>
<Facebook-ID/>
<gmail>kart200006@gmail.com</gmail>
<yahoo>karthikrangaraju@yahoo.com</yahoo>
</CONTACT>
</CONTACTS>


Improper output generated by XUL XSLT processor:

<?xml version="1.0" encoding="UTF-8"?>
<CONTACTS>

<CONTACT>
<CUS-ID>PDE-ID2</CUS-ID>
<FirstName>Arun</FirstName>
<LastName>Arun_niit</LastName>
<Facebook-ID/>PDE-ID00000nuraaa_iceee@gmail.comnuraaa_iceee@yahoo.co.in<URL/>
</CONTACT>

<CONTACT>
<CUS-ID>PDE-ID16</CUS-ID>
<FirstName>KumarVeera</FirstName>
<LastName>Veera Kumar</LastName>
<Facebook-ID/>PDE-ID00000KUMARg_8111@yahoo.com<URL/>
</CONTACT>

<CONTACT>
<CUS-ID>PDE-ID29</CUS-ID>
<FirstName>MarbellaFunkybuddha</FirstName>
<LastName>Funkybuddha Marbella</LastName>
<Facebook-ID>111123301493096451</Facebook-ID>PDE-ID00000<URL>http://www.facebook.com/profile.php?id=111123301493096451</URL>111123301493096451</CONTACT>

<CONTACT>
<CUS-ID>PDE-ID43</CUS-ID>
<FirstName>Rangarajkarthik</FirstName>
<LastName>karthik Rangaraj</LastName>
<Facebook-ID/>PDE-ID00000kart200006@gmail.comkarthikrangaraju@yahoo.comkarthikrangaraju@alcetel-lucent.com<URL/>
</CONTACT>
</CONTACTS>

Note: When I execute many XSL files separately, it worked once if i tried 10 times. XUL XSLT processor couldn't handle many functions. 
The JS I'm using to execute and save XSL & XML file:

var src = readFile("D:\\empofinal.xsl");
var parsed = (new DOMParser()).parseFromString(src, "text/xml");
var stylesheet = parsed.documentElement;
 
var processor = new XSLTProcessor();
processor.importStylesheet(stylesheet );
 
objXMLDoc = processor.transformToDocument(objXMLDoc);
 
var serializer = new XMLSerializer();
var prettyString = serializer.serializeToString(objXMLDoc);
 
saveFile(prettyString, "D:\\aout30.xml");
 //alert('New Contact updated successfully');
  var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
                        .getService(Components.interfaces.nsIPromptService);
 
   prompts.alert(null, "New Contact", "New Contact Created successfully"); 

Please fix this bug ASAP. Thank you.
Severity: normal → trivial
Priority: -- → P3
I don't think this will be fixed in FF 3.6 if it isn't a security problem.
Please test if this still happens in Firefox 6 or better 7,8 or 9.
Priority: P3 → --
I have checked in FF version 6, it works.
It works as you expect? Can we close the bug?
Yes of course, please go ahead and close it. But, please give me some explanation why it doesn't work in FF version 3X. In version FF 6, I'm facing a problem with LiveConnect Java.
Sorry I can't explain that, I am not a developer.
Component: General → XSLT
Product: Firefox → Core
QA Contact: general → xslt
Version: 3.6 Branch → 1.9.2 Branch
Ok, not a problem. I hope FF developers will fix the problem with Java Live Connect in FF Version 6 & above. Thank you. Please close this.
They will surely look on a bug in FF6 and later. But it must be reported in bugzilla.
See if it is in this list:
https://bugzilla.mozilla.org/buglist.cgi?list_id=1246743&short_desc=liveconnect&query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&short_desc_type=allwordssubstr&product=Core&product=Firefox&product=Plugins&product=Toolkit
If not, you can file it. But first look at
https://developer.mozilla.org/en/LiveConnect maybe something was changed intentionally.
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: