Spry XML Function
Hi there guys
I have searched all forums but I could not find anything.
I am using Spry and XML. I have put the code below. It has to
split the data from one of the variables "pt_task" and split it
where "||" is. Could someone help please?
=====================================================
<script type="text/javascript">
var ds1 = new Spry.Data.XMLDataSet("ThisFile.xml",
"Program/ProgramTask",{useCache:false});
function SplitThis(ds, row, rowIndex)
row.FormattedRow = row.pt_task.split("||");
return row;
</script>
<div spry:region="ds1">
<div spry:repeat="ds1">
<table width="500" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td>{FormattedRow}</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</div>
</div>
=====================================================
Hi "V1 Fusion"
First Thank you for your reply.
I can tell you this I am very novice in Spry.
I have a field that is implode by "||" & "(|)". I like to
explode this and put the outcome into an array.
I have done the first section since writing this topic which
is below but I can not re-explode or split the row again. Also I am
getting "," in between the splits which I do not know where they
are coming from.
E.g. a1b,a2b,a3b(|)c1d,c2d,c3d
Could you help please?
<script type=text/javascript".....>
Var ds1 = new Spry.Data.XMLDataSet("XmlFile.xml",
"Prog/Tasks",(useCache:false));
function FilterThisOne(ds, row, rowNumber){
var DataStepOne = row['ThisNode'];
DataStepTwo = DataStepOne.split("||");
row['FixedDataOnce'] = DataStepTwo;
return row;
ds1.filter(FilterThisOne);
</script...>
Sample Data:
a1b||a2b||a3b(|)c1d||c2d||c3d
Thanks
Ben
Similar Messages
-
Spry xml dataset / IE / Phatfusion Multibox
I try to use spry xml data set with phatfusion multibox.
I use multibox script to open a PHP page with query string
insides spry:region.
It has problem on this application on IE either 6 and 7. But
works fine in Firefox
The requested php page just open in a new window.
I tested to relocate the dummy scripts for multibox outsides
spry:region, the script do works.
How to solve the problem ! Help pleaseHi bsyyu,
First, you might want to validate your markup because I see
that you have several unclosed tags and a missing title tag.
To solve the problem, you'll have to create your multibox
object inside an observer for the region.
Replace your code inside the region:
<script
type="text/javascript">
var ben = {};
window.addEvent('domready', function(){
ben = new MultiBox('mb', {descClassName: 'multiBoxDesc'});
</script>
with this code, put in a script in the page head:
var obs = new Object;
obs.onPostUpdate = function(notifier, data){
var ben = new MultiBox('mb', {descClassName:
'multiBoxDesc'});
Spry.Data.Region.addObserver('events', obs);
--Florin TUDOR -
Error specifying spry xml data source?
I have been using Dreamweaver's Spry XML Data Sets without any trouble until I added the calendar YUI widget. After that I get an error message "no expected entity name for reference (65, 23)". Also nothing shows in the Bindings Panel. I have a Mac OS X, which I find very frustrating after being on a PC for 15 years. I can never find anything I am looking for in the help section.
Here is what I have tried so far that has not worked.
1. Removed the YUI extension
2. Deleted the ******.dat file from the configuration folder in the library user folder
3. Renamed the configuration folder in the library user folder
4. Copied the configuration library folder from my functioning laptop
5. Uninstalled and reinstalled Dreamweaver CS4
I can code everything by hand, but that is very time consuming and makes this software a virtual paper weight.
I would appreciate any advise that could be offered.The preferences files for Mac programs is in your user account folder/Library/Preferences. The files that DW and other applications create end in .plist. These files are creating by Mac OS for many different applications. If you delete one, the OS will re-create another preferences file upon the next opening of the application.
Also the other files that DW saves during a re-install are saved only if you go through the uninstall process and enable that option. This is the same for the Windows version. Sometimes if there are strange errors you can contact Adobe support for general information.
If not and you need to do a re-install I would recommend de-activating first. Then running the adobe CS# clean tool. Just type that phrase into Google and you will find it as the top result for CS3 or CS4.
Adobe - Adobe CS3Clean Script
Adobe - Adobe CS4 Clean Script
Those do more than just remove the program. They will remove all components in the applications folder and shared in the user library and system library. That is the only true way to do a re-install as far as I know. But you will need to de-activate before doing this because it will erase every file and all serial numbers from all Adobe programs with this tool. -
Looking for more samples of spry xml data in use
I was curious if there's a resource out there that shows more
samples of using the spry xml data widget. Almost like a template
or sample gallery. Am I dreaming?Look
Here -
Read XML function - can't get it to work correctly to set metadata
I've been working with the Read XML function in order to set metadata on assets with no avail. I'm using the following simple XML file in a Watcher folder with a poll watcher setup every 5 seconds, that then references a Read XML Response named "Update Asset Metadata" - to read the XML file and update the asset metadata. Nothing really happens even though the FCS Log file shows that the process is taking place to "update" the asset metadata. Any advice is appreciated. Thanks!
FILE:
<?xml version="1.0" encoding="UTF-8"?>
<FinalCutServer>
<request reqId="setMd" entityId="/asset/10">
<params>
<mdValue fieldName="Title" dataType="string">Text Info Change</mdValue>
</params>
</request>
</FinalCutServer>I got the answer. You must type “*.xml” (that is, asterisk-dot-xml) in the Value field of Wildcard Include Filter for it to work correctly.
-
Help!! Problem in XML Functions!!!!
hi:
everyone!!
when i use the xml functions deletexml, insertxmlbefore, appendchildxml, insertchildxml to update the xml. i get a error:ORA-19039: Keyword DELETEXML reserved for future use.
here is my query string:update xml_table set xpo=deletexml(xpo, '/sh:Sender', xmltype(?))
but function updatexml can play well.
can anybody help me to solve the problem??? i am just beginning to use Oracle xml database.
Thanks.oh,yes, you are right,my oracle version is 10.1.0.2.0. i don't pay attention to the difference between 10.1.* and 10.2.*. so i think the functions was also supported. i will get a version of 10.2.* to try.
thanks for your help:mdrake!!! -
How to use XML functions in CEP
Hi,
I am trying to implement XML functions in CEP. But i am getting error while using XMl function in config.xml file.
Please provide some help to resolve this issue.
Adapter Class
package com.bea.wlevs.example.adapter.XML_CEP;
import com.bea.wlevs.ede.api.EventProperty;
import com.bea.wlevs.ede.api.EventType;
import com.bea.wlevs.ede.api.EventTypeRepository;
import com.bea.wlevs.ede.api.RunnableBean;
import com.bea.wlevs.ede.api.StreamSender;
import com.bea.wlevs.ede.api.StreamSource;
import com.bea.wlevs.util.Service;
public class XMLAdapter implements RunnableBean, StreamSource {
private String id;
private String name;
private StreamSender eventSender;
private EventTypeRepository etr_;
public XMLAdapter() {
super();
public void run() {
setName("abc");
generateMessage();
public void setId(String id)
this.id = id;
public void setName(String i)
this.name = i;
@Service
public void setEventTypeRepository(EventTypeRepository etr) {
etr_ = etr;
private void generateMessage() {
EventType type = etr_.getEventType("XMLEvent");
EventProperty messageProp = type.getProperty("name");
EventProperty msgProp = type.getProperty("msg");
Object event = type.createEvent();
messageProp.setValue(event, name);
msgProp.setValue(event, "<PDRecord><PDId>6</PDId><PDName>hello1</PDName></PDRecord>");
eventSender.sendInsertEvent(event);
public void setEventSender(StreamSender sender) {
eventSender = sender;
public synchronized void suspend() {
EPN Assembly file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springframework.org/schema/osgi"
xmlns:wlevs="http://www.bea.com/ns/wlevs/spring" xmlns:jdbc="http://www.oracle.com/ns/ocep/jdbc"
xmlns:spatial="http://www.oracle.com/ns/ocep/spatial"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd
http://www.bea.com/ns/wlevs/spring
http://www.bea.com/ns/wlevs/spring/spring-wlevs-v11_1_1_3.xsd
http://www.oracle.com/ns/ocep/jdbc
http://www.oracle.com/ns/ocep/jdbc/ocep-jdbc.xsd
http://www.oracle.com/ns/ocep/spatial
http://www.oracle.com/ns/ocep/spatial/ocep-spatial.xsd">
<wlevs:event-type-repository>
<wlevs:event-type type-name="XMLEvent">
<wlevs:properties>
<wlevs:property name="msg" type="xmltype" />
<wlevs:property name="name" type="char" length="256" />
</wlevs:properties>
</wlevs:event-type>
</wlevs:event-type-repository>
<wlevs:adapter advertise="true" id="XML_Adapter"
class="com.bea.wlevs.example.adapter.XML_CEP.XMLAdapter">
<wlevs:listener ref="IPStream" />
<wlevs:instance-property name="id" value="123" />
<wlevs:instance-property name="name" value="Kanika" />
</wlevs:adapter>
<wlevs:processor id="XML_processor" provider="cql">
<wlevs:listener ref="OPStream" />
</wlevs:processor>
<wlevs:channel id="IPStream" event-type="XMLEvent">
<wlevs:listener ref="XML_processor" />
</wlevs:channel>
<wlevs:channel id="OPStream" event-type="XMLEvent">
<wlevs:listener ref="bean" />
</wlevs:channel>
<bean id="bean" class="com.bea.wlevs.example.outputBean.XML_CEP.OutputBean">
</bean>
</beans>
Config.xml file
<?xml version="1.0" encoding="UTF-8"?>
<wlevs:config xmlns:wlevs="http://www.bea.com/ns/wlevs/config/application"
xmlns:jdbc="http://www.oracle.com/ns/ocep/config/jdbc">
<processor>
<name>XML_processor</name>
<rules>
<query id="q1"><![CDATA[
SELECT
XMLEXISTS(
"for $i in /PDRecord RETURN $i/PDName" *// I am getting error at this line*
PASSING BY VALUE
msg as "."
RETURNING CONTENT
) XMLData
FROM IPStream
]]></query>
</rules>
</processor>
</wlevs:config>
Output Bean Class
package com.bea.wlevs.example.outputBean.XML_CEP;
import com.bea.wlevs.ede.api.EventType;
import com.bea.wlevs.ede.api.EventTypeRepository;
import com.bea.wlevs.ede.api.StreamSink;
import com.bea.wlevs.example.event.XML_CEP.DummyEvent;
import com.bea.wlevs.util.Service;
public class OutputBean implements StreamSink {
EventTypeRepository etr_;
@Service
public void setEventTypeRepository(EventTypeRepository etr) {
etr_ = etr;
public void onInsertEvent(Object event) {
EventType eventType = etr_.getEventType(event);
String prop = (String)eventType.getPropertyValue(event, "name");
String prop2 = (String)eventType.getPropertyValue(event, "msg");
System.out.println("Tuple Message: " + prop + ":" + prop2);
Error i am getting is:
<Jun 29, 2011 7:53:59 PM IST> <Emergency> <CQLServer> <BEA-000000> <CREATE QUERY q1 AS
SELECT
XMLQUERY(
"for $i in /PDRecord WHERE $i/PDId <= $x RETURN $i/PDName"
PASSING BY VALUE
msg as ".",
(name+1) AS "x"
RETURNING CONTENT
) XMLData
FROM IPStream
>
<Jun 29, 2011 7:53:59 PM IST> <Emergency> <CQLServer> <BEA-000000> <CREATE QUERY q1 AS
SELECT
XMLQUERY>>(
"for $i in /PDRecord WHERE $i/PDId <= $x RETURN $i/PDName"<<
PASSING BY VALUE
msg as ".",
(name+1) AS "x"
RETURNING CONTENT
) XMLData
FROM IPStream
generic syntax error. The syntax expects STRING token>
<Jun 29, 2011 7:53:59 PM IST> <Emergency> <CQLServerTrace> <BEA-000000> <oracle.cep.parser.SyntaxException: generic syntax error>
<Jun 29, 2011 7:53:59 PM IST> <Error> <CQLProcessor> <BEA-000000> <Failed to create statement [q1].
Invalid statement: "SELECT
XMLQUERY>>(
"for $i in /PDRecord WHERE $i/PDId <= $x RETURN $i/PDName"<<
PASSING BY VALUE
msg as ".",
(name+1) AS "x"
RETURNING CONTENT
) XMLData
FROM IPStream"
Description: generic syntax error
Cause: This DDL command has syntax error
Action: The syntax expects STRING token>
<Jun 29, 2011 7:53:59 PM IST> <Error> <Deployment> <BEA-2045016> <The application context "XML_CEP" could not be started. Could not initialize component
"<unknown>":
Invalid statement: "SELECT
XMLQUERY>>(
"for $i in /PDRecord WHERE $i/PDId <= $x RETURN $i/PDName"<<
PASSING BY VALUE
msg as ".",
(name+1) AS "x"
RETURNING CONTENT
) XMLData
FROM IPStream"
Description: generic syntax error
Cause: This DDL command has syntax error
Action: The syntax expects STRING token>
<Jun 29, 2011 7:54:00 PM IST> <Notice> <Deployment> <BEA-2045001> <The application bundle "XML_CEP" was undeployed successfully>
Thanks in advance.Hi Vikram,
I need some more help from your side.
It would be great help if you will let me know that how to extract the data from particular XML tag.
As of now i want to extract particular XML node by applying that query and the result i am getting is: <applicationID>Engage</applicationID>
I just want to know if I want to extract only data from this XML node i.e Engage instaed of *<applicationID>Engage</applicationID>*
Then what will be the query?
Thanks in Advance -
Spry xml data set, accessing specific rows
Hello. I've been trying to build a website using Spry XML
Data Sets, and while I've accomplished my goals for now, I don't
think the solution I came up with is the best.
The website consists of several areas that show projects.
Each project has several fields that are to be filled with content
retrieved from the xml files, but the projects are not all exactly
alike and some have specific fields that others don't require.
All the info is available in several languages, so for now
I've created an xml file for each one. An xml file could be like
Code Part1. (Why I can't add several code snippets along the post
baffles me. I mean, I can't, right?)
This dataset, for simplicity purposes, is not dependent on
the language (Code Part2).
And then there are the content areas (Code Part3).
So as you see, each project has its own structure. This makes
using spry:repeat a not very effective method for filling in all
the content. Ideally I should be able to access each row in the
dataset through some sort of value, like id, or one of its
children's values. The ds_RowID depends on the row order, so unless
there's another way to use it, it doesn't solve my problem.
Here's what I've come up with (Code Part4).
This works (in FF3 OSX, at least), although there are some
other problems that might make it necessary to create a spry:region
(or at least use spry:repeat) for each field. Anyway, it sounds
silly and wasteful to go through every row of the dataset everytime
for each of the fields that need to be filled.
My hope is that I'm ignorant of some much better method of
achieving my goals, something more direct and elegant.
Can anyone help me out with this? Thank you very much in
advance.Hi there
You are indeed absolutely correct a spry region should have been shown, my appologise for that, the code is wrapped in a standard spry region.
That being said i have used a work around in the SQL SELECT statement of the xmlExportObj, Recordset to find the information required without having to do any IF, ELSE on the page.
Many thanks for your reply and for pointing out my mistake in how I had presented my question.
My next question is to follow seperately
Regards
Ray -
Using XML functions in SQL Developer
Hi,
I'm using OSD 1.5.3 on a WinXP machine. I love OSD and use it every day! But I think i found a little bug. When you use some Oracle XML functions like (XMLELEMENTS and XMLAGG) in your query (these functions return CLOB values) it hangs OSD.
For Example:
SELECT XMLELEMENT("Relation",
XMLELEMENT("Name", 'Dennis'),
XMLELEMENT("DateOfBirth", '09/28/1975')
) as Relation
FROM DUAL;
Are there some parameters I can set to prevent this, or is this a bug?
Kind Regards,
D.Your query works fine for me from SQL Dev 1.5.3 (JDK 1.6.0_06), using either a JDBC or TNS connection (Oracle Client 9.2) to a 10.2.0.3 DB. Another thing which I have no idea if it is relevant (someone else may be able to say) is the following line from Help > About > Properties:
oracle.xdkjava.compatibility.version 9.0.4
Given that it works fine over TNS connections from SQL*Plus and PL/SQL Developer, I would assume that it is something related to your SQL Developer setup, unless you are using a different version of the Oracle client for these tools.
theFurryOne -
How to show an entry with specific ID from spry xml dataset?
I have a spry xml dataset, can I show only one record
specified by, say, unique ID?yeah, I first posted this one, then found out that my other
message was replied:) -
Unable to use XML functions in OWB 10gR2.
Hi,
I am trying to use XMLELEMENT ,XMLATTRIBUTES and XMLFOREST function for loading into a XML file using OWB 10Gr2.
During deployment it is erroring out with an error 'identifier 'XMLELEMENT' must be declared'.
Please suggest some workaround or possible reason for this problem.
Reagrds,
PHD
Edited by: user1662077 on May 21, 2009 5:17 AMHi Navneet,
I have followed these steps,But beyond that there is some thing which we want to achive.
We want the xml file to have a proper format like
"<?xml version="1.0" encoding="UTF-8"?>
<Header recTyp ='01' RTA='IN200200' ISIN='IN2000020220' recDate ='20090202' stmtDate='20090202' stmtTime='232020'
totNSDLPos='100' totTrnstPos='0' TotUnlckPos='10' TotLckPos='100' totPldgPos='0' totFrzPos='9' totIdtPos='9'
NSDLTotFrzPos='1' totDtlRec='2'/>
<Details recTyp='02' dpId='IN300118'>
<BenDtl benAcctNum='12345678' type='01' subtype='02' status='01'>
<FirstHldr name='op' fatherName='' PAN='HUFSOSFNKS'>
<Address type='1' pinCode='400097' phoneNum='28490520' faxNum='9999999999'>
<Part type='1'>
</Part>
<Part type='2'>
</Part>
<Part type='3'>
</Part>
<Part type='4'>
</Part>
</Address>
</FirstHldr>.........."
On the oracle blogs it was suggested that this can be achived by using XML function in the expression operator.
But while using them,OWB is not recongnising these XML function.
Regards,
PHD -
Problem using XML function in procedures (internal error )
Hi all,
I use the XML function in a stored procedures but when i compile these i have this error PLS-00801: internal error (74806).
The strangeness is that the single instruction launched from sql plus type
SELECT XMLElement("? xml",xmlattributes('1.0' as "version")) FROM dual; it's right.
thank.The Db version is 9.2.0.1
This is the source:
CREATE OR REPLACE procedure bi_create_XML_invoice as
BEGIN
declare
in_file UTL_FILE.file_type;
linebuf varchar2(1000);
tmpstr varchar2(50);
tmppririga varchar2(500);
tmpsecriga varchar2(500);
tmpdocinfo varchar2(500);
BEGIN
SELECT XMLElement("? xml",xmlattributes('1.0' as "version"))
INTO tmppririga
FROM dual;
END;
END bi_create_XML_invoice;
Thanks -
Need help for Export to XML Functionality
Hi All ,
I have developed a report in Apex2.2 to export the data into XML format .
I have used "export to XML" functionality and "HTF.escape_sc" function to escape special characters.The query is as follows..
select
HTF.escape_sc(replace (e.EVENT_NAME,'''','&'||'apos;')) AS EVENT_NAME ,
HTF.escape_sc(replace (e.VENUE_NAME,'''','&'||'apos;')) AS VENUE_NAME ,
HTF.escape_sc(replace (e.VENUE_ADDR,'''','&'||'apos;')) AS VENUE_ADDR ,
HTF.escape_sc(replace (e.DESCRIPTION,'''','&'||'apos;')) AS DESCRIPTION ,
HTF.escape_sc(replace (e.TRACKING_URL,'''','&'||'apos;')) AS TRACKING_URL ,
HTF.escape_sc(replace (d.primary_product,'''','&'||'apos;')) AS primary_product
from events e ,d_01 d
where
d.event_id = to_char(e.event_id)
and e.publish = 'external'
and e.searchable = 'Y'
The output result in XML in APEX2.2 is absolutely fine , but when i moved the application to apex.oracle.com the XML report instead of '&' it is displaying "%26amp" .
Is there any problem with APEX3.3 .
Appreciate your quick response.
Thanks
JyotiJyoti,
Replacing special characters from where? Report? Replacing by what?
The code for the package is open. You may use the part in the package body:
FOR i IN 1 .. CEIL (v_xml_l / 4000)
LOOP
v_xml_cut := SUBSTR (v_xml, v_count, 4000);
HTP.prn (v_xml_cut);
v_count := v_count + 4000;
END LOOP;
...and do something like
HTP.prn (REPLACE(v_xml_cut, '&', '&lt;'));
...Denes Kubicek -
Including HTML tags in Spry XML data sets
How does one add HTML tags to Spry XML data sets so that the displayed items include that markup?
For example, I might want to bold-face words within XML data items. I have tried adding the markup, but instead of seeing, for example:
This is bold face
in the Spry table, I see:
This is <b>bold</b> face
I have tried using CDATA elements in the XML to no avail.Set the data type for the column as per
var ds1 = new Spry.Data.XMLDataSet("myData.xml", "rows/row");
ds1.setColumnType("myColumn", "html");
Gramps -
Spry xml datasets can't recognise images
Been trying all day to load a spry xml dataset with image
information into a table using the wizard. problem is, you can't
tell the wizard that the data in one of the columns is the path to
an image, so it sees it as a string and just sticks the path in the
table. I tried putting it in as html rather than string but really
I am firing into the dark here!
What have I missed?thanks for the reply. I found the issue in the path string,
along with having to edit the html tag directly, which I wasn't
expecting, being used to DW doing it all for me! I found a lot of
the answer here:
http://www.csupomona.edu/~llsoe/42101/css/sprytables.htm
At least it stopped me being scared of html!
Maybe you are looking for
-
Copy to the disk iTunes -4 unknown error
On my iPad mini I keep getting this error when I try to sync: attempting to copy to the disk itunes failed -4 unknown error occurred
-
Hi, Can you please tell me , What are open item ,Close Item, Line Item in general terms(so icould understand easily). Thanks, Naresh.
-
Multiple Signatures possible?
Hello, new iPhone user here and I have looked for my answer but wasn't lucky. My question is: Can I have multiple signatures? I have my personal email, my game email and my work email on my iPhone. I would like to be able to choose which signature to
-
Power Save Utility fatal error 0x51 on Satellite M70
I have just joined my M70 to a domain (SBS 2003) and get this message when I login to the domain. If I logon to the local user account on the laptop then it works fine. If I go to power options in control panel and select a different power scheme the
-
i need help i cant remeber my password and i have tried so my times.The front screen reads " phone disable" pls help my carrier is sprint