XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> - XSLT slicing and orphan contro... (1)
-> + How to delete CDATA using XSL... (15)
-> + Remove only root namespace, bu... (3)
-> + String Parsing (3)
-> + Calling Java method from XSL (3)
-> + populate xsl file from xsd fil... (5)
-> + formating a number like #'###.... (3)
-> + Help with grouping children, f... (20)
-> + Need help for newbie! (3)
-> + xpath in string format (2)
-> + How to populate elements at ra... (4)
-> + Changing Date format in XLST (2)
-> + Please help....How could I rem... (2)
-> + Counting children and grandchi... (7)
-> + Nested tags (4)
-> + Problem with XSLT on a Soap En... (2)
-> + Problem with XSLT on a Soap En... (5)
-> + Comparison between XSLT proces... (2)
-> + Printing non-existing value (9)
-> - big input file for XSLT (14)
-> ->big input file for XSLT
-> ->big input file for XSLT
-> ->big input file for XSLT
-> ->big input file for XSLT
-> ->big input file for XSLT
-> ->big input file for XSLT
-> ->big input file for XSLT
-> ->big input file for XSLT
-> ->big input file for XSLT
-> ->big input file for XSLT
-> ->big input file for XSLT
-> ->big input file for XSLT
-> ->big input file for XSLT
-> + Is there any way to store xpat... (2)
-> + Encoding special charecters (2)
-> + Sorting (3)
-> + XML to PDF using XSL:FO (3)
-> + How to find the line number in... (2)
-> + How to set a marker for paper ... (2)
-> + Not equality Function (2)
-> + Counting Elements (4)
-> + Looking for help or code samp... (2)
-> + Help needed in pattern matchin... (2)
-> + Repeaters and Ifs (2)
-> + select adjacent nodes in xpath... (3)
-> + Stripping of Empty Target Elem... (2)
-> + auto-generate Edifact Intercha... (5)
-> + Qname Error in xsl:element (2)
-> + [Newbie] Type conversion and f... (2)
-> + Do ...when (2)
-> + Using Key (3)
-> + sorting elements in option (2)
-> + NaN(not available) value repla... (3)
-> + infinite loop error when tryin... (9)
-> + Escape a character in the stri... (3)
-> + find sum of 2 elements in xml (2)
-> + placing a ' * ' by reading the... (3)
-> + Problem in dispaying Current D... (4)
-> + Merging Table Cells in XSLT re... (3)
-> + xsl fo block-container and foo... (2)
-> + Is is possible to create a .CO... (2)
-> + printing a parent node value i... (2)
-> + Mime header info setup? (3)
-> + Calculating a Date based on 4 ... (3)
-> + XSLT formatting number issue (10)
-> + map repeating elements separat... (3)
-> + Combining XML elements based o... (3)
-> + Convert XML to UTF-8 (8)
-> + XSLT and MS Access 2007 Optio... (5)
-> - WORDML list to XML list (1)
-> + [Newbie] Using lookups in XSLT... (3)
-> + Comparing 2 passed Date Values (2)
-> + ERROR XQueryMediator Error du... (2)
-> + XML / XSLT... Unordered lists ... (2)
-> + Specify image path in XSL (2)
-> + Variable within a variable (3)
-> + How to call jfreechart method ... (8)
-> + leading and trailing white spa... (2)
-> + XSLT to Html problems (6)
-> + How to set classpath, when i n... (3)
-> + Error in using functions (4)
-> + To find the occurence of a cha... (3)
-> + PLMXML to XML (4)
-> + Transform multiple node values... (2)
-> + I am in need of svg example(s)... (13)
-> + count in XSLT, Need Help Pleas... (2)
-> + Help with XML.Report and Gener... (2)
-> + for each loop and variable (5)
-> + Problem with selecting nodes f... (3)
-> + Getting "Expected elemenmt mis... (2)
-> + Help with attached XML mapping... (8)
-> + xml:space="Preserve" and Embed... (2)
-> + XSLT and Multiple Strings (2)
-> + XSL Date format (2)
-> + check element contents against... (3)
-> + XML to XML Namespace conversio... (2)
-> - Supressing subgroup headers in... (1)
-> - HTML to fo conversion using XS... (1)
-> + No Topic (2)
-> + parsing xml using xslt HELP (2)
-> + Multiple Page Headers (2)
-> + PLM Xml To Generic XML (3)
-> + XSLT/XPath Help (2)
-> + XSL Space Issue (2)
-> + wanting help with xslt custom ... (3)
-> - Update input xml content with ... (1)
-> + Error: namespace prefix xsl on... (3)
-> + Error in my xsl:if test... (2)
-> - calling javascript from XSLT (1)
-> + Error when trying to a call a ... (2)
-> - HTTP POST from XSLT (1)
-> + passing xml document as input ... (2)
-> + XSLT for WORDML table to CALS ... (2)
-- Previous [361-380] [381-400] [401-420] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Fairy LeeSubject: big input file for XSLT
Author: Fairy Lee
Date: 06 Feb 2009 03:39 PM
I need to run XSLT with a big input file about 60M. It looks Stylus Studio runs forever. I think it should be the memory problem. However, after I add -Xmx512M into Parameters of Java VM from Options menu, it reports error, like "can't find out INI something" and then Stylus Studio becomes crazy so that I can't open it properly. I also try to run XSLT from command line, but no lucky. Any advices? Really appreciate.

