Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

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

0
Receive 1:1 tech help
LVL 11
Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

hello everyone i create one app.config file store in appsettings multiple username and password ?how can i store ? i just see in appsettings key and value and mention also key=username and value=some-pcusername or but i didn't get anything.
                    foreach (var key in appSettings.AllKeys)
                    {
                       //here i want to code with help of storing username and passowrd in appsettings i want to get information of that system
                    }
thank you !
0
I am trying to get XML validation working for a SOAP server but I've run into a couple of issues.

XSD:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://p2p.thalesgroup.com/wsdl/status/xsd"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  elementFormDefault="qualified"
  attributeFormDefault="qualified"
  targetNamespace="http://p2p.thalesgroup.com/wsdl/status/xsd">
 
  <xsd:element name="Alive">
    <xsd:complexType>
      <xsd:annotation>
        <xsd:documentation>
          - Alive is sent periodically to verify the connection status
        </xsd:documentation>
      </xsd:annotation>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

Open in new window


XML:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:soap-enc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soap:Body><Alive/></soap:Body>
</soap:Envelope>

Open in new window


First Issue:
SOAP elements are not being recognized.
Validator Output: Cannot Find The Declaration Of Element 'soap:Envelope'., Line '1', Column '225'.
I found a Stack Overflow thread describing the same issue but the described solutions do not work for me.

Second Issue:
Even if I remove the SOAP elements, I still have a namespace issue.
Validator Output: Cannot Find The Declaration Of Element 'Event'., Line '1', Column '8'.
0
How I can show soap XML data as text in HTML5? Pre do not work anymore. I think?
0
Hello,
I want to show database text in my website but this text is a XML file structure. The browser shows this text as part of html.
How I can show this string as real text? So also <> nodes will shown as text?
0
I need a way of looping through an XML document and obtaining values using VB.net for the following: PHYSICALADDRESS:Street; PHYSICALADDRESS:city; PHYSICALADDRESS:state;TAXID:SSN;DOB:dob. I would like these values in seperate string variable so I can use later. See the attached XML document.
EX_sample_XML.txt
0
Hi I want to search the xml files like windows search option not with file name ,its is with xmls inner content as you know that window can allow us to search the  file with its inner content as well by putting the value in the search bar

Than need to copy the filtered file name in one variable using script

Any one can help
0
I have thousands of XML files that contain tags I need to swap. The tags are contained in the following tag:

<assessmentItem xmlns="http://www.imsglobal.org/xsd/imsqti_v2p1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p1  http://www.imsglobal.org/xsd/qti/qtiv2p1/imsqti_v2p1p1.xsd http://www.w3.org/1998/Math/MathML http://www.w3.org/Math/XMLSchema/mathml2/mathml2.xsd" identifier="choice" title="ABC1234567" adaptive="false" timeDependent="false">

Open in new window

I need to swap the identifier and title, or if swapping is too involved, I really just need the identifier to contain the value of the title.

However, further down in the file, are additional occurrences of both identifier= and title=, so I can't just find and replace them.

I'm not sure about the best process to go about here?
0
Hi All

I am clearly missing something here. I am trying to send calls to an API for a product called ServiceDeskPlus.

The operation name "ADD_REQUEST"  should be sent as a "POST attribute" with key "OPERATION_NAME".

The technician key should be sent as a "POST attribute" with key "TECHNICIAN_KEY".

Input is an XML string sent as a "POST attribute" with key "INPUT_DATA".

The full documentation page is found here.

