Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x

XML

20K

Solutions

13K

Contributors

Extensible Markup Language (XML) refers to the encoding of documents such that they can be read by both machines and humans. XML documents use tags to show the beginning and end of a set of data. XML is used extensively on websites to show volumes of data, and is the default for a number of office productivity suites. This topic includes discussions of XML-related technologies, such as XQuery (the XML Query language), XPath (the XML Path language), XSLT (eXtensible Stylesheet Language Transformations), XLink (the XML Linking language) and XPointer (the XML Pointer language).

Share tech news, updates, or what's on your mind.

Sign up to Post

I would like to do below tasks. Please help me if you know how.
If this is possible, I have one security question. with the codes below, when view code is opened, the xml location is shown, how can i make it not shown?
   

<script>
    function test()
    {
         1. enable bondName
	 2. take the bondState selected value (e.g. 'CA')
	 3. read the xml and get list of product(c:\\data\test.xml)
	 4. databind the xml result (Product) to 'bondName'
    }
</script>

<?xml version="1.0" encoding="utf-8"?>
<Surety>
  <SuretyLine>
    <Commercial>
      <Bond>
        <GeneralInformation UI="BondInfo">
		<State ID="bondState" PrefillValue="Yes">CA</State>
		<Product>A</Product>
	</GeneralInformation>
        <GeneralInformation UI="BondInfo">
		<State ID="bondState" PrefillValue="Yes">CA</State>
		<Product>B</Product>
	</GeneralInformation>
	<GeneralInformation UI="BondInfo">
		<State ID="bondState" PrefillValue="Yes">TX</State>
		<Product>C</Product>
	</GeneralInformation>
      </Bond>
    </Commercial>
  </SuretyLine>
</Surety>


<div class="form-group">
                            <label class="col-sm-4 control-label">Bond State</label>
                            <div class="col-sm-8">
                                <select class="select2" id="bondState" name="bondState" onchange="fnSaveSingleData(this.name, '1');test()" data-placeholder="Choose Bond State...">
                                    <option value=""></option>
                                    

Open in new window

0
Tech or Treat!
LVL 10
Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

using c#, is it possible to find all
assume i have xml file with over 1000 nodes below. I want to get the list of attitrbute called ID.
but I won't know where is the root. like tests or test.

I basically just want to loop xml to find all of the ID name, and then find t he element name.
once i get element name, then i want to fill in the value <ans>got it</ans>


and i
<tests>
<test id="id_name1">
   <ans id=id_ans1"></ans>
</test>
</test>
<test id="id_name2">
   <ans id=id_ans2"></ans></test>
</test>


</tests>
0
I have xml below, and If i just give you  'applicantFirstName' and the value is 'John'
how can we add
'John' into       <FirstName ID="applicantFirstName" PrefillValue="No">John</FirstName>?

based on two requirements

1. I will only pass you  Dictionary<string, string> e.g. <applicantFirstName,'john'>
2. You actually do not know the structure of xml except you know each element has "ID" attritbute. meaning that you pass 'applicantFfirstName'' only into xml, and try to find element, and add value (John) there.

so you won't be able to use linq like doc.Descendants("Applicant").FirstOrDefault()

Let me know if this is possible.

<Surety>
  <SuretyLine>
    <Commercial>
      <Bond>
        <GeneralInformation UI="BondInfo">
          <Name ID="bondName" PrefillValue="Yes">Contractor</Name>
          <State ID="bondState" PrefillValue="Yes">CA</State>
          
          <Code PrefillValue="Yes">888</Code>
          <Renew PrefillValue="Yes">
            <Year>1</Year>
          </Renew>
        </GeneralInformation>
        <Coverage>
          <Amount PrefillValue="Yes">15000</Amount>
          <Year PrefillValue="Yes">1</Year>
        </Coverage>
        <Applicant>
          <CompanyName ID="applicantCompanyName" PrefillValue="No"></CompanyName>
          <CompanyEntityType ID="applicantCompanyEntityType" PrefillValue="No"></CompanyEntityType>
          <CompanyTaxID ID="applicantCompanyTaxID"></CompanyTaxID>
          <FirstName 

Open in new window

0
Below codes is reading my xml Applicant
and try to find Element e.g. CompanyName (var element = doc.Descendants(update.Key).FirstOrDefault();)
But I try to find ID, how can i do that?
My goal is to find ID
like applicantCompanyName = update.value


public void CreateQuoteFile(Dictionary<string, string> changes)
        {
            string fileName = CreateXmlfile("CA");
            XDocument doc = XDocument.Load(fileCreateQuotePath+fileName);
            foreach (var update in changes)
            {
                var element = doc.Descendants(update.Key).FirstOrDefault();
                if (element != null)
                {
                    element.Value = update.Value;
                }
            }

            string fileNameNew = Guid.NewGuid().ToString() + ".xml";
            doc.Save(fileCreateQuotePath + fileNameNew);            
        }



<Applicant>
<CompanyName PrefillValue="No" ID="applicantCompanyName"/>
<CompanyEntityType PrefillValue="No" ID="applicantCompanyEntityType"/>
<CompanyTaxID ID="applicantCompanyTaxID"/>
<FirstName PrefillValue="No" ID="applicantFirstName">asdfasdf</FirstName>
<LastName PrefillValue="No" ID="applicantLastName"/>
<MiddleName PrefillValue="No" ID="applicantMiddleName"/>
<StreetName PrefillValue="No" ID="applicantStreetName"/>
<City PrefillValue="No" ID="applicantCity"/>
<State PrefillValue="No" ID="applicantState"/>
<Zip PrefillValue="No" ID="applicantZip"/>
<PhoneNo PrefillValue="No" …
0
Good Morning Experts,

I'm running into an issue trying to do an HTTP Post of XML data.  I know I'm messing up the syntax here, but can't figure out what should go where.  Here's what I have:

Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")
               
GetStringURL = "https://secure.efaxdeveloper.com/EFax_WebFax.serv?"
               
GetStringPost = "id=99999999&xml=" & strXML
           
objXMLHTTP.Open "POST", GetStringURL, False
           
objXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
               
objXMLHTTP.send GetStringPost
           
eFaxResponse = objXMLHTTP.responseText
               
Debug.Print eFaxResponse
   
Set objXMLHTTP = Nothing


The server is rejecting the post because it says it isn't receiving my user ID, which is 99999999 number.  The URL is supposed to go over as:

https://secure.efaxdeveloper.com/EFax_WebFax.serv?id=9999999999&xml=<the URL-encoded XML value goes here>

I know I have the various bits above in the wrong spots and the URL's probably not coming across as requested, but no matter how I move them around it doesn't seem to accept the post.

Any thoughts would be appreciated!

Thanks!

Tom
0
Hi, is it possible to sort xml data in a classic asp page using AJAX and querystrings??

xml code

<?xml version="1.0" standalone="yes"?>
<DocumentElement>
<Data>
<EnsembleID>23331</EnsembleID>
<BookCode>NWP-MV</BookCode>
<Issue>Aeon Financial 2019</Issue>
<LongBLPTicker>QZ3838484 Corp</LongBLPTicker>
<ShortBLPTicker>8570 JT Equity</ShortBLPTicker>
<LongPos></LongPos>
<StubPos>600000000</StubPos>
<SIV>0.927</SIV>
<Parity>91.95</Parity>
<Premium>0.173</Premium>
<IV>99.23</IV>
<LongPx>107.81</LongPx>
<PxChg>0.05</PxChg>
<TheoChg>0.03753</TheoChg>
<StubPrice>8.59</StubPrice>
<ShPxChgPer>0.001277</ShPxChgPer>
<SLH>0.009</SLH>
<CurDelta>0.32</CurDelta>
<ImpDelta>0.444</ImpDelta>
<TheoDelta>0.417</TheoDelta>
<FutHdg1>-14.13</FutHdg1>
<ImpVolCB>0.242</ImpVolCB>
<ImpVolStub>0.242</ImpVolStub>
<V90D>0.198</V90D>
<DPnL>0.4</DPnL>
<WPnL>3</WPnL>
<MPnL>1.2</MPnL>
<YPnL>-4.9</YPnL>
<NetPnL>16.8</NetPnL>
<DayTE>-0.1647</DayTE>
</Data>