Postnext
Fairy LeeSubject: big input file for XSLT
Author: Fairy Lee
Date: 06 Feb 2009 03:47 PM
Additional information:
My input file size is 69M.
The maximum size of Allocated stack size of XSLT I can set in Stylus Studio is 64M.
Is it the problem?
How to enlarge the maximum setting for Allocated Stack Size?

Postnext
Minollo I.Subject: big input file for XSLT
Author: Minollo I.
Date: 06 Feb 2009 05:34 PM
You are likely just running into memory troubles; I assume you are using the (default) Saxon XSLT processor, right? (XSLT > Scenario settings).

You can increase your heap, but you may want to be careful because if you set it to a value that cannot be achieved on your machine, the JVM will fail to initialize. The stack size is not a problem if you are running Saxon (which is what we would suggest doing anyway).

You may want to consider using XQuery; the embedded DataDirect XQuery is a highly scalable engine.

Postnext
Fairy LeeSubject: big input file for XSLT
Author: Fairy Lee
Date: 08 Feb 2009 10:59 PM
Originally Posted: 08 Feb 2009 10:43 PM
Thank you for your relpy.

Yes, you are correct. I am running XSLT by Saxon XSLT processor. I add -Xmx256m to parameters of JVM, but it still doesn't work. I couldn't add more value, like -Xmx512m, because just like what you said, the JVM failed to initialize.

Question 1: if I use command line to run XSLT, like StylusXslt, how can I set the heap value for it?

Question 2: are there any other way to improve the memory of XSLT processor?

Question 3: I am not well with xQuery sibling. Could you please give me some suggestions about my sample if I use xQuery to replace XLST code?
My input XML structure likes this:
<ROOT>
<STATMENT>
.......
</STATEMENT>
<ACCOUNT>
...
</ACCOUNT>
<TRANSACTION>
....
</TRANSACTION>
<TRANSACTION>
....
</TRANSACTION>
<ACCOUNT>
....
</ACCOUNT>
<TRANSACTION>
....
</TRANSACTION>
</ROOT>

I want to get the output XML like this:
<ROOT>
<STATMENT>
.......
<ACCOUNT>
...
<TRANSACTION>
....
</TRANSACTION>
<TRANSACTION>
....
</TRANSACTION>
</ACCOUNT>
<ACCOUNT>
...
<TRANSACTION>
....
</TRANSACTION>
</ACCOUNT>
</STATEMENT>
</ROOT>

How to use xQuery child syntax to structure this XML?

Thanks in advance!

Postnext
Minollo I.Subject: big input file for XSLT
Author: Minollo I.
Date: 08 Feb 2009 11:06 PM
In the XSLT Scenario properties you can choose which processor to use to "process" your stylesheet; Saxon is the default processor used by Stylus Studio; "built-in" is a simpler XSLT processor built-in Stylus Studio and good mostly for debugging (step-by-step execution). You are apparently using Saxon, so, no need to worry there.

