Changes in 902b stylesheet parser
Just noticed that in 902b a variable declared in a stylesheet is not visible within an included stylesheet.
All previous version have worked so that the variable IS visible.
ie declare a variable in the main stylesheet.
xsl:variable name="dictionary" select="/page/page_content/dictionary/row[language=/page/language]"
in another stylesheet that is included ie
xsl:include href="expertsessiondetail.xsl"
try to reference the variable
xsl:value-of select="$dictionary/expert"
this throws an error saying that variable dictionary is not declared.
OK so I can work around this BUT what I want to know is is this "by design" ie it is intended to work that way in future or is this a mistake and it will revert to normal with the next release.
Rob
Ok. This was a bug that was fixed in 9.0.2. It was working incorrectly in all previous versions of our XDK.
The testcase is:
m.xml
<x/>
m.xsl
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:include href="m2.xsl"/>
<xsl:template match="/">
<xsl:variable name="x" select="'x'"/>
<xsl:value-of select="$x"/>
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
m2.xsl
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- this template references variable $x -->
<xsl:template match="x">
<xsl:value-of select="$x"/>
</xsl:template>
</xsl:stylesheet>My test was to transform m.xml using m.xsl...
Trying this with SAXON 6.4.3 gives:
Error on line 4 of file:/C:/temp/m2.xsl:
Variable x has not been declared
Transformation failed: Failed to compile stylesheet. 1 error detected.Trying this with MSXSL 4.0 Beta 2 gives:
msxml4.dll: A reference to variable or parameter 'x' cannot be resolved. The variable or parameter may not be defined, or it may not be in scope.Trying this with Oracle XSLT 9.0.2B gives:
file:/C:/temp/m2.xsl<Line 4, Column 32>: XSL-1031: (Error) Variable not defined:
'x'.
oracle.xml.parser.v2.XPathException: Variable not defined: 'x'.
Error occurred while processing m.xml: file:/C:/temp/m2.xsl<Line 4, Column 32>:
XSL-1031: (Error) Variable not defined: 'x'.So these all look consistent. The rules of variable scoping in XSLT do not provide that the variable $x is visible to the included template.
You'd have to either make x a global stylesheet parameter/variable, or declare a parameter in the <xsl:template match="x"> and use <xsl:apply-templates> with a nested <xsl:with-param> to pass the param value from one template to another.
Similar Messages
-
I am using McAfee EPO 4.6.0 when trying to view agent log receiving the error above. I can view this log in IE...
I am using McAfee EPO 4.6.0 when trying to view agent log receiving the error above. I can view this log in IE...
-
Applescript date parsing has changed
i have been using a script i wrote 7 years ago to convert a string in mm/dd/yyyy format to an a/s date object, and as of last week it was working perfectly.
tonite i just tried it and "11/05/2012" is parsed as 11may rather than 5nov...something changed the a/s parser's fmt...i suspect the xcode update i just did whenever it came out...
<Edited by Host>yes, and apparently the xcode updte CHANGED MY LOCALIZATION SETTINGS without telling me:-P
i've fixed the problem by avoiding a/s string2date coersion(what i shoulda done in the 1st place)-:
-- dtp = [yyyy,mm,dd,hh,mm,ss]
set dt to (current date)
set day of dt to 1
set year of dt to ((item 1 of dtp) as integer)
set month of dt to ((item 2 of dtp) as integer)
set day of dt to ((item 3 of dtp) as integer)
set hours of dt to ((item 4 of dtp) as integer)
set minutes of dt to ((item 5 of dtp) as integer)
set seconds of dt to ((item 6 of dtp) as integer) -
Fail to parse SQL query after report attributes changes on sample app
This errors occurs in the sample application istalled in Workspace PMW on the http://htmldb.oracle.com web site. Goto home page, edit Page 1, Select "Top Orders" in Region, select report attributes, change max count from 5 to 5 in "Layout and Pagination", apply changes, run page and parse SQL error occurs. Select "debug" and the following is shown regarding the query.
0.10: query could not be parsed:
SELECT a.ORDER_ID, a.ORDER_TIMESTAMP, a.CUSTOMER_ID,
b.cust_last_name || ', ' || b.cust_first_name cust_name, NVL(a.ORDER_TOTAL, 0)
FROM demo_orders a, DEMO_CUSTOMERS b
WHERE a.customer_id = b.customer_id
ORDER BY NVL(a.ORDER_TOTAL, 0) DESC order by 5 desc,5 desc
failed to parse SQL query:
ORA-00933: SQL command not properly ended
I can't see that I'm doing anything wrong but maybe someone can shed some light on this!
Thanksthis is sort of an oversight on our part. what's going on is that the sample app installs with that order by clause in the query. at the same time, the report attributes page for that region has a default sort sequence value of "1 desc" (even though column heading sorting isn't enabled). when you go to that page and try to apply any change, htmldb tries to set things up correctly for you...and you end up with that double order by. the best way to avoid the issue is to remove the order by clause from the query on the Region Definition page.
hope this helps,
raj -
Revision: 1458
Author: [email protected]
Date: 2008-04-29 13:26:14 -0700 (Tue, 29 Apr 2008)
Log Message:
Refreshed asc.jar to fix clobbering of Jono's Parser changes.
checkintests Passed: YES
Needs QA: Yes
Needs DOC: NO
API Change: NO
Reviewer: jspiro
Code-level description of changes:
lib/asc.jar
Recompiled with InputBuffer changes and Jono's Parser changes.
modules/asc/src/java/macromedia/asc/parser/InputBuffer.java
Made no-arg constructor protected.
Modified Paths:
flex/sdk/trunk/lib/asc.jar
flex/sdk/trunk/modules/asc/src/java/macromedia/asc/parser/InputBuffer.java -
Bug & solution: DW8 not finding stylesheet
Back on 13th April, 2006, I posted a message below about DW8
not picking
up the stylesheet on a site I was managing in it. The same
problem
recurred with another site I've just created from scratch, so
this time I
set to tracking the bug down. Basically, the problem is with
DW8's
stylesheet parsing. It balks at tags within CSS comments. So
the
following will generate a problem:
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 0.9em;
/* Background colour commented out to allow Javascript
background colour changer to work, as it can't overrule the
stylesheet.
bgcolor set in page <body> tag.*/
/* background: #fff;*/
color: #000;
Change the above by scratching <body> from inside the
comments to leave:
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 0.9em;
/* Background colour commented out to allow Javascript
background colour changer to work, as it can't overrule the
stylesheet.*/
/* background: #fff;*/
color: #000;
and DW8 behaves as it should. This is annoying, as any code
parser should
completely ignore anything within comments. Anyway, I report
the problem
as a public service, so that the Macroserfs can squash it,
and the rest
of youse can be aware of it.
Cheers
Fred
fred DOT riley AT nottingham DOT ac DOT uk
Message posted 13th April, 2006, subject "DW8 not finding
stylesheet":
Ok, here's Dreamweaver doing it again, driving me around the
bend. On one
particular site of mine, DW8 has suddenly decided not to see
the site
stylesheet, even though:
a) the files display fine in a browser and on the server
(www.eurocall-
languages.org)
b) the CSS link ref in the template page headers are fine
(otherwise (a)
would fail)
c) all my other sites are ok
I've just been moved to a new PC, from a previous PC where I
was using DW
MX. I exported my site definitions from MX as .ste files. I
imported them
into DW8 on the new machine. They're all in the Site Manager,
and the
settings haven't changed. The pages in those sites all appear
fine, apart
from this one site.
The HTML is fine. The CSS is fine. What's not fine is that DW
won't find
the CSS file. If I open a template, press Shift-F11 and link
to the CSS
file, which is sitting in the site root directory, when I
press Ok I get
the really helpful error message:
"An unexpected error occurred while trying to read
style-sheet
information"
If I try to preview the template file in a browser, I get the
even more
helpful error:
"An invalid argument was encountered"
Searching for either error message in the DW Knowledge Base
returns
nothing. The DW installation is fresh as a daisy off the
disk, and the
machine is a spanking new XP machine with nothing complicated
on it.
If I manually open the template file in a browser, though, it
displays
fine. So, there's something in the DW code on the pages in
this
particular site that DW8 is rejecting, even though DW MX had
no problems
with it at all (hell, the site was created in MX).
I would be grateful if someone could point me to possible
solution(s),
other than doing what I keep threatening to do, which is to
go back to
hard-core HTML/CSS coding in a programmer's file editor. The
only thing
that keeps me using DW is the site management capabilities
;-\. There are
times, happily not as frequent as they used to be, when the
perversity of
DW and its incomprehensible error messages drive me to
serious mouse and
keyboard abuse.
Cheers
Fred Riley
Learning Technologist, School of Nursing, University of
Nottingham, UKI put this into a new page -
body {font-family: Arial, Helvetica, sans-serif;
font-size: 2.9em;
/* Background colour commented out to allow Javascript
background colour changer to work, as it can't overrule the
stylesheet.
bgcolor set in page <body> tag.*/
/* background: #fff;*/
color: #0F0;
and text that I enter on that page is huge and green. What's
the problem?
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"Fred Riley" <[email protected]> wrote in message
news:[email protected]...
> Back on 13th April, 2006, I posted a message below about
DW8 not picking
> up the stylesheet on a site I was managing in it. The
same problem
> recurred with another site I've just created from
scratch, so this time I
> set to tracking the bug down. Basically, the problem is
with DW8's
> stylesheet parsing. It balks at tags within CSS
comments. So the
> following will generate a problem:
>
> body {
> font-family: Arial, Helvetica, sans-serif;
> font-size: 0.9em;
> /* Background colour commented out to allow Javascript
> background colour changer to work, as it can't overrule
the stylesheet.
> bgcolor set in page <body> tag.*/
> /* background: #fff;*/
> color: #000;
> }
>
> Change the above by scratching <body> from inside
the comments to leave:
>
> body {
> font-family: Arial, Helvetica, sans-serif;
> font-size: 0.9em;
> /* Background colour commented out to allow Javascript
> background colour changer to work, as it can't overrule
the stylesheet.*/
> /* background: #fff;*/
> color: #000;
> }
>
> and DW8 behaves as it should. This is annoying, as any
code parser should
> completely ignore anything within comments. Anyway, I
report the problem
> as a public service, so that the Macroserfs can squash
it, and the rest
> of youse can be aware of it.
>
> Cheers
>
> Fred
> fred DOT riley AT nottingham DOT ac DOT uk
>
>
> ------------------------
>
> Message posted 13th April, 2006, subject "DW8 not
finding stylesheet":
>
> Ok, here's Dreamweaver doing it again, driving me around
the bend. On one
> particular site of mine, DW8 has suddenly decided not to
see the site
> stylesheet, even though:
>
> a) the files display fine in a browser and on the server
(www.eurocall-
> languages.org)
> b) the CSS link ref in the template page headers are
fine (otherwise (a)
> would fail)
> c) all my other sites are ok
>
> I've just been moved to a new PC, from a previous PC
where I was using DW
> MX. I exported my site definitions from MX as .ste
files. I imported them
> into DW8 on the new machine. They're all in the Site
Manager, and the
> settings haven't changed. The pages in those sites all
appear fine, apart
> from this one site.
>
> The HTML is fine. The CSS is fine. What's not fine is
that DW won't find
> the CSS file. If I open a template, press Shift-F11 and
link to the CSS
> file, which is sitting in the site root directory, when
I press Ok I get
> the really helpful error message:
>
> "An unexpected error occurred while trying to read
style-sheet
> information"
>
> If I try to preview the template file in a browser, I
get the even more
> helpful error:
>
> "An invalid argument was encountered"
>
> Searching for either error message in the DW Knowledge
Base returns
> nothing. The DW installation is fresh as a daisy off the
disk, and the
> machine is a spanking new XP machine with nothing
complicated on it.
>
> If I manually open the template file in a browser,
though, it displays
> fine. So, there's something in the DW code on the pages
in this
> particular site that DW8 is rejecting, even though DW MX
had no problems
> with it at all (hell, the site was created in MX).
>
> I would be grateful if someone could point me to
possible solution(s),
> other than doing what I keep threatening to do, which is
to go back to
> hard-core HTML/CSS coding in a programmer's file editor.
The only thing
> that keeps me using DW is the site management
capabilities ;-\. There are
> times, happily not as frequent as they used to be, when
the perversity of
> DW and its incomprehensible error messages drive me to
serious mouse and
> keyboard abuse.
>
> Cheers
>
> Fred Riley
> Learning Technologist, School of Nursing, University of
Nottingham, UK
>
>
>
> -
Non-English characters processed correctly by XML Parser 2 XSLT?
I'm trying to transform an XML document (parsed as an XMLDocmument) using an XSL stylesheet (parsed as an XSLStylesheet) and the XSLProcessor class in Java, I encounter the following problem:
Non-US characters such as German umlauts, stored in the XML in &#xxx; style, are not processed properly. "|" (ü), for example, comes out as "C<". Is this a bug in the XSLProcessor class or am I doing something wrong? I'm using this stylesheet declaration:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml1/strict"> Or should I mess with the encoding attribute of the ?xml ...? PI?
tia
John SmithI have not specified any encoding.
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="completeproduct.xsl"?>
<PRODUCT connection="demosample" xmlns:xsql="urn:oracle-xsql">
<xsql:query>
select * from products
</xsql:query>
should i specify encoding
null -
How to change the default color of the selected row
hi all,
I need to know how to change the default color(yellow) of the selected row in a table component.whether i need to change anything in the stylesheet.If so, where should i make the changes in the stylesheet.
thanks and regards,
rpkThe chart colors are being referred to *'palette.cxml'* file in these directories
BI_HOME\web\app\res\s_oracle10\chartsupport
BI_HOME\oc4j_bi\j2ee\home\applications\analytics\analytics\res\s_oracle10\chartsupport
you can change to your custom colors.
Restart OC4J and PS to make the new ones work..
Regards,
Raghu -
How to change hover state on spry menu dropdowns?
I've spent 4 hours making changes to the style sheet. I cannot figure out how to make the drop-down menu background change when you mouseover. The text color changes, but the background doesn't. I keep making changes to the stylesheet, and sometimes I see no difference.
Also... trying to change the font color on the main menu text. Style sheet LOOKS right, but doesn't display any change.
ALSO, my border is wider than the submenus. They are both set to 15ems. Maybe I don't understand ems??? I appreciate all your help out there! Sorry for not taking out all comments from code...
http://duenorthdesign.com/pcm/index2.html
ul.MenuBarHorizontal { margin: 0; padding: 0; list-style-type: none; font-size: 100%; cursor: default; width: 748px; } /* Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html */ ul.MenuBarActive { z-index: 1000; } /* Menu item containers, position children relative to this container and are a fixed width */ ul.MenuBarHorizontal li { margin: 0; padding: 0; list-style-type: none; font-size: 100%; position: relative; text-align: left; cursor: pointer; width: 8em; float: left; } /* Submenus should appear below their parent (top: 0) with a higher z-index, but they are initially off the left side of the screen (-1000em) */ ul.MenuBarHorizontal ul { margin: 0; padding: 0; list-style-type: none; font-size: 100%; z-index: 1020; cursor: default; width: 15em; position: absolute; left: -1000em; } /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item */ ul.MenuBarHorizontal ul.MenuBarSubmenuVisible { left: auto; } /* Menu item containers are same fixed width as parent */ ul.MenuBarHorizontal ul li { width: 15em; font-size: 12px; background-color: #C2CA9A; color: rgba(0,0,0,1); } /* Submenus should appear slightly overlapping to the right (95%) and up (-5%) */ ul.MenuBarHorizontal ul ul { position: absolute; margin: -5% 0 0 95%; } /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */ ul.MenuBarHorizontal ul.MenuBarSubmenuVisible ul.MenuBarSubmenuVisible { left: auto; top: 0; } /******************************************************************************* DESIGN INFORMATION: describes color scheme, borders, fonts *******************************************************************************/ /* Submenu containers have borders on all sides */ ul.MenuBarHorizontal ul { border: 1px solid #61270e; } /* Menu items are a light gray block with padding and no text decoration */ ul.MenuBarHorizontal a { display: block; cursor: pointer; background: 61270e; padding: 0.5em 0.75em; color: ffffff; text-decoration: none; } /* Menu items that have mouse over or focus have a blue background and white text */ ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:focus { color: #61270e; } /* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */ ul.MenuBarHorizontal a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarSubmenuVisible { background: transparent; color: #61270e; } /******************************************************************************* SUBMENU INDICATION: styles if there is a submenu under a given menu item *******************************************************************************/ /* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */ ul.MenuBarHorizontal a.MenuBarItemSubmenu { background-image: url(../images/bkd_navtop.jpg); background-repeat: repeat-x; color: rgba(255,255,255,1); font-family: "Yanone Kaffeesatz", Verdana, Geneva, sans-serif; width: 149px; font-size: 23px; } /* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */ ul.MenuBarHorizontal ul a.MenuBarItemSubmenu { background-image: url(SpryMenuBarRight.gif); background-repeat: no-repeat; background-position: 95% 50%; } /* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */ ul.MenuBarHorizontal a.MenuBarItemSubmenuHover { background-image: url(SpryMenuBarDownHover.gif); background-repeat: no-repeat; background-position: 95% 50%; } /* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */ ul.MenuBarHorizontal ul a.MenuBarItemSubmenuHover { background-image: url(SpryMenuBarRightHover.gif); background-repeat: no-repeat; background-position: 95% 50%; }The good news is, Spry components generate their own CSs files so you know where to start when customizing. From there you can either go into the CSS file itself, or use the CSS styles panel in Dreamweaver.
if you're looking within the CSS file, you first need to find the block the styles the particular element you want to change, and tweak the values. However, if any of the attributes are inheriting their states from a parent rule, then you need to add that attribute to override the parent setting. So that means making sure you're using the right attribute and getting the syntax right.
If you use the CSS panel, select all, find you way to the correct style sheet, expand it and find the rule you need to change. You can set these parameters in the area underneath, or just double click the rule in the upper tree and display the CSS rules dialog. This is my favorite as it displays exactly what is contained in the style sheet in visual form. You can change values easily and add new attributes knowing that it will write the correct syntax. This should make it very easy to add hover states for the background and text, dimensions for the submenus and borders. For sizes and borders, I prefer pixels, but you can also add borders per side of the containing box - it doesn't have to be the same border all the way around. -
How can i change a default ....
How can i change the default xml parser used by oracle??
can i use xerces ??? or something different
i am using Oracle 9....03 version
and transformation i am doing is using transform function of xmltype.
The things which work using some xml parsers seems are not working with oracle default parser
transformations.
Can anyone pls tell how to chnage the xml parser ????Yes i want the transform function of xmltype to use some different parser to transform the document.
Because the application which was working with different parser stops working when i moved my xml to oracle database to use xmldb functionality
i can find small small problems with the oracle xml parser.... like entities cannot be defined in xsl, cannot use format-number, converting less than angle bracket to & lt ; even if i specifying to disable output escaping.. beacuse of which it started giving me lots of problems.
These all were working with the other xml parsers...
i am stuck don't know what to do now ?? -
Web Dynpro ABAP Stylesheet - Portal Integration
We have a Web Dynpro ABAP being displayed through a Portal iView. The Portal server and the Web Dynpro ABAP server are separate. Our problem is in getting the Web Dynpro ABAP to use the stylesheet of the Portal.
We can make this work by forcing an external stylesheet (via application parameters, global Dynpro settings, or passed on the end of the URL), but we have to hard-code the full URI of the Portal stylesheet. This would be very hard to manage if we hard-code every iView's CSS location (or set every individual Web Dynpro's application parameters), and we want instead for the Portal to supply whatever the user's stylesheet is dynamically.
So what we want is: if we change the Portal stylesheet, the Portal would just pass the new stylesheet URI to our ABAP Web Dynpro iViews without manual modification of the iViews.
Here is an example of what works:
http://our-abap-server.com/sap/bc/webdynpro/sap/cprojects?sap-ep-themeroot=https://our-portal-server.com/irj/portalapps/com.sap.portal.design.portaldesigndata/themes/portal/ourportalstylesheetname
Shouldn't the Portal iView automatically pass sap-cssurl or sap-ep-themeroot to Web Dynpro ABAP? We have "Supply Portal Stylesheet" checked on the iView it just doesn't pass anything to the Web Dynpro ABAP. Why wouldn't SAP pass this parameter dynamically to the Web Dynpro ABAPs? Is this a product error?
There seems to be a great deal of confusion about this on the SDN message forums... I think this may be the core issue.
We are using a 7.0 SP13 Portal with an ECC 6.0 SP12 backend.Now that you mention it, I ran into that exact same issue -- the application parameters didn't work for hard-coding the theme. The fix ended up being the web server semicolon thing I mentioned earlier (that was why the parameter didn't make it to the backend).
The themeroot is automatically sent to the backend from the portal, so you shouldn't really have to manually send it as a parameter anyways.
I'd suggest talking to your network guys. Also this could be the result of the SP you are on (we're on 13 for the portal and the backend system -- maybe this feature doesn't work in some earlier SP's?). There are also some options to force the theme as a WD application parameter on the backend side, which you could check into. Details on those are here:
[http://help.sap.com/saphelp_nw2004s/helpdata/en/7b/fb57412df8091de10000000a155106/frameset.htm]
Also you could look at the requests being made by installing HttpAnalyzer in your browser. You can inspect "post" parameters going from the portal to the backend system. One of those posts (the first one to the backend system) should contain the parameter sap-cssurl (same kind of thing as sp-ep-themeroot). This is where our problem turned up as this parameter was not being posted.
Lastly, make sure that your frontend portal and backend portal are in the same domain. For instance:
frontend.domain.com
backend.domain.com
If your backend and frontend are in different domains it messes all kinds of things up, including stylesheets I think. If you can't get around this, then read about domain relaxing (but I highly recommend getting the domains the same).
When we started, ours were:
portal.dx.company.com
sap.company.com
This created all kinds of problems. Putting our systems in the same domain with the same protocol and fixing our little semicolon web server problem fixed basically all of our portal complaints. Up until that time, we had also had many problems with session management (backend sessions were getting stuck until the HTTP timeout).
That's all I know. Good luck. -
How to parse an XMl without using prefix in the namespace and elements?
Hi
The following is a sample of the xml that I need to parse.
Without the prefix in the namespace section I am getting an error but when i just put in the prefix it works fine. Any help here would be greatly appreciated.
I think i need to change something in the parser set up...may be the somewhere in the bolded lines....but i am clueless...
//Xml begins
<?xml version="1.0" encoding="utf-8" ?>
- <Statemessages xsi:schemaLocation="http://www.SomeLocation.com/SomeXSD.xsd" xmlns="http://www.abcd.com/BSN" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <FileControl>
<CreationDate>2008-08-11</CreationDate>
- <Source>
<SystemID>SAP4BSN</SystemID>
<MandantID>100</MandantID>
</Source>
- <Destination>
<SystemID>CWL</SystemID>
<MandantID>746</MandantID>
</Destination>
<SequenceNumber>000000004</SequenceNumber>
<Counter>000000001</Counter>
</FileControl>
- <Message>
- <PartyRegistrationID>
<ID>2101576347</ID>
<Type>RG</Type>
<ID>2101576347</ID>
<Type>AG</Type>
</PartyRegistrationID>
<CustomerGroupID>02</CustomerGroupID>
<Name>Lewicki</Name>
<Subname>Hans Bruno Michel</Subname>
<DateTime>2008-08-11T23:59:59</DateTime>
- <DefaultOfPayment>
<MessageID>00000001</MessageID>
<GrossAmountBefore>0.0</GrossAmountBefore>
<GrossAmountCurrent>-17.9</GrossAmountCurrent>
<Currency>EUR</Currency>
<SettlementOfBalance>Nein</SettlementOfBalance>
<IncludingSubsidiaryClaim>Ja</IncludingSubsidiaryClaim>
</DefaultOfPayment>
- <ContractsWithDefaultOfPayment>
<ContractID>0148863732</ContractID>
</ContractsWithDefaultOfPayment>
- <Messagedetails>
- <ReturnDebitNote>
<MessageID>00000002</MessageID>
<KindOf>BA</KindOf>
<Reason>E2</Reason>
<Date>2008-08-11</Date>
<GrossAmount>-15.4</GrossAmount>
<Currency>EUR</Currency>
</ReturnDebitNote>
</Messagedetails>
</Message>
</Statemessages>
//XML end
I am using the following stored procedure to try this;
create or replace PROCEDURE CompleteSaveXML_1 AS
XMLMessage2 XMLTYPE;
v_parser dbms_xmlparser.Parser;
v_clob CLOB;
v_sent DATE;
v_doc xmldom.DOMDocument;
v_nl xmldom.DOMNodeList;
v_nFCL xmldom.DOMNodeList;
v_nFCN xmldom.DOMNode;
v_nFCSourceL xmldom.DOMNodeList;
v_nFCSourceN xmldom.DOMNode;
v_nFCDestinationL xmldom.DOMNodeList;
v_nFCDestinationN xmldom.DOMNode;
m_nl xmldom.DOMNodeList;
m_n xmldom.DOMNode;
v_n xmldom.DOMNode;
v_n3 xmldom.DOMNodeList;
v_n4 xmldom.DOMNode;
v_b xmldom.DOMNode;
v_d xmldom.DOMNode;
v_a xmldom.DOMNodeList;
v_c xmldom.DOMNodeList;
m_prg xmldom.DOMNodeList;
m_pr xmldom.DOMNode;
condf_nl xmldom.DOMNodeList;
condf_n xmldom.DOMNode;
msgdtl_nl xmldom.DOMNodeList;
msgdtl_n xmldom.DOMNode;
rtndbt_nl xmldom.DOMNodeList;
rtndbt_n xmldom.DOMNode;
dnlt_nl xmldom.DOMNodeList;
dnlt_n xmldom.DOMNode;
cancl_nl xmldom.DOMNodeList;
cancl_n xmldom.DOMNode;
conid_nl xmldom.DOMNodeList;
conid_n xmldom.DOMNode;
canclid_nl xmldom.DOMNodeList;
canclid_n xmldom.DOMNode;
par_ref number(10) :=0;
msgnum number(20):=0;
var1 number(30):=0;
rtnnum number(20):=0;
dnnum number(20):=0;
tpmsg number(20):=0;
condfpmt number(20):=0;
canclnum number(20):=0;
--Added the next variable
sequence_no number(20):=0;
--These are the new variables
condfpmt1 number(20):=0;
rtnnum1 number(20):=0;
dnnum1 number(20):=0;
tpmsg1 number(20):=0;
canclnum1 number(20):=0;
--changing
part_refid_value number(20);
parid_typ_n xmldom.DOMNode;
parid_typ_nl xmldom.DOMNodeList;
parid_id_nl xmldom.DOMNodeList;
parid_id_n xmldom.DOMNode;
party_ref_node xmldom.DOMNode;
var_pr_reg_typ VARCHAR2(2);
msgrtdbt_nl xmldom.DOMNodeList;
msgrtdbt_n xmldom.DOMNode;
kndrtdbt_nl xmldom.DOMNodeList;
kndrtdbt_n xmldom.DOMNode;
rsnrtdbt_nl xmldom.DOMNodeList;
rsnrtdbt_n xmldom.DOMNode;
datrtdbt_nl xmldom.DOMNodeList;
datrtdbt_n xmldom.DOMNode;
grssrtdbt_nl xmldom.DOMNodeList;
grssrtdbt_n xmldom.DOMNode;
currtdbt_nl xmldom.DOMNodeList;
currtdbt_n xmldom.DOMNode;
rtnnum2 number(20):=0;
msgdnlt_nl xmldom.DOMNodeList;
msgdnlt_n xmldom.DOMNode;
lvdnlt_nl xmldom.DOMNodeList;
lvdnlt_n xmldom.DOMNode;
datdnlt_nl xmldom.DOMNodeList;
datdnlt_n xmldom.DOMNode;
grsdnlt_nl xmldom.DOMNodeList;
grsdnlt_n xmldom.DOMNode;
curdnlt_nl xmldom.DOMNodeList;
curdnlt_n xmldom.DOMNode;
limdnlt_nl xmldom.DOMNodeList;
limdnlt_n xmldom.DOMNode;
lvimp number(20);
nullchk varchar2(30) ;
chk_flseq number(10);
fl_seq number(30);
--these are the new variables
TYPE tab_type IS TABLE OF FileControl%ROWTYPE;
t_tab_FC tab_type := tab_type();
TYPE tab_type1 IS TABLE OF MessageTab%ROWTYPE;
t_tab1 tab_type1 := tab_type1();
TYPE tab_type2 IS TABLE OF ContractsWithDefaultOfPayment%ROWTYPE;
t_tab2 tab_type2 := tab_type2();
TYPE tab_type3 IS TABLE OF CancellationTab%ROWTYPE;
t_tab3 tab_type3 := tab_type3();
TYPE tab_type4 IS TABLE OF ReturnDebitNoteTab%ROWTYPE;
t_tab4 tab_type4 := tab_type4();
TYPE tab_type5 IS TABLE OF DunningLettersTab%ROWTYPE;
t_tab5 tab_type5 := tab_type5();
cursor MessageCursor is
select * from OM_BSN_STATEMSGS
where PROCESSED is null AND SENT in(Select min(SENT) from OM_BSN_STATEMSGS
where PROCESSED is null)
order by sent asc;
v_statemsgs OM_BSN_STATEMSGS%ROWTYPE;
BEGIN
DBMS_OUTPUT.put_line('creating parser');
-- v_parser := DBMS_XMLPARSER.NEWPARSER;
v_parser := DBMS_XMLPARSER.NEWPARSER();
DBMS_OUTPUT.put_line('done creating');
DBMS_XMLPARSER.setValidationMode(v_parser, true);
DBMS_XMLPARSER.showWarnings(v_parser, true);
open MessageCursor;
loop
fetch MessageCursor into v_statemsgs;
exit when MessageCursor%NOTFOUND;
DBMS_XMLPARSER.PARSECLOB(P => v_parser, DOC => v_statemsgs.MESSAGE);
-- xmlparser.parse(v_parser, File_Location);
v_doc := xmlparser.getDocument(v_parser);
dbms_xmlparser.freeParser(v_parser); DBMS_OUTPUT.put_line('Step 1');
v_nFCL := xslprocessor.selectNodes(xmldom.makeNode(v_doc),'/Statemessages/FileControl');
v_nFCN := xmldom.item(v_nFCL,0);
Source
v_nFCSourceL := xslprocessor.selectNodes(xmldom.makeNode(v_doc),'/Statemessages/FileControl/Source');
v_nFCSourceN := xmldom.item(v_nFCSourceL,0);
Destination
v_nFCDestinationL := xslprocessor.selectNodes(xmldom.makeNode(v_doc),'/Statemessages/FileControl/Destination');
v_nFCDestinationN := xmldom.item(v_nFCDestinationL,0);
-- Populate tab type for ORFC
t_tab_FC.extend;
t_tab_FC(t_tab_FC.last).creation_date := to_date(xslprocessor.valueOf(v_nFCN,'CreationDate'),'YYYY-MM-DD');
t_tab_FC(t_tab_FC.last).src_sys_id := xslprocessor.valueOf(v_nFCSourceN,'SystemID');
t_tab_FC(t_tab_FC.last).src_mandant_id := xslprocessor.valueOf(v_nFCSourceN,'MandantID');
t_tab_FC(t_tab_FC.last).dest_sys_id := xslprocessor.valueOf(v_nFCDestinationN,'SystemID');
t_tab_FC(t_tab_FC.last).dest_mandant_id := xslprocessor.valueOf(v_nFCDestinationN,'MandantID');
t_tab_FC(t_tab_FC.last).seq_no := xslprocessor.valueOf(v_nFCN,'SequenceNumber');
t_tab_FC(t_tab_FC.last).counter := xslprocessor.valueOf(v_nFCN,'Counter');
--Saving the value of this seq_no so that it can be inserted in the message tab.
sequence_no:= xslprocessor.valueOf(v_nFCN,'SequenceNumber');
--Insert into ORFC TAB
fl_seq := xslprocessor.valueOf(v_nFCN,'SequenceNumber');
select count(*) into chk_flseq from FileControl where SEQ_NO =fl_seq;
if (chk_flseq =0) then
FOR each_FC IN t_tab_FC.first .. t_tab_FC.last LOOP
INSERT INTO FileControl
creation_date,
src_sys_id,
src_mandant_id,
dest_sys_id,
dest_mandant_id,
seq_no,
counter)
VALUES
t_tab_FC(each_FC).creation_date,
t_tab_FC(each_FC).src_sys_id ,
t_tab_FC(each_FC).src_mandant_id,
t_tab_FC(each_FC).dest_sys_id,
t_tab_FC(each_FC).dest_mandant_id,
t_tab_FC(each_FC).seq_no,
t_tab_FC(each_FC).counter
END LOOP;
end if;
DBMS_OUTPUT.put_line('Step 2');
if (chk_flseq =0) then /* chk the xml's filecontrol seq exists in filecontrltab */
-- Use XPATH syntax to assign values to he elements of the collection.
v_nl := xslprocessor.selectNodes(xmldom.makeNode(v_doc),'/Statemessages/Message');
tpmsg := xmldom.getLength(v_nl);
DBMS_OUTPUT.put_line('Message node length'||tpmsg);
if (tpmsg>0) then
FOR cur_emp IN 0 .. xmldom.getLength(v_nl) - 1 LOOP
v_n := xmldom.item(v_nl, cur_emp);
select (BISON_OM_MessageID.NEXTVAL) into var1 from dual;
t_tab1.extend;
t_tab1(t_tab1.last).message_id := var1;
t_tab1(t_tab1.last).seq_no := sequence_no;
---party reg
m_prg := xslprocessor.selectNodes(v_n,'PartyRegistrationID');
FOR Ref_Id_Loop IN 0 .. xmldom.getLength(m_prg) - 1 LOOP
party_ref_node := xmldom.item(m_prg,0);
part_refid_value := xslprocessor.valueOf(party_ref_node,'.');
end loop;
m_pr := xmldom.item(m_prg, 0);
--changing
--chang id
parid_id_nl := xslprocessor.selectNodes(m_pr,'ID');
DBMS_OUTPUT.put_line('Going to read PartyRegistrationID');
FOR cur_parid_id IN 0 .. xmldom.getLength(parid_id_nl) - 1 LOOP
parid_id_n := xmldom.item(parid_id_nl,cur_parid_id);
DBMS_OUTPUT.put_line('Value of id:'|| xslprocessor.valueOf(parid_id_n,'.'));
t_tab1(t_tab1.last).party_ref_id := xslprocessor.valueOf(parid_id_n,'.');
exit;
end loop ;
---- change id
parid_typ_nl := xslprocessor.selectNodes(m_pr,'Type');
FOR cur_parid_typ IN 0 .. xmldom.getLength(parid_typ_nl) - 1 LOOP
parid_typ_n := xmldom.item(parid_typ_nl,cur_parid_typ);
var_pr_reg_typ := xslprocessor.valueOf(parid_typ_n,'.');
if var_pr_reg_typ='RG' then
t_tab1(t_tab1.last).PARTY_REG_TYPE_RG := var_pr_reg_typ;
elsif var_pr_reg_typ='AG' then
t_tab1(t_tab1.last).PARTY_REG_TYPE_AG := var_pr_reg_typ;
end if;
end loop;
--Chang
-- t_tab1(t_tab1.last).PARTY_REG_TYPE_AG := xslprocessor.valueOf(m_pr,'Type');
par_ref :=xslprocessor.valueOf(m_pr,'ID');
t_tab1(t_tab1.last).customer_grp_id := xslprocessor.valueOf(v_n,'CustomerGroupID');
t_tab1(t_tab1.last).name := xslprocessor.valueOf(v_n,'Name');
t_tab1(t_tab1.last).subname := xslprocessor.valueOf(v_n,'Subname');
t_tab1(t_tab1.last).datetime := xslprocessor.valueOf(v_n,'DateTime');
DBMS_OUTPUT.put_line('Step 3 ContractsWithDefaultOfPayment');
m_nl := xslprocessor.selectNodes(v_n,'DefaultOfPayment');
m_n := xmldom.item(m_nl, 0);
t_tab1(t_tab1.last).payment_msg_id := xslprocessor.valueOf(m_n,'MessageID');
t_tab1(t_tab1.last).gross_amt_before := xslprocessor.valueOf(m_n,'GrossAmountBefore');
t_tab1(t_tab1.last).gross_amt_current := xslprocessor.valueOf(m_n,'GrossAmountCurrent');
t_tab1(t_tab1.last).currency := xslprocessor.valueOf(m_n,'Currency');
t_tab1(t_tab1.last).settlemen_of_balance := xslprocessor.valueOf(m_n,'SettlementOfBalance');
t_tab1(t_tab1.last).including_subsidiary_claim := xslprocessor.valueOf(m_n,'IncludingSubsidiaryClaim');
condf_nl := xslprocessor.selectNodes(v_n,'ContractsWithDefaultOfPayment');
condf_n := xmldom.item(condf_nl,0);
condfpmt := xmldom.getLength(condf_nl);
if (condfpmt > 0) then
conid_nl := xslprocessor.selectNodes(condf_n,'ContractID');
FOR cur_conid IN 0 .. xmldom.getLength(conid_nl) - 1 LOOP
conid_n := xmldom.item(conid_nl,cur_conid);
t_tab2.extend;
t_tab2(t_tab2.last).message_id := var1;
t_tab2(t_tab2.last).contract_id := xslprocessor.valueOf(conid_n,'.');
end loop;
condfpmt1 := 1;
end if;
cancl_nl := xslprocessor.selectNodes(v_n,'Cancellation');
cancl_n := xmldom.item(cancl_nl,0);
DBMS_OUTPUT.put_line('No of cancellations'||xmldom.getLength(cancl_nl) );
canclnum := xmldom.getLength(cancl_nl) ;
if (canclnum > 0) then
canclid_nl := xslprocessor.selectNodes(cancl_n,'MessageID');
FOR cur_canclid IN 0 .. xmldom.getLength(canclid_nl) - 1 LOOP
canclid_n := xmldom.item(canclid_nl,cur_canclid);
t_tab3.extend;
t_tab3(t_tab3.last).message_id := var1;
t_tab3(t_tab3.last).cancellation_msg_id := xslprocessor.valueOf(canclid_n,'.');
end loop;
canclnum1 :=1;
end if; -- canclnum
msgdtl_nl := xslprocessor.selectNodes(v_n,'Messagedetails');
msgnum := xmldom.getLength(msgdtl_nl) ;
dbms_output.put_line('msgggg::::'||msgnum);
if (msgnum >0) then
msgdtl_n := xmldom.item(msgdtl_nl,0);
rtndbt_nl := xslprocessor.selectNodes(msgdtl_n,'ReturnDebitNote');
rtndbt_n := xmldom.item(rtndbt_nl,0);
rtnnum := xmldom.getLength(rtndbt_nl) ;
if (rtnnum >0) then
--return debit note
msgrtdbt_nl := xslprocessor.selectNodes(rtndbt_n,'MessageID');
kndrtdbt_nl := xslprocessor.selectNodes(rtndbt_n,'KindOf');
rsnrtdbt_nl := xslprocessor.selectNodes(rtndbt_n,'Reason');
datrtdbt_nl := xslprocessor.selectNodes(rtndbt_n,'Date');
grssrtdbt_nl := xslprocessor.selectNodes(rtndbt_n,'GrossAmount');
currtdbt_nl := xslprocessor.selectNodes(rtndbt_n,'Currency');
rtnnum2 :=0;
FOR cur_msgrtndbt IN 0 .. xmldom.getLength(msgrtdbt_nl) - 1 LOOP
msgrtdbt_n := xmldom.item(msgrtdbt_nl,cur_msgrtndbt);
kndrtdbt_n := xmldom.item(kndrtdbt_nl,cur_msgrtndbt);
rsnrtdbt_n := xmldom.item(rsnrtdbt_nl,cur_msgrtndbt);
datrtdbt_n := xmldom.item(datrtdbt_nl,cur_msgrtndbt);
grssrtdbt_n := xmldom.item(grssrtdbt_nl,cur_msgrtndbt);
currtdbt_n := xmldom.item(currtdbt_nl,cur_msgrtndbt);
t_tab4.extend;
t_tab4(t_tab4.last).message_id := var1;
t_tab4(t_tab4.last).ret_debitnote_msg_id := xslprocessor.valueOf(msgrtdbt_n,'.');
t_tab4(t_tab4.last).kind_of := xslprocessor.valueOf(kndrtdbt_n,'.');
t_tab4(t_tab4.last).Reason := xslprocessor.valueOf(rsnrtdbt_n,'.');
t_tab4(t_tab4.last).debit_note_date := to_date(xslprocessor.valueOf(datrtdbt_n,'.'),'YYYY-MM-DD');
t_tab4(t_tab4.last).gross_amt := xslprocessor.valueOf(grssrtdbt_n,'.');
t_tab4(t_tab4.last).currency := xslprocessor.valueOf(currtdbt_n,'.');
rtnnum1 :=rtnnum1 + 1;
rtnnum2 := rtnnum2 + 1;
dbms_output.put_line('message_id::::'||var1);
dbms_output.put_line('rtnnum2::::'||rtnnum2);
dbms_output.put_line('ret_debitnote_msg_id:::'||t_tab4(t_tab4.last).ret_debitnote_msg_id);
end loop;
----return debit note
t_tab4(t_tab4.last).message_id := var1 ;
t_tab4(t_tab4.last).ret_debitnote_msg_id := xslprocessor.valueOf(rtndbt_n,'MessageID');
t_tab4(t_tab4.last).kind_of := xslprocessor.valueOf(rtndbt_n,'KindOf');
t_tab4(t_tab4.last).reason := xslprocessor.valueOf(rtndbt_n,'Reason');
t_tab4(t_tab4.last).debit_note_date := to_date(xslprocessor.valueOf(rtndbt_n,'Date'),'YYYY-MM-DD');
t_tab4(t_tab4.last).gross_amt := xslprocessor.valueOf(rtndbt_n,'GrossAmount');
t_tab4(t_tab4.last).currency := xslprocessor.valueOf(rtndbt_n,'Currency');
rtnnum1 :=1;
end if;
dnlt_nl := xslprocessor.selectNodes(msgdtl_n,'DunningLetter');
dnlt_n := xmldom.item(dnlt_nl, 0);
dnnum := xmldom.getLength(dnlt_nl) ;
if (dnnum >0) then
-- t_tab5.extend;
--dunning letter
msgdnlt_nl := xslprocessor.selectNodes(dnlt_n,'MessageID');
lvdnlt_nl := xslprocessor.selectNodes(dnlt_n,'Level');
datdnlt_nl := xslprocessor.selectNodes(dnlt_n,'Date');
grsdnlt_nl := xslprocessor.selectNodes(dnlt_n,'GrossAmount');
curdnlt_nl := xslprocessor.selectNodes(dnlt_n,'Currency');
limdnlt_nl := xslprocessor.selectNodes(dnlt_n,'LevelImprovement');
FOR cur_msgdnlt IN 0 .. xmldom.getLength(msgdnlt_nl) - 1 LOOP
msgdnlt_n := xmldom.item(msgdnlt_nl,cur_msgdnlt);
lvdnlt_n := xmldom.item(lvdnlt_nl,cur_msgdnlt);
datdnlt_n := xmldom.item(datdnlt_nl,cur_msgdnlt);
grsdnlt_n := xmldom.item(grsdnlt_nl,cur_msgdnlt);
curdnlt_n := xmldom.item(curdnlt_nl,cur_msgdnlt);
limdnlt_n := xmldom.item(limdnlt_nl,cur_msgdnlt);
t_tab5.extend;
t_tab5(t_tab5.last).message_id := var1;
t_tab5(t_tab5.last).dunning_msg_id := xslprocessor.valueOf(msgdnlt_n,'.');
t_tab5(t_tab5.last).d_level := xslprocessor.valueOf(lvdnlt_n,'.');
t_tab5(t_tab5.last).dunning_date := to_date(xslprocessor.valueOf(datdnlt_n,'.'),'YYYY-MM-DD');
t_tab5(t_tab5.last).gross_amt := xslprocessor.valueOf(grsdnlt_n,'.');
t_tab5(t_tab5.last).currency := xslprocessor.valueOf(curdnlt_n,'.');
lvimp := xmldom.getLength(limdnlt_nl);
begin
t_tab5(t_tab5.last).level_improvement := xslprocessor.valueOf(limdnlt_n,'.');
EXCEPTION
WHEN OTHERS THEN
t_tab5(t_tab5.last).level_improvement := null;
end;
dnnum1 :=dnnum1 + 1;
-- dnnum2 := dnnum2 + 1;
dbms_output.put_line('message_id::::'||var1);
end loop;
----dunning letter
t_tab5(t_tab5.last).message_id := var1;
t_tab5(t_tab5.last).dunning_msg_id := xslprocessor.valueOf(dnlt_n,'MessageID');
t_tab5(t_tab5.last).d_level := xslprocessor.valueOf(dnlt_n,'Level');
t_tab5(t_tab5.last).dunning_date := to_date(xslprocessor.valueOf(dnlt_n,'Date'),'YYYY-MM-DD');
t_tab5(t_tab5.last).gross_amt := xslprocessor.valueOf(dnlt_n,'GrossAmount');
t_tab5(t_tab5.last).currency := xslprocessor.valueOf(dnlt_n,'Currency');
t_tab5(t_tab5.last).level_improvement := xslprocessor.valueOf(dnlt_n,'LevelImprovement');
dnnum1 :=1; */
end if;
end if;
END LOOP;
-- Insert data into the real EMP table from the table collection.
-- Form better performance multiple collections should be used to allow
-- bulk binding using the FORALL construct but this would make the code
-- too long-winded for this example.
DBMS_OUTPUT.put_line('Step 5');
FOR cur_emp IN t_tab1.first .. t_tab1.last LOOP
INSERT INTO MessageTab
message_id,
PARTY_REF_ID,
PARTY_REG_TYPE_AG,
party_reg_type_rg,
customer_grp_id,
name,
subname,
datetime,
payment_msg_id,
gross_amt_before,
gross_amt_current,
currency,
settlemen_of_balance,
including_subsidiary_claim,
seq_no)
VALUES
t_tab1(cur_emp).message_id,
t_tab1(cur_emp).PARTY_REF_ID,
t_tab1(cur_emp).PARTY_REG_TYPE_AG,
t_tab1(cur_emp).PARTY_REG_TYPE_RG,
t_tab1(cur_emp).customer_grp_id,
t_tab1(cur_emp).name,
t_tab1(cur_emp).subname,
t_tab1(cur_emp).datetime,
t_tab1(cur_emp).payment_msg_id,
t_tab1(cur_emp).gross_amt_before,
t_tab1(cur_emp).gross_amt_current,
t_tab1(cur_emp).currency,
t_tab1(cur_emp).settlemen_of_balance,
t_tab1(cur_emp).including_subsidiary_claim,
t_tab1(cur_emp).seq_no
END LOOP;
DBMS_OUTPUT.put_line('Step 6');
if (condfpmt1 > 0) then
FOR cur_cnf IN t_tab2.first .. t_tab2.last LOOP
INSERT INTO ContractsWithDefaultOfPayment
(message_id,contract_id)
values
(t_tab2(cur_cnf).message_id,t_tab2(cur_cnf).contract_id );
end loop;
end if; -- condfpmt
if (canclnum1 > 0) then
FOR cur_cancl IN t_tab3.first .. t_tab3.last LOOP
INSERT INTO CancellationTab
(message_id,cancellation_msg_id)
VALUES
(t_tab3(cur_cancl).message_id,t_tab3(cur_cancl).cancellation_msg_id);
END LOOP;
end if;
DBMS_OUTPUT.put_line('Step 7');
if (rtnnum1 >0) then
FOR cur_rtndb IN t_tab4.first .. t_tab4.last LOOP
INSERT INTO ReturnDebitNoteTab
(message_id,
ret_debitnote_msg_id,
kind_of,
reason,
debit_note_date,
gross_amt,
currency
VALUES
(t_tab4(cur_rtndb).message_id,
t_tab4(cur_rtndb).ret_debitnote_msg_id,
t_tab4(cur_rtndb).kind_of,
t_tab4(cur_rtndb).reason,
t_tab4(cur_rtndb).debit_note_date,
t_tab4(cur_rtndb).gross_amt,
t_tab4(cur_rtndb).currency);
END LOOP;
end if;
if (dnnum1 >0) then
FOR cur_dnl IN t_tab5.first .. t_tab5.last LOOP
INSERT INTO DunningLettersTab
(message_id,
dunning_msg_id,
d_level,
dunning_date,
gross_amt,
currency,
level_improvement)
VALUES
(t_tab5(cur_dnl).message_id,
t_tab5(cur_dnl).dunning_msg_id,
t_tab5(cur_dnl).d_level,
t_tab5(cur_dnl).dunning_date,
t_tab5(cur_dnl).gross_amt,
t_tab5(cur_dnl).currency,
t_tab5(cur_dnl).level_improvement
END LOOP;
DBMS_OUTPUT.put_line('Step 8');
end if; -- dnn
end if; -- top msg
end if; --- fl_seq chk
COMMIT;
-- Free any resources associated with the document now it
-- is no longer needed.
xmldom.freeDocument(v_doc);
/* refresh array */
t_tab_FC.delete;
t_tab1.delete;
t_tab2.delete;
t_tab3.delete;
t_tab4.delete;
t_tab5.delete;
/* refsh */
end loop;
close MessageCursor;
END ;
//Errors thrown by Oracle always show a line number (even if it points to the FOR loop that the error occurred within). When you run it, what is the error stack that is being returned. Copy and paste that, don't summarize it.
If you are still uncertain, add a final
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line(DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);to have it written out where your normal dbms_output goes. This is your friend in 10g for tracking down errors.
"But as soon as i add a prefix in the header everything works fine."
Is that header in the sample XML you provided? Regardless what are you adding? Your data is a clob so you can always tweak it before converting it to a DOMDocument just by doing simple string manipulation.
Since you are in 10g, you should be using dbms_xmldom instead of xmldom. I think xmldom is just a synonym for dbms_xmldom though. Review the dbms_xmldom documentation. You can go straight from a clob to a DOMDocument via DBMS_XMLDOM.NEWDOMDOCUMENT. You can also parse the document completely using dbms_xmldom calls instead of xslprocessor calls.
Other random things to evaluate:
Consider turning
FOR each_FC IN t_tab_FC.first .. t_tab_FC.last LOOP
INSERT INTO FileControl
into a
FORALL i IN t_tab_FC.first .. t_tab_FC.last LOOP
INSERT INTO FileControl
...Better performance because one two context switches (PL/SQL -> SQL -> PL/SQL) instead of 2*n switches.
I like this construct better
TYPE tab_type IS TABLE OF FileControl%ROWTYPE INDEX BY BINARY_INTEGER;
t_tab_FC tab_type := tab_type;because then you don't have to t_tab_FC.extend;you can just do something like index := 1;
LOOP
t_tab_FC(index).creation_date := <whatever>;
index := index + 1;
END LOOPYou also have the option of parsing your XML as a XMLType, including purely in SQL, but you can research that avenue at a later date.
Forgot to mention, wrap any code examples in [ pre ] [ pre ] (without the spaces) to retain your formatting. -
Python script to parse 'iwlist scan' into a table
Hi,
I've written a small python script that parses the output of the command "iwlist interface scan" into a table.
Why ?
Like many arch linux users I think, I use netcfg instead of something like network manager or wicd. So the most natural way to scan for wifi networks in range is iwlist scan. But the output of this command is huge and I find it difficult to retrieve information. So this script parses it into a table : one network, one line.
Example output
Name Address Quality Channel Encryption
wifi_1 01:23:45:67:89:AB 100 % 11 WPA v.1
wifi_2 01:23:45:67:89:AC 76 % 11 WEP
wifi_3 01:23:45:67:89:AD 51 % 11 Open
wifi_4 01:23:45:67:89:AE 50 % 11 WPA v.1
wifi_5 01:23:45:67:89:AF 43 % 4 Open
wifi_6 01:23:45:67:89:AG 43 % 4 WPA v.1
Details
It reads from stdin so you use it like that: iwlist wlan0 scan | iwlistparse.py
The width of the columns is determined by what's in it.
You can easily do a bit more than just parsing the info: in the example above, the quality has been calculated to percents from a ratio (e.g. 46/70).
It is sorted, too.
Customization
It's python so it's easy to customize. See the comments in the code.
Code
#!/usr/bin/env python
# iwlistparse.py
# Hugo Chargois - 17 jan. 2010 - v.0.1
# Parses the output of iwlist scan into a table
import sys
# You can add or change the functions to parse the properties of each AP (cell)
# below. They take one argument, the bunch of text describing one cell in iwlist
# scan and return a property of that cell.
def get_name(cell):
return matching_line(cell,"ESSID:")[1:-1]
def get_quality(cell):
quality = matching_line(cell,"Quality=").split()[0].split('/')
return str(int(round(float(quality[0]) / float(quality[1]) * 100))).rjust(3) + " %"
def get_channel(cell):
return matching_line(cell,"Channel:")
def get_encryption(cell):
enc=""
if matching_line(cell,"Encryption key:") == "off":
enc="Open"
else:
for line in cell:
matching = match(line,"IE:")
if matching!=None:
wpa=match(matching,"WPA Version ")
if wpa!=None:
enc="WPA v."+wpa
if enc=="":
enc="WEP"
return enc
def get_address(cell):
return matching_line(cell,"Address: ")
# Here's a dictionary of rules that will be applied to the description of each
# cell. The key will be the name of the column in the table. The value is a
# function defined above.
rules={"Name":get_name,
"Quality":get_quality,
"Channel":get_channel,
"Encryption":get_encryption,
"Address":get_address,
# Here you can choose the way of sorting the table. sortby should be a key of
# the dictionary rules.
def sort_cells(cells):
sortby = "Quality"
reverse = True
cells.sort(None, lambda el:el[sortby], reverse)
# You can choose which columns to display here, and most importantly in what order. Of
# course, they must exist as keys in the dict rules.
columns=["Name","Address","Quality","Channel","Encryption"]
# Below here goes the boring stuff. You shouldn't have to edit anything below
# this point
def matching_line(lines, keyword):
"""Returns the first matching line in a list of lines. See match()"""
for line in lines:
matching=match(line,keyword)
if matching!=None:
return matching
return None
def match(line,keyword):
"""If the first part of line (modulo blanks) matches keyword,
returns the end of that line. Otherwise returns None"""
line=line.lstrip()
length=len(keyword)
if line[:length] == keyword:
return line[length:]
else:
return None
def parse_cell(cell):
"""Applies the rules to the bunch of text describing a cell and returns the
corresponding dictionary"""
parsed_cell={}
for key in rules:
rule=rules[key]
parsed_cell.update({key:rule(cell)})
return parsed_cell
def print_table(table):
widths=map(max,map(lambda l:map(len,l),zip(*table))) #functional magic
justified_table = []
for line in table:
justified_line=[]
for i,el in enumerate(line):
justified_line.append(el.ljust(widths[i]+2))
justified_table.append(justified_line)
for line in justified_table:
for el in line:
print el,
print
def print_cells(cells):
table=[columns]
for cell in cells:
cell_properties=[]
for column in columns:
cell_properties.append(cell[column])
table.append(cell_properties)
print_table(table)
def main():
"""Pretty prints the output of iwlist scan into a table"""
cells=[[]]
parsed_cells=[]
for line in sys.stdin:
cell_line = match(line,"Cell ")
if cell_line != None:
cells.append([])
line = cell_line[-27:]
cells[-1].append(line.rstrip())
cells=cells[1:]
for cell in cells:
parsed_cells.append(parse_cell(cell))
sort_cells(parsed_cells)
print_cells(parsed_cells)
main()
I hope you find it useful. Please report bugs, I haven't tested it a lot. You may have to customize it though, because I think not all iwlist scan outputs are the same. Again, see comments, it should be easy.This tool is very helpfull. I am trying to add a new function to the existing code to parse the signal level parameter from the output of iwlist wlan0 scan, but I am getting lot of issues .Since I am new to python script can anyone help me to extract the signal level also from the scan put put.
The parametr to be used is Signal level=-44 dBm ,I am trying to create a one more column with Signal level and print its out in the table.
Example:-
Signal level
-44db
The error I am getting
File "iwlist_parser_Testing.py", line 146, in <module>
main()
File "iwlist_parser_Testing.py", line 144, in main
print_cells(parsed_cells)
File "iwlist_parser_Testing.py", line 123, in print_cells
print_table(table)
File "iwlist_parser_Testing.py", line 102, in print_table
widths=map(max,map(lambda l:map(len,l),zip(*table))) #functional magic
File "iwlist_parser_Testing.py", line 102, in <lambda>
widths=map(max,map(lambda l:map(len,l),zip(*table))) #functional magic
TypeError: object of type 'NoneType' has no len()
Could some pls help me to solve this issue
Thanks -
How do i change xml schema in java
i want to change a oracle.xml.parser.schema.xmlschema object in java (adding or changing elements, types, etc). is there some hidden way i didn't think of besides changing the xmldocument object behind the schema and rebuilding the schema? i find that rather uncomfortable.
i'd appreciate any answers, even negative ones :)
thanksRefer to
http://java.sun.com/webservices/docs/1.1/tutorial/doc/JAXPDOM9.html -
Hello all,
I am on my fourthRoboHelp8 HTML project, after the other three crashed. I am a technical writer constructing my companies Policy and Procedures Guide. I am only 142 (word documents) and 9 (RoboHelp topics) into my project and there will be plenty more to come. I recently took Kevin Siegel's RoboHelp8 class where I determined that it would be best if I link all of my word documents inside of the Project Manager becuase I will be constantly updating these documents. I've searched around the Adobe Forums, talked to Kevin, and talked to my IT Department, but I cannot seem to find an answer for my problem.
I have linked all of 142 word documents inside of the Project Manager, and all 142 word documents have their own .css stylesheet. I have assigned the default.css stylesheet (which I have assigned all of the proper formatting to headings 1-4 to match headings 1-4 inside of my Microsoft Word 2007 documents) under Project Settings under the Import tab. I also assigned this default.css stylesheet under WebHelp Pro. My understanding with applying the default.css stylesheet to these two places is that all of my word documents and topics should have this stylesheet applied to them.
However, when I look at each individual linked word document the default stylesheet has not been assigned and the word document is still being dictated by its own stylesheet i.e. Credit.css. On my third project, before it crashed, I manually went through all 142 word documents in the Project Manager and assigned the default.css stylesheet to them. I did this by right clicking on the topic, under Appearance, I changed the stylesheet i.e. Credit.css to default.css and clicked apply. I was immediately prompted with the two options: "Preserve modifications to this file" or "Don't show me this message again." I tried both options. The first applied the default.css stylesheet and removed the Credit.css stylesheet, but when I made a change inside of my word document and updated it inside of the Project Manager none of my changes appeared. The second did not apply the default.css stylesheet and kept my Credit.css stylesheet applied to my word document. When I made a change inside of my word document and updated it inside of the Project Manager the change appeared.
I talked about this to Kevin and he said that the individual stylesheet applied to each linked word document did not mean anything, essentially that by making the default.css stylesheet the dominant stylesheet under Project Settings under Import that the stylesheet would be applied to all of my linked word documents/topics. He also suggested that I make a change to the stylesheet like change the color of Heading 1 and link a new word document to see if it applied the changes. I tried doing this inside of my third project, but nothing changed.
I would like to know if I can assign one stylesheet to all of my linked word documents before I get too far into the fourth project and have that project crash on me too. One of RoboHelp's appealing features is to apply one stylesheet to multiple topics, or in my case 142 word documents and 9 topics. I hope that I can apply one stylesheet to all of these linked word documents because having 142 individual stylesheets is unmanageable.
Any help or suggestions would be greatly appreciated.
Thank you,
RoxxanneWhen a word document is imported into RoboHelp project, RoboHelp generates a separate stylesheet for each word document as each word document may have its own formatting styles. In a generic scenario, word documents may be brought from different sources and may have different styling. Hence, RoboHelp allows users to preserve different styling through sepearate stylesheets.
However, for a different scenario like yours, RoboHelp allows users to override all the CSS and apply a single CSS to all the topics at the generation of output. As you have already mentioned that you have applied default.css in the WebHelp Pro SSL dialog, that should suffice and should meet your requirement of applying a single CSS to all the topics. You can verify the same at your end by linking few word files and generating the output with a single CSS applied in the SSL settings.
Mayank
Maybe you are looking for
-
Trying to connect to Oracle using Web App
Hi Guys, I'm hoping someone here can help. This question goes out to anyone who has tried to connect to an Oracle database via web application written using Java Server Pages and Servlets. There is a specific file called the context.xml that contains
-
Firefox will crash every time I try to open it. It then opens in safe mode. I have reset it and restarted the computer and it still crashes. I have sent over 127 crash reports in December alone. I have tried to reinstall but it stops and says it cann
-
Adding "more" slices to already sliced html
Hi there, basically, i've created a web page with a sliced photoshop page. but now I need to add an extra button. Is there any way I can use the already sliced page in dreamweaver and and just add a couple more slices done in photoshop? Obviously, I
-
We are selling from the US to Canada: - from US - sold to in the US - ship to in Canada The system does not determine MWST in the sales order, although the tax codes in FI have been set up for the two countries. Any idea? Kind regards, Rudolf
-
Hi there, I'm wondering if the Nikon D5100 will be working with LR 4 in the near future? I took a course over the summer and purchased the software. I'd love to use the tether feature but it isn't listed as supported yet. Thanks! Elizabeth