Open in new window




Page code...


<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Summary</title>
<style>
table {
    border-collapse: collapse;
    width: 100%;
}

th, td {
	font-family:Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
    text-align: left;
    padding: 8px;
}
tr:nth-child(odd){
	font-family:Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size:10px;
	background-color: #eef6ff
	}
tr:nth-child(even){
	font-family:Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size:10px;
	

Open in new window

0
<Surety>
<SuretyLine>
<Commercial>
<Bond>
        <GeneralInformation UI="BondInfo">
          <Name ID="bondName" PrefillValue="Yes">C</Name>
          <State ID="bondState" PrefillValue="Yes">CA</State>         
        </GeneralInformation>              
        <Status>Online</Status>
</Bond>
<Bond>
        <GeneralInformation UI="BondInfo">
          <Name ID="bondName" PrefillValue="Yes">Z</Name>
          <State ID="bondState" PrefillValue="Yes">CA</State>         
        </GeneralInformation>              
        <Status>Online</Status>
</Bond>
<Bond>
        <GeneralInformation UI="BondInfo">
          <Name ID="bondName" PrefillValue="Yes">B</Name>
          <State ID="bondState" PrefillValue="Yes">FL</State>         
        </GeneralInformation>              
        <Status>Online</Status>
</Bond>
</Commercial>
</SuretyLine>
</Surety>

Open in new window


Above XML, if I give you Element Name Value = 'B' and State = "FL" and try to get the xml string and save into result.xml. How can I do that?


My end result should look like below:

<Surety>
<SuretyLine>
<Commercial>
<Bond>
        <GeneralInformation UI="BondInfo">
          <Name ID="bondName" PrefillValue="Yes">B</Name>
          <State ID="bondState" PrefillValue="Yes">FL</State>         
        </GeneralInformation>              
        <Status>Online</Status>
</Bond>
</Commercial>
</SuretyLine>
</Surety> 

Open in new window

0
1. How can get the list (element (State)))  filter by state if parameter is given e.g. (CA) order by State asc?
2. How can get the list (element (Name)) filter by Status = Online and state = "CA" order by Name asc?

3. How can get total count of Bond filer by state?
4. How can get total count of Bond filter by Status (e.g. Online)?

I would like to see in c#.

Thanks,


<Surety>
<SuretyLine>
<Commercial>
<Bond>
        <GeneralInformation UI="BondInfo">
          <Name ID="bondName" PrefillValue="Yes">C</Name>
          <State ID="bondState" PrefillValue="Yes">CA</State>         
        </GeneralInformation>              
        <Status>Online</Status>
</Bond>
<Bond>
        <GeneralInformation UI="BondInfo">
          <Name ID="bondName" PrefillValue="Yes">Z</Name>
          <State ID="bondState" PrefillValue="Yes">CA</State>         
        </GeneralInformation>              
        <Status>Online</Status>
</Bond>
<Bond>
        <GeneralInformation UI="BondInfo">
          <Name ID="bondName" PrefillValue="Yes">B</Name>
          <State ID="bondState" PrefillValue="Yes">FL</State>         
        </GeneralInformation>              
        <Status>Online</Status>
</Bond>
</Commercial>
</SuretyLine>
</Surety>

Open in new window

0
I am trying to create a custom xml file to deploy to Windows 10 machines via GPO. I have been following the steps I have found online.
1-I customized my start menu and taskbar
2-I exported startlayout using Powershell and the Export Start-Layout cmdlet

When I open the xml that I have exported, there are no taskbar settings or info about the apps I pinned to my taskbar. I am trying to gather the  AUMID and the Desktop Application Link Path info for specific apps like Snipping Tool. Any help or suggestions would be appreciated.
0
I would like to be able to format my xml as follows:-

<?xml version="1.0" encoding="utf-8"?>
<Items>
  <Item id="6A-T00">
   <Property id="ATTR-FUNCTIONAL CLASS NAME">FUNC-ATMOSPHERIC TANK</Property>
    <Property id="ATTR-PHYSICAL CLASS NAME"></Property>

  </Item>
 </Items>

Have tried

 l_id_tag_element := dbms_xmldom.createElement(l_domdoc,l_colDesc(i).col_name);
dbms_xmldom.setAttribute (l_attributes_element,'id',l_colDesc(i).col_name);

but I can't quite work out what is required to pass the value for the field.

Any help would be greatly appreciated
0
Free Tool: IP Lookup
LVL 10
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Hi Guys,

Please assist with comparing. If statement false...

xslt:
  <xsl:param name="roleNames">
    <n>billTo</n>
    <n>soldTo</n>
    <n>remitTo</n>
  </xsl:param>
  
    <xsl:template match="/">
     
      <xsl:if test="msxsl:node-set($roleNames)/n/* = 'soldTo'">
            <!-- do next-->
      </xsl:if>

Open in new window


Thank you Darius
0
example contrived for the question. Consider following XML sample. I am creating class for serializing and deserializing given sample. I have following classes as well.

In the XML, there could be multiple  Data element, which can either take a base 64 encoded string for its value or
it can take another XML document as its value. so, I created another property data, which is a list of type Data in the Document class.

Question: now my question is, what property should I have in my Data class, because I have to accommodate for both values that this
data element can take.

say for example if i have, in addition to classes below,
public class Data{
   [XmlAttribute]
  public Type { get; set; }  //enum type

  public Class AnotherDocument {get; set;}
}

I can construct the document object, as such, but I don't how to handle the case when type="PDF". Do i add another string property
to Data class? how can i set the value of Data element itself?  

var document = new Document();

document.dataList = new List<Data>{
      new Data {
          type = "XML",
          AnotherDocument = "some xml document"
   }
}

----------------------------------------------------------------

public class Document{
 [XmlElement("Data")]
  public List<Data> dataList { get; set; }
}
---------------------------XML sample ------------------------
<Document>
    <Data Type="PDF">
          base 64 encoded string
    </Data>
    <Data Type="XML">
         …
0
Hi guys,

Please assist. I need to keep xml output content as it is and change the root element in the output file only.

input:
<?xml version="1.0" encoding="utf-8"?>
<MasterXml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xml="http://www.w3.org/XML/1998/namespace" timeStamp="2017-10-11T05:21:13.9552739+01:00" schemaVersion="3.0">
  <Header>
 . . .

Open in new window


xslt:
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    exclude-result-prefixes="msxsl xsl">
  <xsl:output method="xml" omit-xml-declaration="no" indent="yes" />

  <xsl:template match="MasterXml">
    <XML>
      <xsl:apply-templates select="@* | node()"/>
    </XML>
  </xsl:template>

  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>

Open in new window



output:
<?xml version="1.0" encoding="utf-8"?>
<XML timeStamp="2017-10-11T05:21:13.9552739+01:00" schemaVersion="3.0"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Header xmlns:xsd="http://www.w3.org/2001/XMLSchema">
. . .

Open in new window


How to remove namespace from the Header?

