aspose file tools*
The moose likes XML and Related Technologies and the fly likes too large XSL file causing error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "too large XSL file causing error" Watch "too large XSL file causing error" New topic
Author

too large XSL file causing error

christine clarin
Ranch Hand

Joined: Feb 05, 2005
Posts: 106
hello, i am having the branch offset too large error in my program. this (according to my research and observation) is brought about by my large xsl file (large being > 64 kb, over a thousand lines) - when i lessen it, the xsl works. i have researched about it but i can't seem to solve the problem. this link http://issues.apache.org/jira/browse/XALANJ-1122?page=comments#action_12370543 tries to answer it but i can't seem to follow and i don't know how to use a patch. how do i solve this one? i need big help please...thanks!!!
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
There seem to be two solutions based on what I read in that link -

1. Patch.
2. Switching off-inlining templates.

Have you tried the second option already ?

- m


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
christine clarin
Ranch Hand

Joined: Feb 05, 2005
Posts: 106
Originally posted by Madhav Lakkapragada:
There seem to be two solutions based on what I read in that link -

1. Patch.
2. Switching off-inlining templates.

Have you tried the second option already ?

- m


for number 1, i have already downloaded the patch but i dont know how to use it, how do i include it in my code?

for number 2, how do i do this?

i'm so sorry.. it's my first time trying to work with xsl and had a problem like this. hope you could help me with this one! thanks!
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
# 2 approach depends on how you are doing the transformation. I am not very familiar with XSLTC so you should help me out.

What I am asking is are you compiling on the commandline or are you doing it inside a Java program?

- m
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
Could the transformation you need be done in two (smaller) steps? It might be easier to debug that way as you could inspect the intermediate product.
Bill
christine clarin
Ranch Hand

Joined: Feb 05, 2005
Posts: 106
Originally posted by Madhav Lakkapragada:
# 2 approach depends on how you are doing the transformation. I am not very familiar with XSLTC so you should help me out.

What I am asking is are you compiling on the commandline or are you doing it inside a Java program?

- m


no, we are compiling inside a java program.
christine clarin
Ranch Hand

Joined: Feb 05, 2005
Posts: 106
Originally posted by William Brogden:
Could the transformation you need be done in two (smaller) steps? It might be easier to debug that way as you could inspect the intermediate product.
Bill


no i don't think we can. we're using this xsl to transform an xml file to an html file...and i dont know how we could do transformation in two pieces without sacrificing the order of our elements inside the html... or how we can do that to produce only one html instead of two (one for each transformation).
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
The reason I suggested two steps is that I once took that approach with a client's giant unwieldy XML file that I had to transform to PDF. The intermediate file was an XML reorganization of the original material to put the content in the order that the eventual output had to have.

Perhaps your first pass could output XML in the right order, thus simplifying the XML to HTML stage.
Bill
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
In your Java program, insert this code



as is mentioned in the link you provided. See if this will help you, if that doesn't help, we can try the patch (# 1) approach. I have to read the text file though to see how to install the patch.

- m
christine clarin
Ranch Hand

Joined: Feb 05, 2005
Posts: 106
ok! thanks for all the help, will try to code the one you just put here and i'll update you immediately. thanks!
christine clarin
Ranch Hand

Joined: Feb 05, 2005
Posts: 106
Originally posted by Madhav Lakkapragada:
In your Java program, insert this code



as is mentioned in the link you provided. See if this will help you, if that doesn't help, we can try the patch (# 1) approach. I have to read the text file though to see how to install the patch.

- m


i tried this one, but i get the error that TransformerFoactory doesn't recgnize the "disable-inlining" attribute. this was my code:

String plvHtml = xml.transformXml(new DOMSource( document ),
"xmlTransform_plv.xsl","protocol.htm" );
---------------------------
public String transformXML (...) {
...
TransformerFactory tFactory = TransformerFactory.newInstance();
tFactory.setAttribute("disable-inlining", new Boolean(true));

Transformer transformer = tFactory.newTransformer( new StreamSource(
xslFileDir ) );
...
}
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
Could you check the versions of your jar/XSLTC with the specification mentioned in the link you posted. I am guessing you are running with an older version.

Also, based on what I understand about the "patch" approach, if you want to use that I think you should build your own jars. My gut says that you should download the source code, replace the file mentioned in the patch set with the one given in the patch and then build the jar files. Based on the information provided in the link my gut says that is the way the patch thing works.
Thanks.

- m
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: too large XSL file causing error