The code I am using to create the Post Attributes is:
public void CreateSupportDeskItem(ref SupportItem supportItem, string clientCode = "")
        {
            string destinationUrl = Properties.Settings.Default.ServiceDeskEndPoint;
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(destinationUrl);

            string group = Properties.Settings.Default.ServiceDeskGroup;
            string status = Properties.Settings.Default.ServiceDeskStatus;
            string service = Properties.Settings.Default.ServiceDeskService;
            string technicianKey = Properties.Settings.Default.ServiceDeskAPIKey;

            string requestXml;

            if (string.IsNullOrEmpty(clientCode))
                requestXml = GenerateRequestXml(supportItem,
                                         group, status, service);
            else
                requestXml = GenerateRequestXml(supportItem, group, status, service, clientCode);

    

Open in new window

0
I have following xml
<root>
	<Telephone>
		<ElementNumber>2</ElementNumber>
		<ElementNumber>1</ElementNumber>
		<TelephoneNumber>7865554433</TelephoneNumber>
	</Telephone>
	<Telephone>
	<TelephoneNumber>68021212111</TelephoneNumber>
	</Telephone>
</root>

Open in new window


and following xjs logic:
var nodeTravelerContact = domReq.Root.SelectSingle("Telephone[ElementNumber ='1']/TelephoneNumber | Telephone[not(ElementNumber)]/TelephoneNumber");

if ((!nodeTravelerContact || !nodeTravelerContact.NormalizedText))
	false;
else
	return true;

Open in new window

     
      
I want my function to return true because it found a Telephone where ElementNumber=1 , but my variable returns false because it does not find match (specifically, because it's searching for first position which in this case = 2). I've used .SelectNode, .Select and it never traverses through ALL ElementNumber to find match.

Please advise.
0
Free Tool: ZipGrep
LVL 11
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

I need some help with a custom XML feed i need to work.

I need the feed below to only pull jobs which are tagged "careerbuilder". and then only show 120 of those posts.

At the moment, I have zero posts tagged with "careerbuilder" but it's still pulling 120 other posts.  How can i fix the code below, so that only posts tagged careerbuiler show up?.   the xml feed is found here

<?php
/**
 * Template Name: Custom CareerBuilder RSS Template - cretefeed
 */
 
$postCount = 120; // The number of posts to show in the feed
$posts = query_posts('showposts=' . $postCount, 'tag=careerbuilder');
header('Content-Type: '.feed_content_type('rss-http').'; charset='.get_option('blog_charset'), true);
echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
?>
<rss version="2.0"
        xmlns:content="http://purl.org/rss/1.0/modules/content/"
        xmlns:wfw="http://wellformedweb.org/CommentAPI/"
        xmlns:dc="http://purl.org/dc/elements/1.1/"
        xmlns:atom="http://www.w3.org/2005/Atom"
        xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
        xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
        <?php do_action('rss2_ns'); ?>>
<channel>
        <title><?php bloginfo_rss('name'); ?> - Feed</title>
        <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
        <link><?php get_permalink(); ?></link>
        <description><?php 

Open in new window

0
Importing XML files created everyday within a folder and subfolder created at 4:00 PM everyday Mon-Fri, within the folder is an XML file  with name convention exported 4:03PM which will need to be loaded to SQL table

 folder path : Z:\background-processarea\Outbound
 Subfolders Paths:
                                      Name                                                            DateModified                               Type
Z:\background-processarea\Outbound\BGP_1413656            1/8/2018 4:00PM                     File folder      
            Xx exported                                                                           1/8/2018 4:03PM                       XML
            Xx recorder-BGP-out-210307                                             1/8/2018 4:00PM                       XML  
Z:\background-processarea\Outbound\BGP_1412472            1/5/2018 7:00PM                     File folder
          Xx exported                                                                           1/8/2018 4:03PM                         XML
          Xx recorder-BGP-out-207020                                             1/8/2018 4:00PM                         XML  
Z:\background-processarea\Outbound\BGP_1412471            1/5/2018 4:00PM                     File folder
            Xx exported                                                                           1/8/2018 4:03PM                       XML
            Xx recorder-BGP-out-206848          …
0
I have to take 2 million rows from a Sql server table (extracting 20 fields from table )  and create XML in a predefined format .

Sql Server table has sample fields like ( ALL ARE STRING)
     ID , Name, Discipline, Asset, category ,CreationDate

 XML has to be created in some format which later need to be "loaded" into another SQL Database ( A software will read the XML and create Sql instruction to insert rows into a normalised database)

Category entries need to be validated against a picklist
The XML will have attributes like EquipName ( Which maps to Name in the input  databse ) ,  DocCreationDate ( The date conversion rule has to be applied here)
...... And more fields and rules

Any thoughts on how to handle this ? I am thinking of writing a .net utility for this . I have no working knowledge on ETL. But an open source free  ETL is good for this ?  

Any thoughts on a high level design of the utility  for this ? Especially considering the 2 million rows
0
Hi

I have a xml file and I need to sort some of the elements in it and can't figure out how to do it.

My structure is

<job>
      <OUTCOND NAME="AAP10151_AAP10221_AAP10151_AAP10122" ODATE="ODAT" SIGN="-"/>
      <OUTCOND NAME="AAP10151_AAP10224_AAP10151_AAP10122" ODATE="ODAT" SIGN="-"/>
      <OUTCOND NAME="AAP10151_AAP10223_AAP10151_AAP10122" ODATE="ODAT" SIGN="-"/>
      <OUTCOND NAME="AAP10151_AAP10122_AAP10151_AAB10021" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_AAP10151_AAP10931" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_AAP10151_AA020931" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_AAP10181_AAP10181" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_SINGLES_CY300035" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_LP408397_LP408725" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_AAP10151_AAB10021" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_AAP10151_AAP10931" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_AAP10151_AA020931" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_AAP10181_AAP10181" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_SINGLES_CY300035" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_LP408397_LP408725" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_AAP10151_AAB10021" ODATE="ODAT" SIGN="+"/>
      <OUTCOND …
0
I have to add an attribute to XML node with more than 10k records so whats the best way to transform XML document faster.

I have tried StAX parser which almost takes 4 min for adding an attribute and using SAX parser it should take 5 min.

Is there any other lib available to do it better or another way to do that please give your suggestions.

Sample Code :(Using STAX Parser)
XMLStreamReader r = factory.createXMLStreamReader(new FileInputStream(inputfile));

/*Start Writing document */

XMLOutputFactory xmlOutputFactory = XMLOutputFactory.newInstance();

XMLEventWriter xmlEventWriter = xmlOutputFactory.createXMLEventWriter(new FileOutputStream(outputfile), "UTF-8");

/*End Writing document */

int event = r.getEventType();

long startTime = System.currentTimeMillis();

        System.out.println("Started reading node from xml document....."+TimeUnit.MILLISECONDS.toSeconds(startTime));

int node1Cnt = 0,node2Cnt = 0,node3Cnt=0,node4Cnt = 0;

      while (true) {

      XMLEventFactory eventFactory = XMLEventFactory.newInstance();

            switch (event) {

            case XMLStreamConstants.START_DOCUMENT:

                 // System.out.println("Start Document.");

                  StartDocument startDocument = eventFactory.createStartDocument();

                  xmlEventWriter.add(startDocument);

                  break;

            case XMLStreamConstants.START_ELEMENT:

                              

                //Create Start node

          

Open in new window

0
Hi Experts,

I need to merge two xml files, having lack of experience with xml I am struggling here.

I have two xml files. One is original file and second xml file contains new updates to be made in original xml.

This is the original file. file1.xml

Now I have a new xml which contains new update to be done in first xml, please check file2.xml

Now I want to update first xml with the changes available in second xml, so the final xml should look like,
Output.xml

So basically my second xml contains only the changes to be added/ updated in original xml. I believe this should be easy for an expert. (By mistake I types hard earlier :)
Your help here is really appreciated.

Thanks
0
Here is the xml file

<Crew>
    <CrewMembers>
      <CrewMember>
        <CrewName ID="35124">JOHN DOE</CrewName>
        <CrewRole ID="7">Not Applicable</CrewRole>
        <CrewLevel>EMT-Paramedic</CrewLevel>
        <CrewSequence>1</CrewSequence>
      </CrewMember>
    
    </CrewMembers>

Open in new window


Here is the query

DECLARE @PRID_S varchar(10) set @PRID_S='48967264'

DECLARE @FILENAME VARCHAR(30) SET @FILENAME='c:\pcr\archive\'+@PRID_S+'.XML'
Declare @CrewName1 varchar(30)
Declare @Crew1 varchar(10) set @crew1='35124'

IF OBJECT_ID('tempdb..#tempDATA4') IS NOT NULL DROP TABLE #tempDATA4
CREATE TABLE #tempDATA4 (  CrewName1 VARCHAR(20))

INSERT INTO #tempDATA4
exec(
'declare @xml xml 
set @xml=(
  SELECT *
  FROM OPENROWSET(BULK'+ ''''+@FILENAME+''''+', SINGLE_BLOB) AS data
)

select 

@xml.value(''(/PCRDATA/Crew/CrewMembers/CrewMember/CrewName/ID='+ ''''+@Crew1+''''+', ''nvarchar(max)'') as CrewName')

SELECT TOP 1 @CrewName1=CrewName1 FROM #tempDATA4
print(@CrewName1)

Open in new window


The error I am getting is Unclosed quotation mark after the character string ') as CrewName'.  

what am I doing wrong

Thanks
0
How can I get the value statically only for first time and combine with XML node index iteration for RML Mapping(RDF)?
Here is an example,
<Message>
<Header>
         <Graph>54127</Graph>
</Header>
<Customers>
        <customer>
              <indication>1</indication>
              <name>customer1</name>
       </customer>
      <customer>
              <indication>2</indication>
              <name>customer2</name>
       </customer>
</Customers>
</Message>

now I want to combine graph value with an indication for RML mapping to generate the unique index.
for example, i need a combination like  (Graph value 54127 + indication value 1) so final output 541271
please give your kind suggestions.
0
I have to write a program that will parse the following attached file from weather underground. I am not a xml programmer and was wondering if someone could provide a sample to parse this xml file. The schema can be found at https://www.wunderground.com/weather/api/d/docs?d=data/forecast10day&MR=1 

Thanks
wuExample.txt
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE
LVL 5
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Hi,

I have the following scripts :


<?

$xml="<whmcsapi>
<action>getinvoice</action>
<result>success</result>
<invoiceid>242347</invoiceid>
<invoicenum></invoicenum>
<userid>25209</userid>
<date>2017-12-21</date>
<duedate>2018-01-11</duedate>
<datepaid>0000-00-00 00:00:00</datepaid>
<lastcaptureattempt>0000-00-00 00:00:00</lastcaptureattempt>
<subtotal>50.00</subtotal>
<credit>0.00</credit>
<tax>3.00</tax>
<tax2>0.00</tax2>
<total>53.00</total>
<balance>53.00</balance>
<taxrate>6.00</taxrate>
<taxrate2>0.00</taxrate2>
<status>Unpaid</status>
<paymentmethod>banktransfer</paymentmethod>
<notes></notes>
<ccgateway></ccgateway>
     <items>
                   <item>
                                <id>304494</id>
                                <type>Domain</type>
                                <relid>52025</relid>
                                <description>Domain Renewal - xxx.com - 1 Year/s (11/01/2018 - 10/01/2019)</description>
                                <amount>50.00</amount>
                                <taxed>1</taxed>
                  </item>
     </items>
<transactions></transactions>
</whmcsapi>";


$content .= '<table border="1" cellpadding="5" style="border-collapse: collapse;border: 1px solid #cacaca">';

$content .= '<tr><th colspan="2" bgcolor="thistle">ITEMS '.print_r($xml).'</th></tr>';
foreach ($xml['items']['item'] as $key => $value) {

  $content .= '<tr><td><b>Description</b></td><td>'.$value['description'].'</td></tr>';
  $content .=

Open in new window

0
I have the following code, I am trying to modify certain line in XML file but I have to do it with all the files in the directory and retain the original file name.

@echo off
setlocal EnableDelayedExpansion

set anotherVariable=yes

(for /F "delims=" %%a in (sampleCopy.xml) do (
   set "line=%%a"
   set "newLine=!line:?>=!"
   if "!newLine!" neq "!line!" (
      set "newLine=<?xml version="1.0" encoding="UTF-8" standalone="%anotherVariable%"?>"
   )
   echo !newLine!
)) > newFile.xml

Open in new window

0
We have a number of XML files that we have created Excel import templates for to extract specific fields. We have at least half a dozen users who have been upgraded to Windows 10, and NONE of us can now refresh these files. The process still works on computers that remain on Windows 7. We have a Windows 7 computer that is providing a temporary respite, but we need to get this problem resolved for the Windows 10 units. Any suggestions welcome. We know there is nothing wrong with the XML files as they still import fine on the Windows 7 boxes.
0
I want to generate RML file From XML.
Input data in XML format
and output as RDF RML File.
Input:
<Events> ...
 <Exhibition id="398">
 <Venue>STAM</Venue>
  <Location>
   <lat>51.076891</lat>
   <long>3.717222</long>
  </Location>
 </Exhibition> ...
</Events>

Output:

<#EventsMapping>
  rml:logicalSource [
    rml:source "http://ex.com/events.xml";
    rml:referenceFormulation ql:XPath;
    rml:iterator "/Events/Exhibition" ];

  rr:subjectMap [
    rr:template "http://ex.com/{@id}" ];
 
rr:predicateObjectMap [
    rr:predicate ex:location;
    rr:objectMap [
      rr:parentTriplesMap <#LocationMapping> ] ].

give me your kind suggestions for generating RML file from XML data and if possible suggest in java for the library if available.
Also, Suggestions accepted.
0
I created Java client codes using wsimport tool. I think I got this exception when generated code try to parse response
com.sun.xml.internal.ws.streaming.XMLStreamReaderException: unexpected XML tag. expected: {http://v.com/sc/bb/bos}cbo_v1Response but found: {null}cbo_v1Response
      at com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil.verifyTag(XMLStreamReaderUtil.java:203)
      at com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil.verifyTag(XMLStreamReaderUtil.java:211)
      at com.sun.xml.internal.ws.client.sei.ResponseBuilder$RpcLit.readResponse(ResponseBuilder.java:630)
      at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:110)
      at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
      at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:135)
      at com.sun.proxy.$Proxy21.cbo(Unknown Source)
      at com.mypn.Myservice.runTransaction(Myservice.java:168)
      at com.mypn.Myservice.run(Myservice.java:132)
      at com.mypn.Myservice.main(Myservice.java:33)

I got response message using JAXB and everthing is okay except that xmlns="" part is empty.
<cbo_v1Response xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="">

I have tested my client code on SoapUI and if i add value to xmlns tag that expected, it works fine

I am not able to change service response messages so do you know how to simply handle this exception.

Thanks.
0
Hello, I trying to get and populating items from my dreamfactory Api.
If i get the url and api key on the browser i see a JSON but when i do a client.ExecuteAsync<ListItems>(request,(response) => {Console.WriteLine(response.Content)});
I saw i retrieving a xml ... really confusing
I try a lot samples from RestSharp, Xamarin TodoRest samples ,... no one works and i thing probably is because i still without be sure about if is XML or JSON ... someone was work before with dreamfactory api and xamarin forms for cross-platform api ?
Will be really helpful if someone can advice me about whats happend.
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).