Thanks
0
How to add Soap XML Access Origin in Header. Please provide some example code contain access origin header in soap xml api request.
0
I have complex xml that I always need to modify by myself.
Do u know any tools that can make the changes more efficient?
I can just parse to webpage and make change. That may be helpful
0
Looking for some help with TSQL syntax using FOR XML Explicit.  Creating a query where each account has a contact and an invoice flag but the change is creating additional rows to first set the invoice flag to 0 then create another account element this time with the invoice flag to 1.  Basically returning the same dataset with the invoice flag is the only element that changes.  The query below works great expect it puts the contact and invoice flag in the same Account body versus creating 2 Account body.  Any ideas of creating what I need based off the EXPECTED RESULTS XML FORMAT?

TSQL SYNTAX
select * into #tempPort
from (
select ClientAccountId
, ClientName
, ContactCode
, ContactType
, 0 as InvoiceFlag

from Table

union

select ClientAccountId
, ClientName
, ContactCode
, ContactType
, InvoiceFlag

from Table
)x

Open in new window

         
TSQL SYNATX FOR XML EXPLICIT
SELECT 1 as Tag,      -- this first one sets up structure only
       0 as Parent,
       NULL as [StaticName!1!StaticName],
       NULL as [Header!2!FileDate],
	NULL as [Header!2!DeleteContactsByOmission],
       NULL as [Body!3!DataType],
       NULL as [Account!4!ClientAccountId], 
       NULL as [Account!4!Name],
       NULL as [AssignContact!5!ClientContactId], 
       NULL as [AssignContact!5!InvoiceFlag],
       NULL as [Trailer!6!DataType],
       NULL as [Trailer!6!RecordCount]
            
UNION ALL      -- now setup the SubHeader line tag 2
Select 2,1, 'StaticData', 

Open in new window

0
I want to be able to detect few servlet names in an xml file.
I am attaching the xml file here.

I am trying to :

xmldata = [xml] (Get-Content "web.xml")

and then something on the lines of...

In file under <servlet> -> <servlet-name>

if servlet-name  PRSSO exists then $IsPRSSOEnabled = True else $IsPRSSOEnabled = False
if servlet-name PegaSSO exists then $IsPegaSSOEnabled = True else $IsPegaSSOEnabled = False
if Servlet-name SAMLSSO exists then $IsSAMLSSOEnabled = True else $IsSAMLSSOEnabled = False
if Servlet-name LDAP exists then $IsLDAPEnabled = True else $IsLDAPEnabled = False

I am trying to do this in powershell. As I am a toddler in powershell, any help would be greatly appreciated!

Thanks
Amrith
web.xml
0
I have a username and password for the real estates agent theysaid I have to call the web service and get a response but
How can I integrate to my theme in wordpress if u want to help me will be good or I can hire you too but I like to learn anny I wait for your answer guys thank you
0
here is my code that does nothing ??
Sub plireader()

    Dim Request As XMLHTTP
    Dim Parameter1 As String
    Dim Doc As DOMDocument60
   
    Parameter1 = "demo"
   
    Set Request = New XMLHTTP
    Set Doc = New DOMDocument60
    '"http://www.pli.edu/public/CEM/Service.asmx?op=CEMgetAttendence"
    With Request
        .Open "POST", "http://www.pli.edu/public/CEM/Service.asmx?op=CEMgetAttendence", False
        .setRequestHeader "Content-Type", "application/soap+xml; charset=utf-8"
        .send "company=" & Parameter1 'Name & Value of the Parameter
        Doc.loadXML .responseText
    End With
    Doc.loadXML Doc.Text
