If statement with xml?
I'd like to have a checkmark (image) show up if a certain
value shows up in my dataset. For example, if the column Status has
the value "Quote" I'd like to have an img show up, otherwise that
column in the table would be blank. I was able to easily do this
with php but now moving to spry/xml, i'm sort of lost. can someone
code me in the right direction?
Hi,
you can use spry:if attribute to display the data only if a
condition passes. On this
data
api page you can find some samples of how to do this using
spry:if attribute. (Go to Spry Region panel-> spry:if).
Please let us know if you have other questions,
Diana
Similar Messages
-
Error while creating AW using DBMS_LOB with XML..
Hi All,
I am trying to create AW using DBMS_LOB package with XML,
while creating AW,i am facing the following error.find the code also below :
declare
xml_awcreate_clob clob;
xml_awcreate_st varchar2(4000);
begin
DBMS_LOB.CREATETEMPORARY(xml_awcreate_clob,TRUE);
dbms_lob.open(xml_awcreate_clob, DBMS_LOB.LOB_READWRITE);
dbms_lob.writeappend(xml_awcreate_clob, 48, '<?xml version = ''1.0'' encoding = ''UTF-8'' ?>');
dbms_lob.writeappend(xml_awcreate_clob, 43, '');
dbms_lob.writeappend(xml_awcreate_clob, 63, '<AWXML version = ''1.0'' timestamp = ''Mon Feb 11 13:29:11 2002'' >');
dbms_lob.writeappend(xml_awcreate_clob, 15, '<AWXML.content>');
dbms_lob.writeappend(xml_awcreate_clob, 25, ' <Create Id="Action41">');
dbms_lob.writeappend(xml_awcreate_clob, 19, ' <ActiveObject >');
dbms_lob.writeappend(xml_awcreate_clob, 163, ' <AW Name="NEW_XML_AW" LongName="NEW_XML_AW" ShortName="NEW_XML_AW" PluralName="NEW_XML_AW" Id="NEW_XML.AW"/>');
dbms_lob.writeappend(xml_awcreate_clob, 19, ' </ActiveObject>');
dbms_lob.writeappend(xml_awcreate_clob, 11, ' </Create>');
dbms_lob.writeappend(xml_awcreate_clob, 16, '</AWXML.content>');
dbms_lob.writeappend(xml_awcreate_clob, 8, '</AWXML>');
dbms_lob.close(xml_awcreate_clob);
xml_awcreate_st := sys.interactionExecute(xml_awcreate_clob);
end;
ORA-21560: argument 2 is null, invalid, or out of range
ORA-06512: at "SYS.DBMS_LOB", line 833
ORA-06512: at line 12
Any idea or thought on this would be appreciable.
Thanks in advance.
AnwarDid you change any of the text in the lob write statements ?
I believe you get this error if you increase the number of characters without increasing the 1st argument which looks as though it represents the number of characters -
Folks
I need to separate SQL statements from Java Code, How do i put these SQL Statements in an XML file and how to access these SQL statements from a Java code,
Any help with sample code is greatful,The use of entities as kstc_jyu may help. It really depends on how you design the XML vocabulary based on the expected usage (e.g., if the SQL statements change very often).
Back to the original question, I am right to interpret "how to use SQL statements in XML ?" as how to design an XML vocabulary to store SQL statements?
If not, you can simply use the scheme proposed by DrClap. Reading and extracting the SQL statement would be just as you would with any other XML document. Google for a Java XML tutorial. -
Folks
I need to separate SQL statements from Java Code, How do i put these SQL Statements in an XML file and how to access these SQL statements from a Java code,
Any help with sample code is greatful,
thanks
mathewI looked it and they support only Perl now, Infact i saw some questions posted in some forums about having SQL statements in XML, but i am not able to get that information,Let me know if you can get any information,
thanks
KM -
I am facing a new problem with xml schema, plz help me
Hi @,
I am facing a problem with xml schema validation. Below is my code.
public void initialize(String cfgFileName) {
try {
try {
DOMParserWrapper parser = (DOMParserWrapper)Class.forName("dom.wrappers.DOMParser").newInstance();
parser.setFeature( "http://apache.org/xml/features/dom/defer-node-expansion",true );
parser.setFeature( "http://xml.org/sax/features/validation",true);
parser.setFeature( "http://xml.org/sax/features/namespaces",true );
parser.setFeature( "http://apache.org/xml/features/validation/schema",true );
parser.setFeature( "http://apache.org/xml/features/validation/schema-full-checking",true );
Document document = parser.parse(cfgFileName);
System.out.println("Vijay .. code .. damar\n");
}catch (org.xml.sax.SAXParseException spe) {
} catch (org.xml.sax.SAXNotRecognizedException ex ){
} catch (org.xml.sax.SAXNotSupportedException ex ){
} catch (org.xml.sax.SAXException se) {
if (se.getException() != null)
se.getException().printStackTrace(System.err);
else
se.printStackTrace(System.err);
}catch (Exception e) {
System.out.println("Caught unknown exception : \n");
e.printStackTrace(System.err);
System.out.println("Vijay .. code .. success\n");
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
//docBuilder.setErrorHandler(myErrorHandler);
cfg = docBuilder.parse(new File(cfgFileName));
cfg .getDocumentElement ().normalize ();
} catch (Exception e) {
e.printStackTrace();
In the above code I am parsing the xml file and i am doing schema validation. Schema validation is proper and it is validating correctly. Only problem is that, It is validating and showing error correctly correctly but it is not catching that error.
For clear understanding I am printing one statement before parsing and after parsing.
SYSTEM.OUT.PRINTLN("Vijay .. code .. damar\n") this is before parsing
SYSTEM.OUT.PRINTLN("Vijay .. code .. success\n") this is after parsing
Here what is happening means, It is validating correctly and showing error :
[Error] nw_layout-new.xml:800:97: Datatype error: Value 'y' does not match regular expression facet 'yes|no'..
Vijay .. code .. damar
Vijay .. code .. success
Here it is showing error and still continueing not catching.
Plz give solution for this.
Thanks
vijay KHello dipthebe,
Check out the articles below go through troubleshooting steps for your iPhone when the screen is unresponsive. You may want to try and restore your iPhone as a new device and then test out what happens when you miss a call to see if the issue is still present afterwards.
iPhone, iPad, iPod touch: Troubleshooting touchscreen response
http://support.apple.com/kb/ts1827
Use iTunes to restore your iOS device to factory settings
http://support.apple.com/kb/HT1414
Regards,
-Norm G. -
SAXException: PI names starting with 'xml' are reserved.
Has anyone run across a problem trying to parse an xml instance (in this case it's an XSL style sheet) using Oracle's parsers? I'm getting the following sax error message:
SAXException : oracle.xml.parser.v2.XMLParseException: PI names starting with 'xml' are reserved. detailed SAX exception message: PI names starting with 'xml' are reserved.
The code generating this error is:
XMLDocument xml = ParseDocument(xmlDoc, parser);
private static XMLDocument ParseDocument(String documentStream,
DOMParser parser)
XMLDocument returnXML = null;
try
parser.parse(new InputSource(new ByteArrayInputStream(documentStream.getBytes())));
returnXML = parser.getDocument();
catch (SAXException saxE)
System.err.println("SAXException : " + saxE + " detailed SAX exception message: " + saxE.getMessage()); // this is the statement generating the error message
catch (IOException e)
System.err.println("IOEx, Parse failed : " + e);
catch (Exception e)
System.err.println("Ex, Parse failed : " + e);
return returnXML;
Thanks in advance for any help you can provide.
Sincerely,
Timlv_clob is invalid, there are two
<?xml version="1.0" encoding="UTF-8"?> elements, remove one of them.
SQL> DECLARE
2 lv_clob CLOB:=EMPTY_CLOB();
3 ignore boolean;
4 BEGIN
5 lv_clob := '<?xml version="1.0" encoding="UTF-8"?>
6 <!ELEMENT firstname (#PCDATA)* >
7
8 <!-- Element function -->
9 <!ELEMENT function (#PCDATA | noteref)* >
10 <!ATTLIST function xml:lang (de | en | fr | la | nl) #IMPLIED >
11
12 <!-- Element initials -->
13 <!ELEMENT initials (#PCDATA)* >
14
15 <!-- Element lastname -->
16 <!ELEMENT lastname (#PCDATA)* >
17
18 <!-- Element structured-author -->
19 <!ELEMENT structured-author ( (firstname, initials? , lastname , function*) ) >
20 <!ATTLIST structured-author ID ID #IMPLIED anchor:name CDATA #IMPLIED > ';
21
22 ignore := dbms_xdb.createResource(abspath => '/structured-author.dtd',data => lv_clob);
23
24 commit;
25 END;
26 /
PL/SQL procedure successfully completed.
SQL> INSERT INTO xml_tst VALUES ('<?xml version="1.0" encoding="utf-8"?>
2 <!--ArborText, Inc., 1988-2002, v.4002-->
3 <!DOCTYPE structured-author PUBLIC "-//WKB//DTD SL author//EN" "structured-author.dtd" [
4 ]>
5 <structured-author ID="SL3654393">
6 <?Pub Caret1?>
7 <firstname>firstname</firstname>
8 <initials>initial</initials>
9 <lastname>lastname</lastname>
10 <function xml:lang="nl">function description in dutch</function>
11 <function xml:lang="fr">function description in french</function>
12 </structured-author>');
1 row created.
SQL> spool off; -
Update statement with joining other tables
Hi ,
I have two table one is containing xml file , basically i need to read from those xml file then update to another table based on some condition.
UPDATE TRCB_XBRL_STG_2 STG
SET PROFIT =
case when xbrl.isconsolidatedacc='Y' and EXTRACTVALUE(XBRL.XBRLFILE,'//PROFIT ', 'xmlns:acra="..."') is not null
THEN EXTRACTVALUE(XBRL.XBRLFILE,'//PROFIT ', 'xmlns:acra="..."')
WHEN XBRL.ISCONSOLIDATEDACC='N' AND EXTRACTVALUE(XBRL.XBRLFILE,'//PROFIT ', 'xmlns:acra="..') IS NOT NULL
THEN extractValue(XBRL.xbrlfile,'//PROFIT ', 'xmlns:acra=".."')
ELSE STG.PROFIT
END,
SET REVENUE=
case when xbrl.isconsolidatedacc='Y' and EXTRACTVALUE(XBRL.XBRLFILE,'//REVENUE', 'xmlns:acra="..."') is not null
THEN EXTRACTVALUE(XBRL.XBRLFILE,'//REVENUE.', 'xmlns:acra="..."')
WHEN XBRL.ISCONSOLIDATEDACC='N' AND EXTRACTVALUE(XBRL.XBRLFILE,'//REVENUE', 'xmlns:acra="..') IS NOT NULL
THEN extractValue(XBRL.xbrlfile,'//REVENUE', 'xmlns:acra="REVENUE"')
ELSE STG.REVENUE
END,
... (around 100 columns)
FROM TRCB_XBRL xbrl ,TRCB_XBRL_STG_2 STG
WHERE STG.XBRL_ID = XBRL.XBRL_ID Number of columns are around 100 , please anyone suggest how to use update statement with joining two tables.Hi,
If all the values needed to update a given row of table_x are coming from the same row of table_y (or from the same row of a result set of a query involving any number of tables), then you can do something like this:
UPDATE table_x x
SET (col1, col2, col3, ...)
= (
SELECT NVL (y.col1, x.col1)
, NVL (y.col2, x.col2)
, NVL (y.col3, x.col3)
FROM table_y y
WHERE x.pkey = y.expr
AND ...
WHERE ...
;If the WHERE clause depends on the same row of table_y, then it will probably be simpler and more efficient to use MERGE instead of UPDATE.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
In the case of a DML operation (such as UPDATE) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
Explain, using specific examples, how you get those results from that data.
Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
See the forum FAQ {message:id=9360002} -
Help with xml and getNextHighestDepth
I have a thumbnail gallery that is called in with xml- On
stage is a movieClip that covers the entire thumbnail area with the
alpha set to 0. what I'm trying to do is onRelease- have that mc
brought to the front and it's alpha state tween to 100- i've not
much experience using 'getNextHighestDepth' so I'm assuming
something is wrong here... if anyone can help I'd really appreciate
it!
Thanks!i think you want something along the lines of :
stageFade_mc.swapDepths(theMovieOnTopAtTheMoment);
Note that only dynamically created movies have depths. So if
either of the movieclips in question are just sitting in your
timeline you cant swap their depths.
In that case you either need to duplicateMovieClip() or just
set things _visible property where apropriate.
good luck
jon -
FindByPrimaryKey: Could not find prepared statement with handle 3
I've inherited a WL61 application and been asked to make it work under WL81. We're using SQL Server 2000. We only access two tables. The XML got auto-converted during the upgrade, but I had to correct the RDBMS column names in the weblogic-cmp-jar.xml
The application mostly works except the findByPrimaryKey fails with:
ERROR ExecuteThread: '14' for queue: 'weblogic.kernel.Default' Administrator : TargetSessionBean - Error finding promotion with ID <2>
javax.ejb.FinderException: Problem in findByPrimaryKey while preparing or executing statement: 'weblogic.jdbc.wrapper.PreparedStatement_weblogic_jdbc_base_BasePreparedStatement@95':
java.sql.SQLException: [BEA][SQLServer JDBC Driver][SQLServer]Could not find prepared statement with handle 3.
java.sql.SQLException: [BEA][SQLServer JDBC Driver][SQLServer]Could not find prepared statement with handle 3.
at weblogic.jdbc.base.BaseExceptions.createException(Unknown Source)
at weblogic.jdbc.base.BaseExceptions.getException(Unknown Source)
I've checked the database table and the row exisits with the appropriate PK (in this case a promotion with ID <2>).
In the WL61 version the findByPrimaryKey was explicitly defined in the weblogic-cmp-rdbms-jar.xml as follows:
<finder>
<method-name>findByPrimaryKey</method-name>
<method-params>
<method-param>com.fujitsu.ftxs.corema.server.PromotionPK</method-param>
</method-params>
<finder-query><![CDATA[ (= $0 promotionId) ]]></finder-query>
<finder-expression>
<expression-number>0</expression-number>
<expression-text><![CDATA[@0.promotionId]]></expression-text>
<expression-type>int</expression-type>
</finder-expression>
</finder
But I understand that with WL81 I should no longer define this - it's done implicitly - so I've removed this finder definition.
Any help appreciated. Thanks,
- Andy AbelI fixed it by switching from the using the BEA driver:-
DriverName="weblogic.jdbc.sqlserver.SQLServerDriver"
URL="jdbc:bea:sqlserver://host:1433"
And using the Microsoft Driver instead:-
DriverName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
url=jdbc:microsoft:sqlserver://host:1433
If anyone can explain why the Microsoft Driver works and the BEA driver does not I'd like to know.
Thanks,
- Andy Abel -
Problems loading images dynamically with XML
Hi Everyone,
I am working with a project that was build by another
developer and I have been asked to modify it several ways. This is
an interactive map for a hotel brand where when you click on the
USA, you get a list of all the states, click a state and a list of
all the hotels in that state comes up, click a hotel, the hotel's
information is displayed. I understand the structure of the files,
how they make them work, though I couldn't build it myself.
The problem I am having is this. can't make the hotels'
photos load into the flash through the XML. I created a target
movie file that the image could load into but something is not
happening as far as loading the images. I don't know if the movie
clip that I created is the right way to go (it was made as an
object in the library that is exported via AS), or if I should
create one in the action script file that loads the XML data.
I looked at some tutorials about how to load images with XML
but those didn't get into the level of detail that I need for this
project.
I've attached some partial code to see if anyone can help me
work through this.
Any and all suggestions are welcome.
Thanks for the help in advance.
JeremiahI'm a noob at AS3 and trying to learn this XML stuff myself,
but i have been able to load pictures to the stage...this might
help you...my xml file photo section is similar to yours, only I
have it labeled as "href" instead of "source"...
var imageLoader:Loader;
var xml:XML;
var xmlList:XMLList;
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("xmldata/images.xml"));
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
function xmlLoaded(event:Event) :void {
xml = XML(event.target.data);
xmlList = xml.children();
for (var i:int = 0; i<xmlList.length(); i++) {
imageLoader = new Loader();
imageLoader.load(new URLRequest(xmlList
.attribute("href")));
imageLoader.x = 0;
imageLoader.y = 0;
addChild(imageLoader); -
Customer Statement with opening and closing balances
Dear Forum,
The users want to generate the Customer Statement with opening and closing balances like the traditional one. The statement now generated gives the list of all open items as on date, but the users want the statement with opening balances as on the date of the begining of the range specified and the closing balance at the end of the period for which the statement is generated. Is there a way to generate the same from the system.
Thanks for the help.
Regards,Hi,
SPRO> Financial Accounting (New) > Accounts Receivable and Accounts Payable > Customer Accounts > Line Items > Correspondence > Make and Check Settings for Correspondence
You can use the program RFKORD10 with correspondance type SAP06 for your company code
This program prints account statements and open items lists for customers and vendors in letter form. For account statements, all postings between two key dates, as well as the opening and closing balance, are listed.
Regards,
Gaurav -
Error while replacing IF statements with DECODE function in procedure
Hi All,
I have created a procedure which has nested IF statements. Now I want to replace the IF statements with DECODE functions to improve performance.
Procedure:
IF (var_int_sev = '0')
THEN
var_sev := '2';
ELSE
SELECT sev
INTO var_int_sev
FROM errorconfig
WHERE errorcode = var_errorcode;
var_sev := var_int_sev;
END IF;
I converted the above IF statement into DECODE function as mentioned below:
var_Sev := DECODE(var_int_sev,0,2,SELECT severity FROM errorconfig WHERE errorcode=var_ErrorCode)
But it throws below error at the select statement used inside DECODE.
Error(58,51): PLS-00103: Encountered the symbol "SELECT" when expecting one of the following: ( - + case mod new not null others <an identifier> <a double-quoted delimited-identifier> <a bind variable> avg count current exists max min prior sql stddev sum variance execute forall merge time timestamp interval date <a string literal with character set specification> <a number> <a single-quoted SQL string> pipe <an alternatively-quoted string literal with character set specification> <an alternativ
Can someone help me in converting the IF to DECODE in the above case. Also how can we use a select statement inside decode.instead of trying to rewrite all your code and hoping that the performance will be better, it's a better option to investigate and find out which part of your application is slow
read this:
When your query takes too long ... -
I m trying to find if LIMIT is a part of the select statement and if works like
set rowcount 1 in sybase....if anyone can post the generic select statement with LIMIT in it that would be great!
any help or input will be greatly appreciated
Thanks!Hallo,
i don't know sybase, but it is probably rownum
select * from scott.emp
where rownum < 3
Regards
Dmytro -
Custom action with XML type input and output parameter.
Hi,
I want to develop custom action with xml type input and/or output parameter.
Is there sample code for java side. How is the definition of input and/or output parameter and set/get methods?
does it need special .jar file to develop custom action like this?
Thanks.Cemil - yes, you can use XML data types. Use the class
com.sap.lhcommon.xml.XMLDataType
for your parameter type. Here is a snippet from a custom action we use to log XML (instead of just returning the #text node like the default logger does):
public class XMLLogger extends ActionReflectionBase
private String source;
private String eventType;
private String textMessage;
private XMLDataType xmlMessage;
public XMLLogger()
log = new Logger("UserLog");
source = DEFAULT_SOURCE;
eventType = TYPE_INFO;
textMessage = "";
xmlMessage = new XMLDataType();
public XMLDataType getXmlMessage()
return xmlMessage;
public void setXmlMessage(XMLDataType xmlMessage)
this.xmlMessage = xmlMessage;
public void Invoke(Transaction transaction, ILog ilog)
StringBuffer sb = new StringBuffer();
sb.append('[');
sb.append(source);
sb.append("] ");
sb.append(textMessage);
sb.append(XMLUtils.convertXmlToString(xmlMessage));
XMLUtils is a helper class we wrote - it's just a bunch of standard Java XML boilerplate code. The important part you need to know is XMLDataType.getDocument() will return an org.w3c.dom.Document.
I hope that was enough information to help.
-tim -
hi everybody,
I've a big problem with XML on Linux, in details I see my program stopping on Linux at the instruction
XMLReader xr = XMLReaderFactory.createXMLReader("org.apache.crimson.parser.XMLReaderImpl");
and it's strange because on Windows it runs and there aren't problems about permissions on files, does anyone knows what to do?
thanks in advance!
StefanoWhat happens on that line? I'm assuming you get some kind of error or exception.
Make sure the JAR file for Crimson is in your classpath.
Maybe you are looking for
-
Why I'm not allowed to create post in support of apple online?
Trying to post a question, but seeing a message that I'm not allowed to do that, Why? Thanks
-
WRVS4400N Any chance linksys will fix the bugs?
So, do you guys think there is any hope that linksys will ever fix the firmware on this router? I have to buy some more VPN capable routers and quite honestly I'm debating if I should just find a way to return the ones I already have and buy them all
-
BI Integrated Planning - Error config logon tickets
Hi, I am trying to use the Integrated Planning module in 2004s, when I select the start modeler, I get an error relating to the configuration of SAP logon tickets. Both the required profile parameters are set to the correct value: login/create_sso2_t
-
This is an odd problem. I copied movie files to my Macbook and imported them into imovie. After I finished editing, I can delete both the imovie project and the actual movie file. Even if I empty the trash, the HD provides an incorrect size estimate
-
[ms-1719/gx700] - windows 7 64bit - mass storage controller driver missing
Hi, I have a question about finding/installing the mass storage controller driver, after a clean install of win7 sp1 64bit (home edition). I bought a new drive (Seagate ST9500420AS), onto which I installed the OS. I thought the OS itself was supposed