Using the variable ? operator in an XPath Expression
I'm trying to using the variable operator (?) in an Oracle prepared statement used in a query where clause. Here is the query:
select xt.APPLICATION_NAME, xt.VERSION, xt.EVENT_TYPE, xt.SENDING_SITE, xt.RECEIVING_SITE, xt.EVENT_ID
from AUDITED_EVENT_XML_MIN e,
XMLTable(XMLNAMESPACES('http://gov/va/med/datasharing/audit/endpoint/audit' AS "xae"),
'/xae:auditable-event'
PASSING e.xml_event_content
COLUMNS
APPLICATION_NAME VARCHAR2(255) PATH 'xae:application-name',
VERSION VARCHAR2(255) PATH 'xae:version',
EVENT_TYPE VARCHAR2(255) PATH 'xae:event-type',
SENDING_SITE VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.4/HD.2',
RECEIVING_SITE VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.6/HD.2',
EVENT_ID VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.10') xt
where existsNode(E.XML_EVENT_CONTENT, '/xae:auditable-event[xae:event-type=?]','xmlns:xae="http://gov/va/med/datasharing/audit/endpoint/audit"') = 1This code works when the ? is replaced with "aValue". I need to use the ? so that my Java client can pass a variable value into the query.
Is this a supportable feature or am I doing something wrong?
I didn't see any examples in the Oracle XML DB Developers Guide where there was a ? in an XPath expression.
I also tried "?" with the same issue...
Here is the version info:
SQL*Plus: Release 11.1.0.6.0 - Production on Mon Sep 10 18:41:55 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing optionsAny assistance would be greatly appreciated.
Thanks in advance...
I incorporated this suggestion and it worked very well. Thanks!
Now I have converted my solution to use a structured index. As such, I want to write the where clauses in terms of column names rather than XPath expressions.
I hoped it was as simple as changing the code that generates the XPath expression to generate a SQL expression. After making that change, I'm now getting this error:
Caused by: java.sql.SQLSyntaxErrorException: ORA-00920: invalid relational operator
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)
at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:686)
at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:617)
at oracle.jdbc.driver.T2CPreparedStatement.executeForDescribe(T2CPreparedStatement.java:559)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1077)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3381)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3425)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1490)
at gov.va.med.datasharing.audit.dao.jdbc.runner.MapQueryRunner.run(MapQueryRunner.java:47)
at gov.va.med.datasharing.audit.web.dao.jdbc.AuditableEventsQueryDAOImpl.getAuditableEventsByDate(AuditableEventsQueryDAOImpl.java:150)It seemed to me that if it worked for the XPath expression that it should also work for the SQL expression.
The static SQL is:
SELECT PK_ID, EVENT_TYPE, OUTCOME, SENDING_SITE, RECEIVING_SITE, CREATED_TIME, EVENT_ID, PATIENT_ID FROM
(SELECT rownum as rn, PK_ID, EVENT_TYPE, OUTCOME, SENDING_SITE, RECEIVING_SITE, CREATED_TIME, EVENT_ID, PATIENT_ID FROM
(SELECT aet.AUDITABLE_EVENT_XML_PK_ID AS PK_ID, xt.EVENT_TYPE, xt.OUTCOME, xt.SENDING_SITE, xt.RECEIVING_SITE, aet.CREATED_TIME as CREATED_TIME, xt.EVENT_ID, xt.PATIENT_ID
FROM AUDITABLE_EVENT_XML aet,
XMLTable(XMLNAMESPACES('http://gov/va/med/datasharing/audit/endpoint/audit' AS "xae"),
'/xae:auditable-event'
PASSING aet.xml_event_content
COLUMNS
EVENT_TYPE VARCHAR2(255) PATH 'xae:event-type',
SENDING_SITE VARCHAR2(255) PATH 'xae:sending-site',
RECEIVING_SITE VARCHAR2(255) PATH 'xae:receiving-site',
EVENT_ID VARCHAR2(255) PATH 'xae:event-id',
PATIENT_ID VARCHAR2(255) PATH 'xae:patient-id',
OUTCOME VARCHAR2(255) PATH 'xae:outcome') xt
WHERE aet.CREATED_TIME BETWEEN ? AND ?
AND ?
) ORDER BY CREATED_TIME desc
) WHERE rn > ? and rn <= ?So I'm thinking that Oracle must perform strong checking in SQL, not allowing the '=' operator to be substituted. If I run this query in Toad, replacing the ? with the SQL, it runs fine...
Can someone tell me whether or not this is a legal substitution?
The SQL that runs in Toad is:
SELECT PK_ID, EVENT_TYPE, OUTCOME, SENDING_SITE, RECEIVING_SITE, CREATED_TIME, EVENT_ID, PATIENT_ID FROM
(SELECT rownum as rn, PK_ID, EVENT_TYPE, OUTCOME, SENDING_SITE, RECEIVING_SITE, CREATED_TIME, EVENT_ID, PATIENT_ID FROM
(SELECT aet.AUDITABLE_EVENT_XML_PK_ID AS PK_ID, xt.EVENT_TYPE, xt.OUTCOME, xt.SENDING_SITE, xt.RECEIVING_SITE, aet.CREATED_TIME as CREATED_TIME, xt.EVENT_ID, xt.PATIENT_ID
FROM AUDITABLE_EVENT_XML aet,
XMLTable(XMLNAMESPACES('http://gov/va/med/datasharing/audit/endpoint/audit' AS "xae"),
'/xae:auditable-event'
PASSING aet.xml_event_content
COLUMNS
EVENT_TYPE VARCHAR2(255) PATH 'xae:event-type',
SENDING_SITE VARCHAR2(255) PATH 'xae:sending-site',
RECEIVING_SITE VARCHAR2(255) PATH 'xae:receiving-site',
EVENT_ID VARCHAR2(255) PATH 'xae:event-id',
PATIENT_ID VARCHAR2(255) PATH 'xae:patient-id',
OUTCOME VARCHAR2(255) PATH 'xae:outcome') xt
WHERE aet.CREATED_TIME BETWEEN TO_DATE ('9/19/2011 12:00:01 AM','MM/DD/YYYY HH:MI:SS PM')
AND TO_DATE ('12/20/2012 12:00:00 AM','MM/DD/YYYY HH:MI:SS PM')
AND (OUTCOME=0 or OUTCOME=1)
) ORDER BY CREATED_TIME desc
) WHERE rn > 0 and rn <= 5;Any assistance will be appreciated,
Thanks in advance.
Similar Messages
-
Using the variable placeholder ? in an XPath expression
I'm trying to using the variable operator (?) in an Oracle prepared statement used in a query where clause. Here is the query:
select xt.APPLICATION_NAME, xt.VERSION, xt.EVENT_TYPE, xt.SENDING_SITE, xt.RECEIVING_SITE, xt.EVENT_ID
from AUDITED_EVENT_XML_MIN e,
XMLTable(XMLNAMESPACES('http://gov/va/med/datasharing/audit/endpoint/audit' AS "xae"),
'/xae:auditable-event'
PASSING e.xml_event_content
COLUMNS
APPLICATION_NAME VARCHAR2(255) PATH 'xae:application-name',
VERSION VARCHAR2(255) PATH 'xae:version',
EVENT_TYPE VARCHAR2(255) PATH 'xae:event-type',
SENDING_SITE VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.4/HD.2',
RECEIVING_SITE VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.6/HD.2',
EVENT_ID VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.10') xt
where existsNode(E.XML_EVENT_CONTENT, '/xae:auditable-event[xae:event-type=?]','xmlns:xae="http://gov/va/med/datasharing/audit/endpoint/audit"') = 1This code works when the ? is replaced with "aValue". I need to use the ? so that my Java client can pass a variable value into the query.
Is this a supportable feature or am I doing something wrong?
I didn't see any examples in the Oracle XML DB Developers Guide where there was a ? in an XPath expression.
I also tried "?" with the same issue...
Here is the version info:
SQL*Plus: Release 11.1.0.6.0 - Production on Mon Sep 10 18:41:55 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing optionsAny assistance would be greatly appreciated.
Thanks in advance...
Edited by: flyeagle5683 on Sep 10, 2012 5:49 PMselect xt.APPLICATION_NAME, xt.VERSION, xt.EVENT_TYPE, xt.SENDING_SITE, xt.RECEIVING_SITE, xt.EVENT_ID
from AUDITED_EVENT_XML_MIN e,
XMLTable(XMLNAMESPACES('http://gov/va/med/datasharing/audit/endpoint/audit' AS "xae"),
'/xae:auditable-event'
PASSING e.xml_event_content
COLUMNS
APPLICATION_NAME VARCHAR2(255) PATH 'xae:application-name',
VERSION VARCHAR2(255) PATH 'xae:version',
EVENT_TYPE VARCHAR2(255) PATH 'xae:event-type',
SENDING_SITE VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.4/HD.2',
RECEIVING_SITE VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.6/HD.2',
EVENT_ID VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.10') xt
where XMLEXISTS(
'declarre namespace xae ="http://gov/va/med/datasharing/audit/endpoint/audit"; (: :)
$XML/xae:auditable-event[xae:event-type=$VALUE]'
passing e.xml_event_content as "XML",
:1 as "VALUE"
) or you can do
select xt.APPLICATION_NAME, xt.VERSION, xt.EVENT_TYPE, xt.SENDING_SITE, xt.RECEIVING_SITE, xt.EVENT_ID
from AUDITED_EVENT_XML_MIN e,
XMLTable(XMLNAMESPACES('http://gov/va/med/datasharing/audit/endpoint/audit' AS "xae"),
'/xae:auditable-event'
PASSING e.xml_event_content
COLUMNS
APPLICATION_NAME VARCHAR2(255) PATH 'xae:application-name',
VERSION VARCHAR2(255) PATH 'xae:version',
EVENT_TYPE VARCHAR2(255) PATH 'xae:event-type',
SENDING_SITE VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.4/HD.2',
RECEIVING_SITE VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.6/HD.2',
EVENT_ID VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.10') xt
WHERE EVENT_TYPE = :1Edited by: mdrake on Sep 10, 2012 7:23 PM
Edited by: mdrake on Sep 10, 2012 7:24 PM -
SSRS Expression for Conditional Filtering using the "IN" operator
Hello,
I need to filter my dataset based on a parameter:
If Period= 1 then Week must be in (W1, W2, W3), Else Week must be in (W10, W20, W30)
I tried using the "IN" operator but don't know how to create the expression for the "Value" field. I tried the following:
iif(Parameters!Period.Value = 1,
"W1, W2, W3",
"W10, W20, W30")
But it doesn't work.
Expression: Week
Operator: IN
Value: ???
Any help would be highly appreciated!Hi,
Use split function.
See this expression: IIF(Parameters!Period.Value = 1, SPLIT("W1,W2,W3",","), SPLIT("W10,W20,W30",","))
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/8da78c9b-7f0c-42f1-a9c4-82f065f317c9/using-the-in-operator-in-ssrs-expressions
Thanks Shiven:) If Answer is Helpful, Please Vote -
Using the "this" operator to pass variable references among classes and met
Hi guys still trying to understand how to use the "this" operator
can some one tell what I am doing wrong or just make this work for me to see how it works.
public class ReferencePassing
public static void main(String[]args)
ReferencePassing rp = new ReferencePassing();
System.out.println(rp);
public ReferencePassing()
HelperObject ho = new HelperObject(this);
System.out.println(this);
class HelperObject
private ReferencePassing MyReferencePassingBuddy;
public HelperObject (ReferencePassing theRp);
MyReferencePassingBuddy = theRp;
print();
public void print()
System.out.println(MyReferencePassingBuddy);
}Hi guys still trying to understand how to use the "this" operatorYou're still trying to understand how to write methods and constructors.
public HelperObject (ReferencePassing theRp);Syntax error at ';'.
MyReferencePassingBuddy = theRp;
print();
public void print()Syntax error: '}' expected. -
Using the "as" operator vs casting?
I've recently been reading the docs regarding data types in
AS3 and am still not clear on a few things. If anyone has blogged
on this, please point me there.
One problem is that "casting" syntax is the same as top-level
function syntax. Compare String(objString) to XML(event.result).
The latter is a top-level function, but the former is a "cast". Or
is it?
An option to the String cast is objString.toString(). What is
the difference? I am not so much interested in the underlying
details of the language, as in understanding when to use which.
The same question exists for the top-level function
XML(event.result), which can be done with the "as" operator:
event.result as XML. When to use which? Are there performance
issues? The "as operator" documentation is unsatisfying.
Any discussion of this will be appreciated.
TracyActionScript 3.0 has the
as operator because it circumvents a deficiency with the
cast operation () in ActionScript. Consider this:
var a:Object = new Array(1,2,3,4);
var b:Array = Array(a);
What is b? It is an Array of 1 element: [ [1,2,3,4] ];
The
as operator takes care of this:
var b:Array = a as Array;
The actual difference in the operators is that if the
variable being cast is not of the proper type, the
as operator returns null while the () operator throws an
exception:
var j:Number = Number(a); // exception!
var k:Number = a as Number; // NaN in this case, but null
normally
The feeling here at Adobe is to use the
as operator since it is not ambiguous and just check for
null. If you prefer to catch exceptions and know when X(y) is a
cast vs a conversion, then use that. More of a preference but at
times only
as will do what you need. -
How can I use the update operation in a VC Model
Hello experts,
i try to to use the update operation in my VC model. I have developed an AS wich return a table. Now i want to update a table row. So I add the update operation to my model. But it doesn´t work. I mapped all attribute between the table and the update service. The event name is submit.
Another strange thing is: If i try to update in the service browser it cames the error message that the vandatory attribute ... is missing.
Any ideas??
Thanks
MarcoHi Marco,
In this case it is possible that your update service requires a mandatory parameter which you are not providing.
When you drag your service onto the VC screen, right click on the service and test it.It will give you a clear picture of which parameters are required by the service and besides you can also use some test data to check if the service is working properly.
Do let me know if this helps.
Thanks,
Gaurav. -
How to use the variables used in the message mapping
Hi ,
In the message mapping we can declare variables in the JAVA section , these variables could be used across the mapping .
I have tried using it but I am unable to retrieve the values assigned to the variables in one UDF into the another UDF .
Please guide me how to use the variables declared in the JAVA section in the message mapping .
Thanks
Anita YadavAnita,
I have worked on the Global variables and i found no issues. Make sure that the variable is declared in the Declaration Section and then initlaized in the Initialization section.
If you declare a variable in the Declaration Section ,
int i;
then in any udf you can use if directly. No need to re declare the variable in the UDF. If you do this, then it becomes a local variable.
Regards,
Bhavesh -
How to use the variables of Function exit in the include program
i have a problem of using the variables of a function exit in the include program..
If i use those variables there will be an error indicating 'Field FEBVW_IN is unknown. It is neither in one of the specified tables nor defined by a DATA statement'. Please help... Below is the code of the function exit:
FUNCTION EXIT_SAPLIEDP_202.
""Lokale Schnittstelle:
*" IMPORTING
*" VALUE(IDOC_CONTROL_INDEX)
*" VALUE(IDOC_DATA_INDEX)
*" VALUE(FEBVW_IN) LIKE FEBVW STRUCTURE FEBVW
*" VALUE(FEBKO_IN) LIKE FEBKO STRUCTURE FEBKO
*" VALUE(FEBEP_IN) LIKE FEBEP STRUCTURE FEBEP
*" VALUE(FEBRE_IN) LIKE FEBRE STRUCTURE FEBRE
*" VALUE(FEBPI_IN) LIKE FEBPI STRUCTURE FEBPI
*" EXPORTING
*" VALUE(I_FIMSG) LIKE FIMSG STRUCTURE FIMSG
*" VALUE(FEBVW_OUT) LIKE FEBVW STRUCTURE FEBVW
*" VALUE(FEBKO_OUT) LIKE FEBKO STRUCTURE FEBKO
*" VALUE(FEBEP_OUT) LIKE FEBEP STRUCTURE FEBEP
*" VALUE(FEBRE_OUT) LIKE FEBRE STRUCTURE FEBRE
*" VALUE(FEBPI_OUT) LIKE FEBPI STRUCTURE FEBPI
*" TABLES
*" IDOC_CONTROL STRUCTURE EDIDC
*" IDOC_DATA STRUCTURE EDIDD
*" IDOC_AVIP STRUCTURE AVIP OPTIONAL
*" IDOC_AVIR STRUCTURE AVIR OPTIONAL
*" IDOC_AVIT STRUCTURE AVIT OPTIONAL
*" CHANGING
*" REFERENCE(IDOC_AVIK) TYPE AVIK OPTIONAL
*" EXCEPTIONS
*" PROC_ERROR
INCLUDE ZXF08U10.
Here is the code for the include program.
INCLUDE ZXF08U10
MOVE febvw_in TO febvw_out.Sometimes you will get this error message when checking include code in exits even though there is really no error - it happens because the include does not realise it is in the function due to the navigation index being out of date.
Try activating the code - it may work even though the check said there were errors.
You can also get this issue when trying to drill down on the field in the include to view its structure.
Andrew -
Error when using the variable System::ErrorDescription
HI All,
When I try to use the variable System::ErrorDescription I get the following error:
The element cannot be found in a collection. This error happens when you try to retrieve an element from a collection on a container during execution of the package and the element is not there.
Do I need to declare it or it's a variable that always is available to get exceptions from the execution states?if this is in a Script Task then:
- add the variable in the Script task property ReadOnlyVariables list
- in the Script Code refer to it as
string ErrorDesc = (string) Dts.Variables["System::ErrorDescription"].Value;
Jan D'Hondt - SQL server BI development -
Error while using the variable name "VARIABLE" in variable substitution
Hi Experts,
I am using variable substitution to have my output filename set as a payload field value. It is working fine when I am using the variable name as fname, subs etc but channel goes in error when I am using the variable name as "VARIABLE". This is probably a reserved word but i would like to know where i can find a detailed documentation on this. Say things to note / restrictions while using variable substitution.
This is the error in the channel:
Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error during variable substitution: java.text.ParseException: Variable 'variable' not found in variable substitution table: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: java.text.ParseException: Variable 'variable' not found in variable substitution table
Thanks,
DiyaHi Zevik,
Thanks for the reply. The output file is created correctly by merely changing the variable name to something else and hence the doubt.
Below is the configuration:
Variable Substituition
VARIABLE payload:interface_dummy,1,Recordset,1,Header,1,field1,1
Filename schema : TEST_%VARIABLE%.txt
Output xml structure:
<?xml version="1.0" encoding="utf-8" ?>
- <ns:interface_dummy xmlns:ns="http://training.eu.unilever.com">
- <ns:Recordset xmlns:ns="http://training.eu.unilever.com">
- <Header>
<identifier>HDR</identifier>
<field1>001</field1>
<field2>001</field2>
<field3>R</field3>
</Header>
- <Detail>
<identifier>A</identifier>
<field1>000000002</field1>
<field2 />
<field3>Doretha.Walker</field3>
</Detail>
I thimk my configuration is correct as it is working correctly with the variable name change, However, maybe i missed something ! -
Select Performance problems using the 'like' operator
I have a PL/SQL procedure that uses a cursor which contains a 'like' operator in the where clause. I have two database instances that are theoretically the same, however this code processes about 100,000 rows in 5 minutes on one database and 100,000 rows in several weeks on the other database. I know it is the 'like' operator that is causing the problem, but I don't know where to look in the database setup parameters as to what could be different between the two. Can someone point me in the right direction?
I tried to think of another way to write the query, but I really need to use the wildcard option on the data I'm searching for. The system I'm working with attaches a suffix to the end of every ID (ie. '214-222-1234-0') The suffix ('-0') increments but the rest of the ID stays the same ('-1','-2',etc...), but I want to find all of the rows where the first 12 characters are the same, so I strip off the suffix and use a wildcard '%' in its place. I tried adding the SUBSTR() function to the left hand column of the where clause, but it was even slower than using the 'like' operator. I know its a sound query, I just can't figure out why it works fine on one database and not the other.
-
Dears,
I dont Understand How Can I Use the Variable Delay to Deploy Variable Delay on a Speedy-33 KitHello,
Thank you for posting to the NI Forums!! You should be able to incorporate the Variable Delay.vi into your vi and then build as normal and the functionality of the vi should translate to the build. What type of build are you doing? Are you receiving any specific errors? Thanks!
Regards,
Margaret Barrett
National Instruments
Applications Engineer
Digital Multimeters and LCR Meters -
How do I use the ? operator in JSF tag attributes?
I want to do something like this:
<h:inputText styleClass="${myBean.valid ? 'styleA' : styleB'}" ...>
What do I have to do to use this Expression language?
With the #{...} expression the ? operator doesnt seem to be available.
When I use the ${...} expression I am getting this error:
javax.servlet.ServletException: ServletException in '/WEB-INF/body/Test.jsp': /WEB-INF/body/Test.jsp(12,5) According to TLD or attribute directive in tag file, attribute styleClass does not accept any expressions
javax.faces.webapp.FacesServlet.service(FacesServlet.java:121)
Can anybody please help?
Thanks!Personally, i'd do:
<h:inputText styleClass="styleA" rendered="#{myBean.valid}"/>
<h:inputText styleClass="styleB" rendered="#{!myBean.valid}"/> -
Error: The result is empty for XPath expression
hi gurus
Following is my input sample data to BPEL process.
<ItemList>
<Item>
<Name>Music System</Name>
<Id>525</Id>
<Item>
<Name>Fog Light</Name>
<Id>325</Id>
<Item>
<Name>Tyres</Name>
<Id>325</Id>
<Item>
<Name>Neon Light Ring</Name>
<Id>325</Id>
</Item>
</Item>
</Item>
</Item>
</ItemList>
Here <ItemList> contains <Item>.
And <Item> contains <Name>,<Id> & <Item> element itself.
i have created proper XSD for this.
But When i try to fetch any value then using Assign Activityits gives runtime following error.
Error in evaluate from expression at line "36".The result is empty for the XPATH expression: /ns1:ItemList/ns1:Item/ns1:Name
Any suggestion..?
thanks
/mishitHere is my XSD.
<?xml version="1.0" encoding="windows-1252"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.example.org"
targetNamespace="http://www.example.org"
elementFormDefault="qualified" >
<xsd:element name="ItemList" type="ItemListType"/>
<xsd:element name="Total" type="TotalType"/>
<xsd:complexType name="ItemListType">
<xsd:sequence>
<xsd:element name="Item" type="ItemType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ItemType">
<xsd:sequence>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="Id" type="xsd:string"/>
<xsd:element name="Item" type="ItemType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="TotalType">
<xsd:sequence>
<xsd:element name="TotalPrice" type="xsd:double"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
/mishit -
Cross-post: Using the "as" operator vs casting
I'm cross posting this because it is technically an
Actionscript question, but it has real Flex consequences.
I've recently been reading the docs regarding data types in
AS3 and am still not clear on a few things. If anyone has blogged
on this, please point me there.
One problem is that "casting" syntax is the same as top-level
function syntax. Compare String(objString) to XML(event.result).
The latter is a top-level function, but the former is a "cast". Or
is it?
An option to the String cast is objString.toString(). What is
the difference? I am not so much interested in the underlying
details of the language, as in understanding when to use which.
The same question exists for the top-level function
XML(event.result), which can be done with the "as" operator:
event.result as XML. When to use which? Are there performance
issues? The "as operator" documentation is unsatisfying.
Any discussion of this will be appreciated.
TracyMaltus now I'm totally confused.
The Flex manual in the TOP LEVEL section (Guess TOP LEVEL
means that they don't belong to any package) clearly states this
functions:
Function Description
Array Creates a new array.
Boolean Converts the expression parameter to a Boolean value
and returns the value.
decodeURI Decodes an encoded URI into a string.
decodeURIComponent Decodes an encoded URI component into a
string.
encodeURI Encodes a string into a valid URI (Uniform
Resource Identifier).
encodeURIComponent Encodes a string into a valid URI
component.
escape Converts the parameter to a string and encodes it in
a URL-encoded format, where most nonalphanumeric characters are
replaced with % hexadecimal sequences.
int Converts a given numeric value to an integer value.
isFinite Returns true if the value is a finite number, or
false if the value is Infinity or -Infinity.
isNaN Returns true if the value is NaN(not a number).
isXMLName Determines whether the specified string is a valid
name for an XML element or attribute.
Number Converts a given value to a Number value.
Object Every value in ActionScript 3.0 is an object, which
means that calling Object() on a value returns that value.
parseFloat Converts a string to a floating-point number.
parseInt Converts a string to an integer.
String Returns a string representation of the specified
parameter.
trace Displays expressions, or writes to log files, while
debugging.
uint Converts a given numeric value to an unsigned integer
value.
unescape Evaluates the parameter str as a string, decodes
the string from URL-encoded format (converting all hexadecimal
sequences to ASCII characters), and returns the string.
XML Converts an object to an XML object.
XMLList Converts an object to an XMLList object.
So how do I do a XML type casting without using the XML
function for example? or is it the same?
Maybe you are looking for
-
How Do I Format Heads That Span 2 Columns in Text Flow?
I am working on a report fomatted in two columns. The report is divided into chapters than begin on a new page. No problem with that. But within each chapter, there are subheads that span across both columns preceed by a 6 point rule. I can do this e
-
Invoking PHOTOSHOP ELEMENTS from PHOTOSHOP ALBUM
How do I link to a previously installed version of Photoshop elements from within Photoshop album without getting to the "Buy Now" screen ?
-
What carrier is my phone with?
I recently purchased an iphone4 off of kijiji and do not have a sim card for it yet how do I know what carrier (Rogers, Telus, etc.) it is with? The guy I bought it from says he could not tell me.
-
since installing Lion, yahoo page became extremely slow and sometimes would not open e-mails at all. anyone encountered this problem?
-
Just got my confirmation for in store pick up.
I don't know if there waves of rollouts but just want to let you know i guess there rolling out the confirmations for in store pick ups... I preordered my xbone on 07/16. So keep an eye out guys!!! Enjoy your new Xbones!!!!!!