MsgBox Doc.XML
End Sub
0
[Webinar] Lessons on Recovering from Petya
LVL 10
[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

<?xml version = "1.0" encoding = "UTF-8" standalone = "yes" ?>
<!DOCTYPE bank
[
    
   <!ELEMENT bank (accounts,customers*)>
   <!ELEMENT accounts(savings_accounts,checking_account)> 
   <!ELEMENT savings_accounts (balance)>
   <!ELEMENT balance (#PCDATA)>
   <!ELEMENT checking_account (balance)>
   <!ELEMENT customers(name,address)>
   <!ELEMENT name (#PCDATA)>
   <!ELEMENT address (#PCDATA)>
   <!ELEMENT customer_accounts(#PCDATA)>
   <!ATTLIST saving_account ID CDATA #REQUIRED>
   <!ATTLIST checking_account ID CDATA #REQUIRED>
   <!ATTLIST Customer ID CDATA #REQUIRED>

]>

<bank>
   <accounts>
     <savings_accounts>
             <savings_account id="a1" interest="0.03">
             <balance>2500</balance>
              </savings_account>
   
             <savings_account id="a2" interest="0.03">
             <balance>15075</balance>
             </savings_account>
     </savings_accounts>
        <checking_accounts>
                <checking_account id="a3">
                <balance>4025</balance>
              </checking_account>
             <checking_account id="a4">
                <balance>-125</balance>
             </checking_account>
           <checking_account id="a5">
              <balance>325</balance>
            </checking_account>
       </checking_accounts>
   </accounts>
    <customers>
          <customer id="c1">
          <name>Ben Richerdson</name>
           <address>Park Drive 2</address>
          </customer>
      <customer id="c2">
     

Open in new window

0
I want to write a query in SQL which takes the Loading Area containing  <areaName>WCMEX</areaName> Duplicate it out and name the newly created one WCMEX1. Does any one know how to do that?

for example i have this.

<root xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <loadingAreas>
    <LoadingArea>
      <areaName>Antartic</areaName>
      <portId>0021</portId>
      <portName>Houston</portName>
    </LoadingArea>
      <LoadingArea>
      <areaName>WCMEX</areaName>
      <portId>0004</portId>
      <portName>Manzanillo, Mexico</portName>
    </LoadingArea>
  </loadingAreas>
</root>

And want this

<root xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <loadingAreas>
    <LoadingArea>
      <areaName>Antartic</areaName>
      <portId>0021</portId>
      <portName>Houston</portName>
    </LoadingArea>
     <LoadingArea>
      <areaName>WCMEX</areaName>
      <portId>0004</portId>
      <portName>Manzanillo, Mexico</portName>
    </LoadingArea>
    <LoadingArea>
      <areaName>WCMEX1</areaName>
      <portId>0004</portId>
      <portName>Manzanillo, Mexico</portName>
    </LoadingArea>
  </loadingAreas>
</root>
0
Hi guys, can you please advise how to use translator to upper case.
Please note I need to check attributes values as 'ID' or 'Id'.

input:
  <foo>
    <inner name="ID">
      <Identity>vAluE_1</Identity>
    </inner>
  </foo>

<!--or-->

  <foo>
    <inner name="Id">
      <Identity>VaLue_2</Identity>
    </inner>
  </foo>

Open in new window


path:
foo/inner/[@name='ID' or @name='Id']/Identity

Open in new window

with translator (does not working):
foo/inner/[@name='ID' or @name='Id']/translate('Identity','abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')

Open in new window

Thank you
Darius
0
<accounts>
<savings_accounts>
<savings_account id="a1" interest="0.03">
<balance>2500</balance>
</savings_account>
<savings_account id="a2" interest="0.03">
<balance>15075</balance>
</savings_account>
</savings_accounts>
<checking_accounts>
<checking_account id="a3">
<balance>4025</balance>
</checking_account>
<checking_account id="a4">
<balance>-125</balance>
</checking_account>
<checking_account id="a5">
<balance>325</balance>
</checking_account>
</checking_accounts>
</accounts>
<customers>
<customer id="c1">
<name>Ben Richerdson</name>
<address>Park Drive 2</address>
</customer>
<customer id="c2">
<name>Marc Wretcher</name>
<address>Mill Drive 75</address>
</customer>
<customer id="c3">
<name>Angel Steady</name>
<address>Lake Sight 15</address>
</customer>
</customers>

<customer_accounts>
<customer_account c_id="c1" ac_id="a2"/>
<customer_account c_id="c1" ac_id="a3"/>
<customer_account c_id="c2" ac_id="a4"/>
<customer_account c_id="c3" ac_id="a1"/>
<customer_account c_id="c3" ac_id="a5"/>
</customer_accounts>
</bank>

Open in new window

0
I have xml sample below.
and what I try to do is following:

1. Find State="CA" and name="Contractor"
2. If found, then List Option. In this case, it will have 2 <Option>
3. Inside of the <Option> I try to capture the whole row <Input Type="text" ID="licenseNo" Required="yes"></Input> e.g. and show in cshtml page. How can I do that?

I have c#/mvc application.

Thanks,

<?xml version="1.0" encoding="utf-8" ?>
<Surety>
  <SuretyLine>
    <Commercial>
      <Bond>
        <GeneralInformation UI="BondInfo"> 
        <Name ID="bondName" prefillValue="Yes">Contractor</Name>
        <State ID="bondState" prefillValue="Yes">CA</State>
        </GeneralInformation> 
        <AddtionalInformation>
          <Option>
            <Label>Please enter license no.</Label>
            <Input Type="text" ID="licenseNo" Required="yes"></Input>
          </Option>
         <Option>
            <Label>Please enter license no.</Label>
            <Input Type="textarea" ID="licenseNo2" Required="yes"></Input>
          </Option>
        </AddtionalInformation> 
      </Bond>
      <Bond>
        <GeneralInformation UI="BondInfo">
          <Name ID="bondName" prefillValue="Yes">Contractor</Name>
          <State ID="bondState" prefillValue="Yes">TX</State>
        </GeneralInformation>
        <AddtionalInformation>
          <Option>
            <Label>Please enter license no.</Label>
            <Input Type="text" ID="licenseNo" Required="yes"></Input>
          </Option>
     

Open in new window

0
Hello Experts,
When i use the code below(LoadXmlInv()) in validating events of every combo box my App. hang up the cursor go to the next combo box after many seconds (long time)
I've this Sub to load saved items to a list of  combo boxes
 Sub LoadXmlInv()
        ''##For Sorting the items in the combo box and in the same time loading the Xml file
        cbxMedH1.Items.AddRange(XElement.Load(Application.StartupPath + "\Investigations.xml").
        <Invest>.Select(Function(n) n.Value).OrderBy(Function(s) s).ToArray())
        cbxMedH2.Items.AddRange(XElement.Load(Application.StartupPath + "\Investigations.xml").
        <Invest>.Select(Function(n) n.Value).OrderBy(Function(s) s).ToArray())
        cbxMedH3.Items.AddRange(XElement.Load(Application.StartupPath + "\Investigations.xml").
        <Invest>.Select(Function(n) n.Value).OrderBy(Function(s) s).ToArray())
        cbxSurH1.Items.AddRange(XElement.Load(Application.StartupPath + "\Investigations.xml").
        <Invest>.Select(Function(n) n.Value).OrderBy(Function(s) s).ToArray())
        cbxSurH2.Items.AddRange(XElement.Load(Application.StartupPath + "\Investigations.xml").
        <Invest>.Select(Function(n) n.Value).OrderBy(Function(s) s).ToArray())
        cbxSurH3.Items.AddRange(XElement.Load(Application.StartupPath + "\Investigations.xml").
        <Invest>.Select(Function(n) n.Value).OrderBy(Function(s) s).ToArray())
        cbxGynH1.Items.AddRange(XElement.Load(Application.StartupPath + 

Open in new window

0

XML

20K

Solutions

13K

Contributors

Extensible Markup Language (XML) refers to the encoding of documents such that they can be read by both machines and humans. XML documents use tags to show the beginning and end of a set of data. XML is used extensively on websites to show volumes of data, and is the default for a number of office productivity suites. This topic includes discussions of XML-related technologies, such as XQuery (the XML Query language), XPath (the XML Path language), XSLT (eXtensible Stylesheet Language Transformations), XLink (the XML Linking language) and XPointer (the XML Pointer language).