Your specific problem is a typical positional grouping issue; some additional details here: http://www.xml-connection.com/2008/02/convertig-proprietary-file-formats-to.html

This XQuery may be a start:
declare function local:getRelatedAccounts($item) {
let $nextItem :=$item/following-sibling::*[local-name()!="ACCOUNT" and local-name()!="TRANSACTION"][1]
for $related in $item/following-sibling::*[local-name()="ACCOUNT"]
where if ($nextItem) then $related << $nextItem else true()
return $related
};
declare function local:getRelatedTransactions($item) {
let $nextItem := $item/following-sibling::*[local-name()!="TRANSACTION"][1]
for $related in $item/following-sibling::*[local-name()="TRANSACTION"]
where if($nextItem) then $related << $nextItem else true()
return $related
};
<ROOT> {
for $statement in /ROOT/STATEMENT
return
<STATEMENT> {
for $account in local:getRelatedAccounts($statement)
return
<ACCOUNT name="{$account/string()}"> {
for $transaction in local:getRelatedTransactions($account)
return
<TRANSACTION> {
$transaction/string()
} </TRANSACTION>
} </ACCOUNT>
} </STATEMENT>
} </ROOT>

Postnext
Fairy LeeSubject: big input file for XSLT
Author: Fairy Lee
Date: 09 Feb 2009 12:27 PM
Originally Posted: 09 Feb 2009 12:14 PM
Thank you for your great help. Two more questions:
Question 1: could you please give more explaination about "where if ($nextItem)then $related<<$nextItem else true()". I am confused about this condition.

Question 2: if there is a statement trailer record that should be put in STATEMENT, but after ACCOUNT. How to code it?
I add the following code, but the result is not correct.

declare function local:getRelatedStatTrailer($item) {
let $nextItem :=$item/following-sibling::*[local-name()!="STATEMENTTRAILER"][1]
for $related in $item/following-sibling::*[local-name()="STATEMENTTRAILER"]
where if ($nextItem) then $related << $nextItem else true()
return $related
};

.....

<STATMENTS>
{
<STATEMENT>
{
<ACCOUNT>
</ACCOUNT>
{
for $stattrailer in local:getRelatedStatTrailer($statement)
return
<TOTAL_RECORDS>{$stattrailer/TOTAL-RECORDS/text()}</TOTAL_RECORDS>

}
}</STATEMENT>
}</STATEMENTS>

If there are two statements, the first statement returns both the first trailer and the second trailer; the second statement is ok.

And also there are more than one element in $stattrailer, but if I don't want to add <Trailer></Trailer>, I only can add one emelement into the code. If I add more, it will report error. For example, I also want to add <TOTAL_ACCOUNT>{$stattrailer/TOTAL-ACCOUNT/text()}</TOTAL_ACCOUNT> under <TOTAL_RECORD> directly, how to do it?

Thanks again!

Postnext
Minollo I.Subject: big input file for XSLT
Author: Minollo I.
Date: 09 Feb 2009 12:43 PM
>Question 1: could you please give more explaination about "where if
>($nextItem)then $related<<$nextItem else true()". I am confused about
>this condition.

It's filtering the "related" items to fetch only the ones that come *before* the next container element, or all of them if there are no more container elements.


>Question 2: if there is a statement trailer record that should be put >in STATEMENT, but after ACCOUNT. How to code it?

I think you want to change your function into:
declare function local:getRelatedStatTrailer($item) {
let $nextItem :=$item/following-sibling::*[local-name()="STATEMENT"][1]
for $related in $item/following-sibling::*[local-name()="STATEMENTTRAILER"]
where if ($nextItem) then $related << $nextItem else true()
return $related
};

$nextItem needs to somehow identify the next group; as you don't have sub-groups, in your case it's probably easier to identify the next group just finding the next "STATEMENT".

The code should look something similar to this:
</ROOT>
for $statement in $input/STATEMENT
return
<STATEMENT> {
for $account in local:getRelatedAccounts($statement)
return
<ACCOUNT name="{$account/string()}"> {
for $transaction in local:getRelatedTransactions($account)
return
<TRANSACTION> {
$transaction/string()
} </TRANSACTION>
} </ACCOUNT>,
for $stattrailer in local:getRelatedStatTrailer($statement)
return
<TOTAL_RECORDS>{$stattrailer/TOTAL-RECORDS/text()}</TOTAL_RECORDS>
} </STATEMENT>
} </ROOT>

Postnext
Fairy LeeSubject: big input file for XSLT
Author: Fairy Lee
Date: 09 Feb 2009 01:45 PM
I use your old example to do it, but it doesn't work. I attached the xml input file and xquery file. Could you please take time to look at them?
Also, I want to add
<total_30>{$record11/total_30/text()}</total_30>
under <total_20></total_20>.
I use
{
for $record11 in local:getRelated11($record_10)
return
<total_20>{$record11/total_20/text()}</total_20>
<total_30>{$record11/total_30/text()}</total_30>
}
but it reports error.

It seems I have to use:
<trailer>
<total_20>{$record11/total_20/text()}</total_20>
<total_30>{$record11/total_30/text()}</total_30>
</tailer>
but I don't want to <trailer></trailer> in the output file. Any advices?


UnknownproprietaryFile_trailer.xquery


UnknownproprietaryInputFile_trailer.xml

Postnext
Minollo I.Subject: big input file for XSLT
Author: Minollo I.
Date: 09 Feb 2009 02:04 PM
Instead of me trying to guess what you are trying to do, and you trying to map my suggestions on your real usecase, why don't you post a sample/cleaned-up example of your incoming XML and the XML you would like to get as a result? That would speed up things.

Postnext
Fairy LeeSubject: big input file for XSLT
Author: Fairy Lee
Date: 09 Feb 2009 02:31 PM
My case is really like the case in your topic http://www.xml-connection.com/2008/02/convertig-proprietary-file-formats-to.html but the "trailer" part. I updated your sample files and attached them in my previous message. After updaing, it is exact same as my case. Could you please take a look my attached file? This is the easiest way for me because the raw data file is very complex and it is hard for me to create a sample data file for you. Thanks a lot.

By the way, could you please tell me where I can get the syntax for xQuery function, like following-sibling, <<,... and so on.

Postnext
Minollo I.Subject: big input file for XSLT
Author: Minollo I.
Date: 09 Feb 2009 04:15 PM
A very small mistake; change != into = when getting the nextItem:
declare function local:getRelated11($item) {
let $nextItem := $item/following-sibling::*[local-name()="record_10"][1]
for $related in $item/following-sibling::*[local-name()="record_11"]
where if($nextItem) then $related << $nextItem else true()
return $related
};

You'll find all the details you are looking for (and more) in the XQuery (http://www.w3.org/TR/xquery/) and XPath (http://www.w3.org/TR/xpath20) specifications.

Postnext
Fairy LeeSubject: big input file for XSLT
Author: Fairy Lee
Date: 09 Feb 2009 08:18 PM
I really appreciate your great help!
Could you please take a look my another question?

I use
{
for $record11 in local:getRelated11($record_10)
return
<total_20>{$record11/total_20/text()}</total_20>
<total_30>{$record11/total_30/text()}</total_30>
}
but it reports error.

It seems I have to use:
<trailer>
<total_20>{$record11/total_20/text()}</total_20>
<total_30>{$record11/total_30/text()}</total_30>
</tailer>
but I don't want to have <trailer></trailer> in the output file. Any advices?

Postnext
Minollo I.Subject: big input file for XSLT
Author: Minollo I.
Date: 09 Feb 2009 08:43 PM
XQuery syntax:

{
for $record11 in local:getRelated11($record_10)
return (
<total_20>{$record11/total_20/text()}</total_20>,
<total_30>{$record11/total_30/text()}</total_30>
)
}

Posttop
Fairy LeeSubject: big input file for XSLT
Author: Fairy Lee
Date: 10 Feb 2009 10:45 AM
Originally Posted: 10 Feb 2009 10:43 AM
Thank you for your patience and great help. I really appreciate.

Have a good day,
Fairy

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.