How to reference a value in an XML file
Hey guys! I have a valid XML structure is the following:
<app> <settings> <setting name="defaultModuleSlug" value="apples"></setting> <setting name="defaultPageSlug" value="oranges"></setting> </settings> <app>
XML info is an application object called application.config.
So, how do you refer to the variable defaultPageSlug? I know that I can use:
application.config[ 'app' ][ 'settings' ].xmlChildren[ 2 ].xmlAttribute[ 'value' ]
However, I would like to be able to reference the implementation by its name (defaultPageSlug) attribute and not assuming that it is the 2nd element of this node. Can anyone help?
Nevermind, I guess I can use XPath.
Tags: ColdFusion
Similar Questions
-
How to remove the value of the XML attribute in the Indesign file with javascript
Hi all
How to remove the value of the XML attribute in the Indesign file.
What error is this?
in any case try this as well (one another),
var myDoc = app.activeDocument; attrDelete(myDoc); function attrDelete(elm) { for (var i = 0; i < elm.xmlElements.length; i++) { try{ for(j=0; j
Vandy
-
How to reference the value of a < af:inputText > to the level of the view in a java class to level model? Thank you!
Hello!
1: you must close this topic and open another... :))) and game question calls for a response (if my answer is correct: set my answer - correct answer)...2nd: for example in your java class in view level:
links BindingContainer private;
public BindingContainer {} getBindings()
If (this.bindings == null) {}
FacesContext fc = FacesContext.getCurrentInstance ();
This.Bindings =
(BindingContainer) fc.getApplication () .evaluateExpressionGet (CF,
"#{bindings}."
BindingContainer.class);
}
Return this.bindings;
}Public Sub UseSetMyParam()
{
Fcab FacesCtrlActionBinding = (FacesCtrlActionBinding) getBindings () .getControlBinding ("setMyParam");
fcab.doIt ();
} -
Extract the value of an xml file-
Hello
I have a requirement that needs to store the contents of the XML db tables. Here I give you the details of the sample, it must extract values from the XML file and place these values in the mapping table.
Sample:
I created a table - create the table txt_xml of xmltype.
insert into table txt_xml values (xmltype ('))
< NewDataSet >
"" < DerivativeSecurity FAS157Level = "3" FAS157MVAdjustable = "N" OriginalMV = FAS157MVDelta "573174.3253" = "0.0" FAS157AdjustedMV = "573174.3253" PLCurrency = "USD" DerivativeSecurityID = "2009-BFWD-0001TRD' MetDerivativeID = '2009-BFWD-0001' MurexTransactionNumber = '36319' Trader '_GTELL' BuySell = =" B "DetailType = 'TRD' DerivativeType = 'BFWD' AL_ManagementSide = 'Active' CounterpartyCode = '3045' CounterpartyName =" ' JPM / CHASE "CurrencyCode ="USD"Coupon ="0,0"FixedFloatingIndicator ="FIXRT"IndexMultiplier ="1.0"IndexName = 'Bond' ="0,0"Comment11 = margin" PCG 6.05 01 / 03 / 34 "Comment12 ="2009-BFWD-0001"Comment13 ="694308GE1"Comment21 =" "Comment22 = Comment23"83003169"="1 618 300"TradeComment =" are created-credit of the assets for the current article "" specific - anticipation Hedge - PCG FWD 6.05% 01/03/2034. Are created. "" "" "" - Original M"OptionCallPut =" "OptionType =" "SettleType = 'Cash' RefISIN =" "RefObligation =" "sensitivity ="15044.6506"EffectiveConvexity ="0,0"Vega ="0,0"NextResetDate =" "LastResetDate =" "EffectiveDuration ="13.9289"Instrument"Bond"IssuerCode ="19039"IssuerName = ="PACIFIC GAS' IssuerREDCode '6FD738' strategy = = "CRD-PROT-07" StrikePrice = MaturityDate '105.89' = "TickerSymbol =" 2010-01-04 "" "MetPay =" "MetRec =" "Payrec =" P "RiskSection =" "HedgedItem =" deadline specific asset "ResetFrequency =" "ResetFrequencyNumber =" "PaymentFrequency =" "PaymentFrequencyNumber =" "CapFloorCoupon ="0.0"RefIndexRate ="0,0">"
< name of classification = "XHSEC" Value = "Derivatives" ValueDescription = "950" / >
< name of classification = "XSEC" ValueDescription = 'Credit' Value = '430' / >
< name of classification = "XLEV1" ValueDescription = value 'Before' = "9400" / >
< name of classification = "XLEV2" ValueDescription = 'Hedge' Value = "150000" / >
< / DerivativeSecurity >
((< / NewDataSet > '));
now what I need is OriginalMV value of this XML field. Please help me
Published by: Govind2 on February 5, 2010 08:33Yes it will fail because error explains everything... excerpt from value does not return several values for a simple xpath...
so in this case you must use the function xmltable...
SELECT column_value FROM some_things v, xmltable('for $i in /NewDataSet/DerivativeSecurity return $i/@FAS157Level' passing value(v))
edit your table name in the code above... and confirm
Ravi Kumar
-
How to get the value of an xml element attributes
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
I'm trying to parse an XML document
< response >
< well uwi = "102112900816W400" > < / well >
< production >
< PRODUCING_ENTITY >
< NUMBER YEAR = '2009' >
< NUMBER of MONTHS = LAST_DAY '1' = "31" / >
< NUMBER of MONTHS = LAST_DAY '2' = "28" / >
< NUMBER of MONTHS = LAST_DAY "3" = "30" / >
< / YEAR >
< NUMBER YEAR = '2010' >
< NUMBER of MONTHS = LAST_DAY '1' = "31" / >
< NUMBER of MONTHS = LAST_DAY '2' = "28" / >
< NUMBER of MONTHS = LAST_DAY "3" = "30" / >
< / YEAR >
< NUMBER YEAR = '2011' >
< NUMBER of MONTHS = LAST_DAY '1' = "31" / >
< NUMBER of MONTHS = LAST_DAY '2' = "28" / >
< NUMBER of MONTHS = LAST_DAY "3" = "30" / >
< / YEAR >
< NUMBER YEAR = '2012' >
< NUMBER of MONTHS = LAST_DAY '1' = "31" / >
< NUMBER of MONTHS = LAST_DAY '2' = "28" / >
< NUMBER of MONTHS = LAST_DAY "3" = "30" / >
< / YEAR >
< / PRODUCING_ENTITY >
< / production >
< / well >
< well uwi = "100092900816U400" > < / well >
< production >
< PRODUCING_ENTITY >
< NUMBER YEAR = "1999" >
< NUMBER of MONTHS = LAST_DAY '1' = "31" / >
< NUMBER of MONTHS = LAST_DAY '2' = "28" / >
< NUMBER of MONTHS = LAST_DAY "3" = "30" / >
< / YEAR >
< NUMBER YEAR = '2000' >
< NUMBER of MONTHS = LAST_DAY '1' = "31" / >
< NUMBER of MONTHS = LAST_DAY '2' = "28" / >
< NUMBER of MONTHS = LAST_DAY "3" = "30" / >
< / YEAR >
< NUMBER YEAR = '2001' >
< NUMBER of MONTHS = LAST_DAY '1' = "31" / >
< NUMBER of MONTHS = LAST_DAY '2' = "28" / >
< NUMBER of MONTHS = LAST_DAY "3" = "30" / >
< / YEAR >
< NUMBER YEAR = "2003" >
< NUMBER of MONTHS = LAST_DAY '1' = "31" / >
< NUMBER of MONTHS = LAST_DAY '2' = "28" / >
< NUMBER of MONTHS = LAST_DAY "3" = "30" / >
< / YEAR >
< / PRODUCING_ENTITY >
< / production >
< / well >
< / answer >
For the purposes of the practice, I have saved this in my table tdw_test_xml_files;
My goal is to get the /WELL/@uwi and /YEAR/@NUMBER
UWI YEAR
------ ---------------
102112900816W400 2009
102112900816W400 2010
102112900816W400 2011
102112900816W400 2012
100092900816U400 1999
100092900816U400 2000
100092900816U400 2001
100092900816U400 2003
I tried this... but I can't get the value of the attribute for the element < YEAR >
Select r.uwi, r.year
of tdw_test_xml_files.
XMLTABLE
(
"for $WELL in $ response/WELL/good.
for $DEPT to $UWIIDX in $WELL, Production, PRODUCING_ENTITY, YEAR
return < RESULT >
University of the West Indies West <>{fn:data($WELL/@uwi)} < / UWI >}
{
$WELL/production/PRODUCING_ENTITY/YEAR [$UWIIDX]-> (I don't know how to extract the value of the attribute here)
}
< / RESULT > '
passing FILECONTENT as 'GOOD '.
columns
UWI VARCHAR (50),
YEAR vARCHAR2 (24)
) r
/
If I do this; I get the Cartesian plan result set, which is not my goal
SELECT xtab.*, xtab2.*
OF tdw_test_xml_files, XMLTable (' for $i in/Response/Well)
Return $i"
PASSAGE filecontent
Uwi varchar2 COLUMNS (50) PATH'@uwi'
rn for ORDINALITE
) xtab
, XMLTable (' for $i in/Response/Well/Production/PRODUCING_ENTITY/YEAR)
Return $i"
PASSAGE filecontent
COLUMNS year varchar2 (50) PATH'@NUMBER'
) xtab2;
Any help will be highly appreciated thanks...I'm just curious to know how make the query now in unique XMLTable, not that I am forced by using x number of xmltable; - P, just look more clean...
Here goes:
SQL> SELECT x.* 2 FROM tdw_test_xml_files t 3 , XMLTable( 4 'for $i in /Response/Well 5 , $j in $i/Production/PRODUCING_ENTITY/YEAR 6 , $k in $j/MONTH 7 return element r { 8 $i/@uwi 9 , element year {data($j/@NUMBER)} 10 , element month {data($k/@NUMBER)} 11 }' 12 passing t.filecontent 13 columns uwi varchar2(50) path '@uwi' 14 , yr varchar2(4) path 'year' 15 , mon varchar2(2) path 'month' 16 ) x 17 ; UWI YR MON ------------------------------ ---- --- 102112900816W400 2009 1 102112900816W400 2009 2 102112900816W400 2009 3 102112900816W400 2010 1 102112900816W400 2010 2 102112900816W400 2010 3 102112900816W400 2011 1 102112900816W400 2011 2 102112900816W400 2011 3 102112900816W400 2012 1 102112900816W400 2012 2 102112900816W400 2012 3 100092900816U400 1999 1 100092900816U400 1999 2 100092900816U400 1999 3 100092900816U400 2000 1 100092900816U400 2000 2 100092900816U400 2000 3 100092900816U400 2001 1 100092900816U400 2001 2 100092900816U400 2001 3 100092900816U400 2003 1 100092900816U400 2003 2 100092900816U400 2003 3 24 rows selected
-
How to set the value of the xml node.
Hello
I have the PDF application can be entered by the user using the key. When sending
I use following code to set the value of the xml node.
XFA. Data.assignnode ("Employee.ID", "123", 0):
If its generators of xml as below.
< employee >.
< id > 123 / < ID >.
< / name >
< / employee >
Now, I need to generate xml as below.
< employee id = '123' >
< / name >
< / employee >
So, how together create the id of node as above?
Thanks in advance.
Kind regards
Dhiyane
Hi Dhiyane,
You must set contains the property if the node id to "metadata", i.e.;
xfa.data.assignNode ("employee.id", "123", 0);
XFA. Data.Employee.ID.Contains = 'metadata ';Very awkward, if you have a number of them, in which case you might want to look at using E4X.
Good luck
Bruce
-
How do reference a value in the ATTR5 column from a mapping FDMEE Script?
OK, I think I thought about it:
In Jython his:
fdmRow.getString ("ATTR5")
Post edited by: Robb Salzmann - figured it out. I thought I want to leave here in case someone else had the same question. Still available for other answers and suggestions :) points
Hello
There are a few points not specified in your question:
* How to reference the ATTR5 column in the strRecord mapping FDMEE Import Script argument?
-There are no FDMEE mapping import Scripts. You have FDMEE mapping of Scripts and Scripts to import FDMEE. They are different types of scripts
-strRecord is used in the Import Script. Is the 2nd parameter of the import script works... def funcname (param1, param2):
-ATTR5 is a column in table TDATASEG. It is accessible in the FDMEE mapping using fdmRow.getString("ATTR5") or simply ATTR5 scripts if you use #SQL mappings
If it was your original question, or you have any other problem?
Concerning
-
How to extract data from an arbitrary xml file and export it to a CSV friendly?
Hallo,
I am facing big problems in the use of XML files. I have a
application that generates XML files with clusters containing arrays
and scalars as in the example pasted below. My task is to
Read it and export the data into a CSV document readable by a human.
Since I do not know the actual content of the cluster, I need some sort
Smart VI through the XML looking for berries
and other data structures for export properly in the CSV file
format (columns with headers).
Thank you
3
6
0
1
2
3
4
5
3.14159265358979
Ciao
Rather than to get the
node, you can just go directly to the node since ' one that really interests you. Basically what it means to determine the elements of table how much you have, and it depends on if you have 1 or 2 knots . The rest is just of the child nodes and the next siblings. See attachment as a starting point. The attached XML file is a table 2D (change the .xml extension). Notes on the example:
- I did not close properly references, so it's something you need to do.
- It is limited to tables 1 d or 2D.
- I suggest using a control path of the file to specify the input XML file and path of the file/folder control to specify the location of the output file.
-
Hello
I have a problem to transfer content to an XML file in a MS SQL database through a stored procedure data/fixed. I am able to transfer the content of the file using method...
HSTMT = DBPrepareSQL (hdbc, EXEC usp_InsertReport "
... ");resCode = DBExecutePreparedSQL (hstmt);
resCode = DBClosePreparedSQL (hstmt);
... but in this case, I am not able to read the return value of the stored procedure.
I tried to follow the example of the stored procedure in the help documentation (DBPrepareSQL), but I miss a xml data type?
No idea how to solve my problem?
Cake of KR
DianaS salvation,
Thanks for your comments. During this time I found another way which fullfill my needs:
resCode = DBSetAttributeDefault (hdbc, ATTR_DB_COMMAND_TYPE, DB_COMMAND_TEXT);
sprintf (sz_SqlStatement, "DECLARE @TESTID INT EXEC @TESTID = usp_InsertReport ' SELECT 'RetVal' %s = @TESTID", sz_Buffer ");
HSTMT = DBActivateSQL (hdbc, sz_SqlStatement);While ((resCode = DBFetchNext (hstmt)) == DB_SUCCESS)
{
/ * Enter values in the record. */
resCode = DBGetColInt (hstmt, 1, & s32_TestId);
}resCode = DBDeactivateSQL (hstmt);
sz_Buffer is the content of the XML file.
Cake of KR
-
How to use resource element in the xml file in the workflow?
Good afternoon
In my workflow, I put a parameter of the attribute with the element of resource type and the value of the attribute is an xml file.
And I had a problem with xml files in my workflow, I would like to use the information in the xml file to store in the variable...
Example: in the xml file, I put some information about the number of VLAN ID, and in my script task, I would like to know how is used with myvariable.portgroup [0].spec.vlanId?
Best regards.
Like this:
var myXml = new XML(resource.getContentAsMimeAttachment().content);
You can then access your nodes like this:
myXml.node.subnode
Google for e4X to get the syntax complete.
-
How to access the values of the properties file
Hello
I use Jdeveloper 11.1.2.2
I need to get some of the values of the properties file to use in a java class.
How can I access the .properties file and the values in them.
Thank you
Nigel.Nigel,
If you are using FileReader, you must specify the actual path where the file is located. In your sample, the file must be in "/ foundation/model/am/view/Test.propeties". I guess that you don't have this access path on your system as it look like the path to your source folder.I use the ResourceAsStream like this:
Create a file de.hahn.testproxy.backingbeans.test.properties with the following content:Test=hallo Test2=world
the path is relative my source in the test project path.
Then, I implemented a listener like:
private static ADFLogger _logger = ADFLogger.createADFLogger(XxyyzzBean.class); public void propertiesTestListner(ActionEvent actionEvent) { // instead of using the de.hahn.testproxy.backingbeans.test.properties you have to use de/hahn/testproxy/backingbeans/test.properties InputStream asStream = this.getClass().getClassLoader().getResourceAsStream("de/hahn/testproxy/backingbeans/test.properties"); if (asStream == null) { // file not found _logger.info("file not found"); return; } Properties p = new Properties(); try { p.load(asStream); } catch (IOException e) { e.printStackTrace(); } if (!p.isEmpty()) { _logger.info("Properties: " + p.toString()); } }
and get the result if I bind the listener to a button in the user interface:
Properties: {Test = hallo, Test2 = world} And make sure that the Test.properties file is copied to the output directory.
Timo
-
How to get the number of a xml file in flash?
Hello
It comes to my XML file
<? XML version = "1.0"? >
< ArrayHolder >
< level1 > '1', '1', '1' < / level1 >
< level2 > 2,2,1,2,2 < / level2 >
< level3 > 1,3,3,3,1 < / level3 >
< / ArrayHolder >
I want to store level1 not in 'levelArray '.
Thank you
JaxNa
you always have a quote but once it is fixed, divide each value of the node on the commas and then loop in the table pouring each element to a number.
-
Complete textfield with a greater value to an xml file
Hi all, I have an actionscript by extracting data from an xml file. As you can see in the code below, I textFields have been created on the fly.
I need to have the 'resultsField' textfield to be filled by programming with the largest value of 'column1' or 'column2 '.
Thank you all for the great service!
--------------------- XML ------------------------
<? XML version = "1.0" encoding = "utf-8"? >
< cat >
< title >
USD
< /title >
< CAT >
0.5879
< / cat >
< CAT >
0.9875
< / cat >
< / cat >-ACTIONSCRIPT 2.0-
this.createTextField("column1",25,0,50,200,30);
this.createTextField("column2",25,325,50,200,30);
this.createTextField("resultsField",20,0,105,200,30);Column1.html = true;
Column2.html = true;
resultsField.html = true;var my_xml = new XML();
my_xml. OnLoad = {function (success)}If (success) {}
RootNode = my_xml.firstChild;
Column1.htmlText = RootNode.childNodes [1] .firstChild;
Column2.htmlText = RootNode.childNodes [2] .firstChild;trace (column1. (Text);
trace (column2. (Text);
} else {}
trace ("Buah!");
}};
my_xml.ignoreWhite = true;
my_xml. Load ("quotes.xml");
resultsField.htmlText = 'value here ';use:
This.createTextField("hello_txt",0,10,10,100,20) ("column1", this.getNextHighestDepth (), 0,50,200, 30);
This.createTextField("hello_txt",0,10,10,100,20) ("column2", this.getNextHighestDepth (), 325,50,200, 30);
This.createTextField("hello_txt",0,10,10,100,20) ("column3", this.getNextHighestDepth (), 0,80,200, 30);
This.createTextField("hello_txt",0,10,10,100,20) ("column4", this.getNextHighestDepth (), 325,80,200, 30);
This.createTextField("hello_txt",0,10,10,100,20) ("resultsField", this.getNextHighestDepth (), 200,125,200, 30);Column1.html = true;
Column2.html = true;
Column3.html = true;
column4.html = true;
resultsField.html = true;var my_xml = new XML();
my_xml. OnLoad = {function (success)}If (success) {}
RootNode = my_xml.firstChild;
Column1.htmlText = RootNode.childNodes [1] .firstChild;
Column2.htmlText = RootNode.childNodes [2] .firstChild;
Column3.htmlText = RootNode.childNodes [3] .firstChild;
column4.htmlText = RootNode.childNodes [4] .firstChild;resultsField.htmlText = maxF ([Number (stripF (column1.text)), Number (stripF (column2.text)), number (stripF (column3.tex t)), Number (stripF (column4.text))]);
trace (column1. (Text);
trace (column2. (Text);
} else {}
trace ("Buah!");
}};
my_xml.ignoreWhite = true;
my_xml. Load ("quotes.xml");function maxF(a:Array):Number {}
Max: var number = [0];
for (var i: Number = 1; i
If (a [i] > max) {}
Max = a [i];
}
}
maximum return;
}
function stripF(s:String):String {}
Return s.split("").join("").split("\n").join("").split("\r").join("");
} -
How to create ViewObject to generate the xml file?
Hello everyone...
People, I would like to know if it is possible to create a ViewObject to generate an xml file.
In other words, I have a database table and I need to generate an xml file based on this table.
Someone has already done it?
The ADF swing.
JDeveloper Studio 11.1.1.4.0.Hello
Try this link
Generate the xml file based on the java oracle table using jdeveloper 10 g
-
How do I download/save a local XML file
Hello, I'm developing a game of amateur video on Flex 4, which will be downloadable and execution in the local file system (such as "C:/Games/myGame/myGame.html"). I try to save and load the registry of players in an XML file, also locally (as 'C:/Games/myGame/records.xml).
So far, I was abled to load the file like this:
var loader: URLLoader = new URLLoader();
var request: URLRequest = new URLRequest ("records.xml");
var recordsXml: XML;
try {}
_ loader.load (request);
_ recordsXml = new XML (loader.data);
}
catch (...)
After that, I can then extracts the data perfectly recordsXml. However, I can't figure out what code to use to save changed data. I tried this:
var request: URLRequest = new URLRequest ("records.xml");
Request.Data = recordsXml.toXMLString ();
request.contentType = "text/xml";
Request.Method = URLRequestMethod.POST;
loader.dataFormat = URLLoaderDataFormat.TEXT;
try {}
_ loader.load (request);
}
catch (...)
The code runs without error, but the file is not updated. I tried to record data on a second, empy file records2.xml, but it does not work either.
What should I do? Thank you!
For web applications, you can use the FileReference class. This allows you to
Open a dialog box to the user to load an external file, or save it to their
computer. Here are more details:
http://help.Adobe.com/en_US/AS3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7cf8.html
Please note that this only works if the user triggers the action and
through the file dialog box. You can not save or load files without their
knowledge from a web application. A desktop AIR app is different and may
load/save files in the background.
iBrent
Maybe you are looking for
-
I want to uninstall the toolbar yahoo permanently, but the "Extensions" Manager is empty
I read many forums to support for how to uninstall the yahoo toolbar. Some suggested it uncheck the menu 'options', who is hiding, but does not remove it permanently (which I did). Others have said that the only way to permanently delete is to go to
-
Dear Sir. for a long time by mistake I deleted my friend contact from contact list so please kindly help back me Thank you
-
Component security update windows media player button does not work.
I tried to upgrade the safety component of windows media player when you place a digital copy of a movie, but does not have the button "upgrade". He sent me to this site: http://drmlicense.one.microsoft.com/Indivsite/en/indivit.asp is there a way I c
-
my pc hp in my computer does not display my CD-ROM/dvd-rom and with my CD and DVD are not recognize... .will help I don't know how it happens but my computer shows no dvd/cd rom section and with which the CD and the DVD does not play on my computer h
-
This program allows only a material that is not connected to the control computer.
When I try to install multimedia offers for thinking through the Lenovo Update Manager, I get the following message: "This program can only serve as a material that is not connected to this computer to control." Any help? [T61p Vista Ultimate 32 bit]