• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

too large XSL file causing error

 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!!!
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
christine clarin
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
# 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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic