|
The second page sequence is the problem...
I'm not shure what it is i'm doing wrong but it is not inserting more page sequences. Am i understanding correctly when i say that the Variable that i created STOP <just like in the example> is the number of rows in a table on a page. If it is then That is exactly what i want to do...
The thing is, i think that i'm looping the wrong for each. There is just one "TableEnties" tag... I think i should loop the "TableInfo" tag.
Is this correct?
If it is, would anyone have an idea of how to do so?
Thank you once again.
Okay, now i've tried putting in a TableEntries/TableInfo instead of TableEntries into the first for each in the seconde page-sequeance. This put in all the needed pages but did not display anything on the pages...
See, the thing i want to do is for every <lets say 5 as an example> "TableInfo" tags <every "TableInfo" tag is a Row in my table> i want to insert a new page-sequence.
Please help...
He who laughs last...
-- modified at 4:38 Tuesday 25th July, 2006
|
|
|
|
|
An exam question i'm posed with answering
What are the main ways of calling styles into a page?
discuss.
Please help.
|
|
|
|
|
Hallo,
Using Visual Studio 2003 I have a big problem editing a XML file with about 25000 lines. As soon as I copy paste something into the xml file validation starts which needs on my computer up to a minute. I do not need validation at all. I need fast editing capibilities. How can I switch this slow crap function off?
Sincerely
Chris
|
|
|
|
|
Hi everyone!
I know that this isn't the right place to post this message but i need help urgantly.
I read up on fop and there is a patch for the problem i'm having...
FOP runs my system's memory dry... This problem derives from the fact that FOP doesn't release the memory very well with tables and i have a very big table in my xsl.
You might make better sence of what they mean at these sites...
http://blog.gmane.org/gmane.text.xml.fop.user/day=20040124
http://comments.gmane.org/gmane.text.xml.fop.user/12120
Sorry yet again for posting it here.
He who laughs last...
|
|
|
|
|
I'll present you with an alternative to this. You're probably using FOP to take in the XML and the XSL and produce a PDF. It's been a few years, but what I recall about FOP and Java's XML processing in general is that they're both memory hogs. .Net's processing is a lot more efficient. What you could try is writing a little .Net command line app that takes your XML and XSL documents and applies the transform. Have it spit out an .fo document and then run that through FOP to get the PDF. Hopefully that will work for you!
Logifusion[^]
|
|
|
|
|
Hi Dustin,
Thank you for your reply...
i've recently read that "page-sequence" might help with the problem of the tables in fop hogging the memory. Do you think that putting a table on each page and setting each page to be a "page-sequence" would help?
Time is running out and i've looked every where for the patch but if this works, that would be GREAT.
Thank you in advance.
He who laughs last...
|
|
|
|
|
If i try to put a page sequence for each page i get an error
Here is my xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="simple"
page-height="21cm"
page-width="29.7cm"
margin-top="1cm"
margin-bottom="2cm"
margin-left="1.5cm"
margin-right="1.5cm">
<fo:region-body margin-top="2cm"/>
<fo:region-before extent="1.5cm"/>
<fo:region-after extent="1.5cm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="simple">
<fo:flow flow-name="xsl-region-body">
<fo:block>
<xsl:apply-templates select="ClientLookUp"/>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<xsl:template match="ClientLookUp">
<xsl:for-each select="Title">
<fo:block font-size="18pt"
font-family="sans-serif"
line-height="20pt"
space-after.optimum="1pt"
background-color="blue"
color="white"
text-align="center"
padding-top="3pt">
<xsl:value-of select="Heading"/>
</fo:block>
<fo:block font-size="16pt"
font-family="sans-serif"
line-height="18pt"
space-after.optimum="1pt"
background-color="blue"
color="white"
text-align="center"
padding-top="3pt">
<xsl:value-of select="DateCreated"/>
</fo:block>
</xsl:for-each>
<xsl:for-each select="TableEntries">
<fo:page-sequence master-reference="simple">
<fo:flow flow-name="xsl-region-body">
<fo:block width="750pt">
<fo:table table-layout="fixed" width="750pt">
<xsl:if test="ClientTitle1">
<fo:table-column column-width="30pt"/>
</xsl:if>
<xsl:if test="ClientName1">
<fo:table-column column-width="60pt"/>
</xsl:if>
<xsl:if test="ClientSur1">
<fo:table-column column-width="80pt"/>
</xsl:if>
<xsl:if test="ClientCode1">
<fo:table-column column-width="35pt"/>
</xsl:if>
<xsl:if test="ClientType1">
<fo:table-column column-width="50pt"/>
</xsl:if>
<xsl:if test="ClientBDay1">
<fo:table-column column-width="50pt"/>
</xsl:if>
<xsl:if test="ClientStaff1">
<fo:table-column column-width="85pt"/>
</xsl:if>
<xsl:if test="TelH">
<fo:table-column column-width="50pt"/>
</xsl:if>
<xsl:if test="TelW">
<fo:table-column column-width="50pt"/>
</xsl:if>
<xsl:if test="Cell1">
<fo:table-column column-width="50pt"/>
</xsl:if>
<xsl:if test="EmailH">
<fo:table-column column-width="105pt"/>
</xsl:if>
<xsl:if test="EmailW">
<fo:table-column column-width="105pt"/>
</xsl:if>
<fo:table-body>
<fo:table-row>
<xsl:if test="ClientTitle1">
<fo:table-cell font-size="7pt" padding="1pt">
<fo:block background-color="silver">
Title
</fo:block>
</fo:table-cell>
</xsl:if>
<xsl:if test="ClientName1">
<fo:table-cell font-size="7pt" padding="1pt">
<fo:block background-color="silver">
ClientName
</fo:block>
</fo:table-cell>
</xsl:if>
<xsl:if test="ClientSur1">
<fo:table-cell font-size="7pt" padding="1pt">
<fo:block background-color="silver">
ClientSurname
</fo:block>
</fo:table-cell>
</xsl:if>
<xsl:if test="ClientCode1">
<fo:table-cell font-size="7pt" padding="1pt">
<fo:block background-color="silver">
ClientCode
</fo:block>
</fo:table-cell>
</xsl:if>
<xsl:if test="ClientType1">
<fo:table-cell font-size="7pt" padding="1pt">
<fo:block background-color="silver">
ClientType
</fo:block>
</fo:table-cell>
</xsl:if>
<xsl:if test="ClientBDay1">
<fo:table-cell font-size="7pt" padding="1pt">
<fo:block background-color="silver">
BirthDate
</fo:block>
</fo:table-cell>
</xsl:if>
<xsl:if test="ClientStaff1">
<fo:table-cell font-size="7pt" padding="1pt">
<fo:block background-color="silver">
Staff
</fo:block>
</fo:table-cell>
</xsl:if>
<xsl:if test="TelH">
<fo:table-cell font-size="7pt" padding="1pt">
<fo:block background-color="silver">
Tel(H)
</fo:block>
</fo:table-cell>
</xsl:if>
<xsl:if test="TelW">
<fo:table-cell font-size="7pt" padding="1pt">
<fo:block background-color="silver">
Tel(W)
</fo:block>
</fo:table-cell>
</xsl:if>
<xsl:if test="Cell1">
<fo:table-cell font-size="7pt" padding="1pt">
<fo:block background-color="silver">
Cell
</fo:block>
</fo:table-cell>
</xsl:if>
<xsl:if test="EmailH">
<fo:table-cell font-size="7pt" padding="1pt">
<fo:block background-color="silver">
Email(H)
</fo:block>
</fo:table-cell>
</xsl:if>
<xsl:if test="EmailW">
<fo:table-cell font-size="7pt" padding="1pt">
<fo:block background-color="silver">
Email(W)
</fo:block>
</fo:table-cell>
</xsl:if>
</fo:table-row>
<xsl:for-each select="TableInfo">
<fo:table-row>
<xsl:if test="ClientTitle">
<fo:table-cell font-size="7pt" border="1" border-color="black" border-style="solid" padding="2pt">
<fo:block>
<xsl:value-of select="ClientTitle"/>
</fo:block>
</fo:table-cell>
</xsl:if>
<xsl:if test="ClientName">
<fo:table-cell font-size="7pt" border="1" border-color="black" border-style="solid" padding="2pt">
<fo:block>
<xsl:value-of select="ClientName"/>
</fo:block>
</fo:table-cell>
</xsl:if>
<xsl:if test="ClientSurname">
<fo:table-cell font-size="7pt" border="1" border-color="black" border-style="solid" padding="2pt">
<fo:block>
<xsl:value-of select="ClientSurname"/>
</fo:block>
</fo:table-cell>
</xsl:if>
<xsl:if test="ClientCode">
<fo:table-cell font-size="7pt" border="1" border-color="black" border-style="solid" padding="2pt">
<fo:block>
<xsl:value-of select="ClientCode"/>
</fo:block>
</fo:table-cell>
</xsl:if>
<xsl:if test="ClientType">
<fo:table-cell font-size="7pt" border="1" border-color="black" border-style="solid" padding="2pt">
<fo:block>
<xsl:value-of select="ClientType"/>
</fo:block>
</fo:table-cell>
</xsl:if>
<xsl:if test="ClientBDay">
<fo:table-cell font-size="7pt" border="1" border-color="black" border-style="solid" padding="2pt">
<fo:block>
<xsl:value-of select="ClientBDay"/>
</fo:block>
</fo:table-cell>
</xsl:if>
<xsl:if test="ClientStaff">
<fo:table-cell font-size="7pt" border="1" border-color="black" border-style="solid" padding="2pt">
<fo:block>
<xsl:value-of select="ClientStaff"/>
</fo:block>
</fo:table-cell>
</xsl:if>
<xsl:if test="TelH">
<fo:table-cell font-size="7pt" border="1" border-color="black" border-style="solid" padding="2pt">
<fo:block>
<xsl:value-of select="TelH"/>
</fo:block>
</fo:table-cell>
</xsl:if>
<xsl:if test="TelW">
<fo:table-cell font-size="7pt" border="1" border-color="black" border-style="solid" padding="2pt">
<fo:block>
<xsl:value-of select="TelW"/>
</fo:block>
</fo:table-cell>
</xsl:if>
<xsl:if test="Cell">
<fo:table-cell font-size="7pt" border="1" border-color="black" border-style="solid" padding="2pt">
<fo:block>
<xsl:value-of select="Cell"/>
</fo:block>
</fo:table-cell>
</xsl:if>
<xsl:if test="EmailH">
<fo:table-cell font-size="7pt" border="1" border-color="black" border-style="solid" padding="2pt">
<fo:block>
<xsl:value-of select="EmailH"/>
</fo:block>
</fo:table-cell>
</xsl:if>
<xsl:if test="EmailW">
<fo:table-cell font-size="7pt" border="1" border-color="black" border-style="solid" padding="2pt">
<fo:block>
<xsl:value-of select="EmailW"/>
</fo:block>
</fo:table-cell>
</xsl:if>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</fo:block>
</fo:flow>
</fo:page-sequence>
<fo:block break-after="page"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
The Error:
--- Standard Output ---
[ERROR] org.apache.fop.apps.FOPException: page-sequence must be child of root, not fo:block
<div class="ForumSig">He who laughs last...</div>
-- modified at 5:14 Monday 24th July, 2006
|
|
|
|
|
The XSL you have here nests page-sequence s inside each other and you can't do that. A page-sequence gets paired up with a master . Take a look at this example from zvon[^]. It shows kind of how you would write a book in FO. The first 6 pages are done under one page-sequence and then the subsequent pages are done under a completely different set of page-sequence s where the first page has a header a certain way and the even and odd pages have the header aligned differently. It's a complex example, but it should give you an idea of how to use page-sequence s.
|
|
|
|
|
Cannot implicitly convert type 'System.Xml.XmlNodeList' to 'System.Xml.XmlElement'
how can i map/convert from 1 class to other using C#
rabia
|
|
|
|
|
Umm, a question like this scares me. First, you're saying you don't know how to cast in C# and yet you're working on a program that works with XML? Second, there's the fact that NodeList versus Element didn't tip you off that one is a list of nodes and the other is a single element. It sounds like you need to pick up a book on C# first before you go any further.
Logifusion[^]
|
|
|
|
|
|
hi,I want to output XML content,coding like below,but show error,how to fix it?
std::basic_ostream<tchar,std::char_traits<tchar> > &os;
root.outer_xml(os);
error C2530: 'os' : references must be initialized
angus
|
|
|
|
|
Opinions of this product? I need to learn and use xml, and these guys have a good sale on...
Charlie Gilley
Will program for food...
Whoever said children were cheaper by the dozen... lied.
My son's PDA is an M249 SAW.
|
|
|
|
|
Hi,
We are parsing csv file to XML document. It follows a structure. One part has changed.
<code>
<PRODUCTS>
<PRODUCT INVOICE="2" PRODID="1 No Lead" QTY="3000" />
<PRODUCT INVOICE="2" PRODID="3 Super" QTY="1000" />
<PRODUCT INVOICE="2" PRODID="4 Diesel" QTY="1000" />
</PRODUCTS>
</code>
In this case we need to add a
<PRODUCT INVOICE="2" PRODID="2 Plus" QTY="0" />
If a product doesn't exist need to add that name with qty 0. How would we go about doing this? We are adding this to PRODUCT node.
Thanks.
|
|
|
|
|
VK-Cadec wrote: How would we go about doing this?
That depends. How are you doing this?
VK-Cadec wrote: We are parsing csv file to XML document
|
|
|
|
|
Hi all,
I found out that there is a patch for fop. It reduces the memory usage problem significantly... The thing is though i have no idea how to implement the patch.
This is one of the sites i found the information...
http://comments.gmane.org/gmane.text.xml.fop.user/11739
if anyone has any help that would be great
Thank you in advance
He who laughs last...
Oh yes... I'm using fop 0.20.5
-- modified at 10:15 Wednesday 19th July, 2006
|
|
|
|
|
i think this is a better idea of what i'm looking for...
<href>http://comments.gmane.org/gmane.text.xml.fop.user/12120
i just need to understand how to get the code onto my machine and how to apply the patch. I realy need the patch since i'm using a table in my xsl for the fop...
thank you in advance
He who laughs last...
-- modified at 6:55 Thursday 20th July, 2006
|
|
|
|
|
I have this output from an SQL qery using: FOR XML AUTO, ELEMENTS
<br />
<root><br />
<Companies><br />
<name>John</name><br />
<Meetings><br />
<meetingdate>12/12/06</meetingdate><br />
</Meetings><br />
</Companies><br />
<br />
<br />
<Companies><br />
<name>Jim</name><br />
<Meetings><br />
<meetingdate>08/09/07</meetingdate><br />
</Meetings><br />
<Meetings><br />
<meetingdate>12/12/06</meetingdate><br />
</Meetings><br />
</Companies><br />
</root><br />
And I want to format it using XSL into a table like so:
John | 12/12/06
Jim | 08/09/07
Jim | 12/12/06
my problem lies with the fact Jim has "Meetings" twice inside his entry (becuase he has 2 meetings) and im not sure on nesting a for-each inside a for-each so it loops through Companies and while doing so loops through any meetings it finds.
so far my XSL looks like this:
<br />
<table><br />
<br />
<tr><br />
<th>Company</th><br />
<th>Date</th><br />
</tr><br />
<br />
<xsl:for-each select="//Companies"><br />
<tr><br />
<td><br />
<xsl:value-of select="name"/><br />
</td><br />
<td><br />
<xsl:value-of select="Meetings/meetingdate"/><br />
</td><br />
</tr> <br />
</xsl:for-each><br />
<br />
<br />
</table><br />
but it only prints out the first meeting in each entry.
Cany any one help me with this ?
|
|
|
|
|
Well, it looks like you want one row per meeting. You can skip the nested for loop. It's pretty simple:
<xsl:for-each select="//Companies/Meetings">
<tr><td>
<xsl:value-of select="../name"/>
</td><td>
<xsl:value-of select="meetingdate"/>
</td></tr>
</xsl:for-each>
Logifusion[^]
|
|
|
|
|
which one is the best searching algorithm for XML documents
rabia
-- modified at 2:31 Wednesday 19th July, 2006
|
|
|
|
|
|
thank u
-- modified at 2:20 Wednesday 26th July, 2006
|
|
|
|
|
is this format corrrect <element attribute="val"> name <meaning>xyz</meaning></element>
rabia
-- modified at 2:23 Wednesday 19th July, 2006
|
|
|
|
|
Yes, that's a correct format. The " name " portion is considered a text node.
Logifusion[^]
|
|
|
|
|
Hi,
This is my XSD for Attributes here what i need is, if Name is present in my XML attribute then there should not be Data and Length, if Name is not there then i can have Data and Length (Length can be optional). How does it will be changed...
<xs:element name="VAR" maxOccurs ="unbounded">
<xs:complexType>
<xs:attribute name="Name" use ="required" type="xs:string" />
<xs:attribute name="Data" use ="required" type="xs:string" />
<xs:attribute name="Length" use ="optional" type="xs:integer" />
</xs:complexType>
</xs:element>
|
|
|
|