header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
shrikumar
Points:220
Posts:0

1/31/2011 4:57:22 AM

Title: Filter the XML Data with Namespace


I have an urgent requirement of filtering the namespace based xml.

here is my xml



<DTS:Executable xmlns:DTS="www.microsoft.com/SqlServer/Dts" DTS:ExecutableType="MSDTS.Package.1">
  <DTS:Property DTS:Name="InitExpression">0</DTS:Property> 
  <DTS:Property DTS:Name="EvalExpression">1</DTS:Property> 
  <DTS:Property DTS:Name="AssignExpression">1</DTS:Property> 
  <DTS:Property DTS:Name="MaxConcurrent">1</DTS:Property> 
  <DTS:Property DTS:Name="ForceExecValue">0</DTS:Property> 
  <DTS:Property DTS:Name="ExecValue" DTS:DataType="3">0</DTS:Property> 
  <DTS:Property DTS:Name="ForceExecutionResult">-1</DTS:Property> 
  <DTS:Property DTS:Name="Disabled">0</DTS:Property> 
  <DTS:Property DTS:Name="FailPackageOnFailure">0</DTS:Property> 
  <DTS:Property DTS:Name="FailParentOnFailure">0</DTS:Property> 
  <DTS:Property DTS:Name="MaxErrorCount">1</DTS:Property> 
  <DTS:Property DTS:Name="ISOLevel">1048576</DTS:Property> 
  <DTS:Property DTS:Name="LocaleID">-1</DTS:Property> 
  <DTS:Property DTS:Name="TransactionOption">1</DTS:Property> 
  <DTS:Property DTS:Name="DelayValidation">0</DTS:Property> 
 </DTS:Executable>



I am loading the xml file through URLLoader and keep the xml values in xmlData
like

xmlData=new XML(urlLoader.data);

after that i am adding the namespace for xmlData


xmlData.addNamespace("DTS");
var DTS:Namespace = xmlData.namespace("DTS");


Now I am able to fetch all child node of Executable element by using following code


trace("creating  "+xmlData.children().@DTS::Property);
But my requirement is i need to fetch the data of some nodes, eg, I need the value of <DTS:Property DTS:Name="MaxConcurrent">1</DTS:Property> by using @name="MaxConcurrent" property. But i don't know how to do filter like that. If anyone worked one namespace xml file, please let me know how to make filter the namespace XML FYI: I need similar output http://www.java2s.com/Code/Flash-Flex-ActionScript/XML/AlistofemployeeswhoseIDnumberis238.htm (but in this example, they used the xml without namespace)




Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 8+3 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions