XML

20K

Solutions

9

Articles & Videos

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 am trying to create a Json object in C# that I will convert to XML.   I have a repeating set of Fees that I need to add to the json object.

Here is my code so far:

root.Deal.Fees = new ExpandoObject();
List<ExpandoObject> feeArray = new List<ExpandoObject>();

foreach (DataRow ro in ds.Tables["fees"].Rows)
{
    root.Deal.Fees.DealFees.Fee.Description = ro["fee_type"].ToString();;
    root.Deal.Fees.DealFees.Fee.Amount = ro["amount"].ToString();

feeArray.Add(root.Deal.Fees);
}

Open in new window


No sure what else is needed.   Supply a different example if that is easier for you.
Thank you
0
The Orion Papers
The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Hello!

I am writing a VB6 program to read an XML file.  The XML has encoding="UTF-8".

I have everything working with the exception of the embedded attachments.  There is a file name (jpg, doc, etc.) which I can pick up.  My problem is that the data element is just a bunch of characters.  Somehow I need to take the group of characters and convert it to a jpg or doc file.  

Does anybody know if this is possible,  and if so,  how is it done?

Thanks for your help!
0
I have  sun server that runs a local application that uses the following ports: JMS 5630, XML 9672,
ASP Http 80 and ASP https 443, i can only telnet to port 80, telneting to the other ports I get
unable to connect to remote host: connection refused. I checked the /etc/services and I do not see the ports listed.
BTW: This application used to work without problems...

Thanks
0
I'm getting "duplicate attribute" error when attempting to create this document.  Is it not allowed to have the multiple Filter Field entries?
Jean

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<ApiDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://microsoft.com/wsdl/types/">
  <Request>
    <Settings></Settings>
    <Filters>
      <Filter Field="FiscalDate" Operator="Greater than or equal" Value="2017-06-19T00:00:00.000" />
      <Filter Field="FiscalDate" Operator="Less than" Value="2017-06-20T00:00:00.000" />
      <Filter Field="Location" Operator="Equal" Value="100" />
    </Filters>
    <SortDescriptions>
      <SortDescription Name="FiscalDate" Direction="Ascending" />
    </SortDescriptions>
  </Request>
</ApiDocument>
0
Please help! I'm receiving a "Problems During Load" prompt when I try and open up my XML file. I am able to open it in NotePad, but I can't seem to get it open no matter what I do. I would really appreciate if someone could take a look!

I attached the file.
BCNMitosisCopy.xml
0
Dear experts,
I am facing a request from a customer, who maintains about 500 product sheets to different products. So far all the data were kept in Word and PDF files were made manually. Th maintenance was a nightmare and publishing online was nearly impossible.

Now the product sheets will be saved in a database / XML so that with help of some CSS libraries/frameworks (bootstrap etc.) site nice layout can be achieved while keeping the simplicity of editing content in a database and displaying the sheets online. For better reading and design reasons the sheets will contain TWO columns on normal screen and paper and 1 column only on mobile devices. This all is doable. Somehow.

However the next requirement is to be able to generate PDFs out of the same source (database/xml) and the PDF shall, of course, keep the layout for DIN A4 paper - header, footer, two columns, which flow always on first page from left column to right column and then on next pages again from left to right column. Like when you load a text in indesign for example. So that the PDFs when printed can be red.

Unfortunately the HTML page does not respect the fixed length of a DIN A4 paper and when showing two columns, they flow till the bottom of the page "infinitely".  When I tried to play with bootstrap for example, I was able to accomplish the HTML part, but then I was unable to either print it to PDF or even while using some PDF library to generate A4 standalone pages.

I hope I am expressing …
0
I have a problem serialializing xml

I do not get all 3 values of 'liggingen' back in the object. I only get the first value. I tried to make a list, but no success.
What is the error in the user defined object?

This is part of the user defined object
Public Class MatenEnLigging
        Public Liggingen As Liggingen
        Public Inhoud As Integer
        Public Oppervlakte As Integer
End Class

Public Class Liggingen
        Public Ligging As String
End Class

And this is part of the XML
<MatenEnLigging>
	<Liggingen>
        	<Ligging>aan bosrand</Ligging>
            	<Ligging>aan rustige weg</Ligging>
	        <Ligging>beschutte ligging</Ligging>
         </Liggingen>
	 <Inhoud>519</Inhoud>
	<Oppervlakte>150</Inhoud>
</MatenEnLigging>

Open in new window

0
I'm able to customize the Excel 2010 Ribbon, adding custom tabs/groups and hiding built-in tabs etc. as needed by using a CustomUI xml file.  I do this by starting the ribbon from scratch using:

 <ribbon startFromScratch="true">

... and then adding my own custom tabs/groups in the xml file.


What I would like to do is to leave the xml so the built-in ribbon is visible, for example, using:

 <ribbon startFromScratch="false">

but within the Excel application itself, use VBA code to hide (or remove) certain built-in Tabs from the Ribbon.

In other words, I'd like the VBA code to do the equivalent of:

 File > Options > Customize Ribbon > [select a Tab by name, e.g. 'Insert'] > Remove

The above steps can be done manually to get the desired result but I can't seem to find the VBA code to do it with.

Using SENDKEYS doesn't seem robust enough and only takes me a few steps into the File > Options > ... sequence before I'd have to resort to sending cursor control movements like cursor down, etc..
0
Hi all,

I am very new to working on XML data or files. I need to load data from below XML to a table in sql server. But i am unable to even parse it, i have tried few different methods like xquery and OpenXML but no luck. I am getting blank columns, i think i am not giving proper nodes to navigate to data. I am struggling with this since last 2 days :-(

XML:

 
 <?xml version="1.0" encoding="UTF-8" ?> 
- <Document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02">
- <CstmrDrctDbtInitn>
- <GrpHdr>
  <MId>999</MId> 
  <CDT>2017-06-01T04:59:46</CDT> 
  <NTxs>16</NTxs> 
  <CS>345.00</CS> 
- <InitgPty>
  <Nm>Ter Elst BVBA</Nm> 
- <Id>
- <PrvtId>
- <Othr>
  <Id>000000</Id> 
  </Othr>
  </PrvtId>
  </Id>
  </InitgPty>
  </GrpHdr>
- <PmtInf>
  <PmtInfId>317-0</PmtInfId> 
  <PmtMtd>DD</PmtMtd> 
  <NTxs>16</NTxs> 
  <CS>345.00</CS> 
- <PmtTpInf>
- <SvcLvl>
  <Cd>PA</Cd> 
  </SvcLvl>
- <LclInstrm>
  <Cd>RE</Cd> 
  </LclInstrm>
  <SeqTp>RCUR</SeqTp> 
  </PmtTpInf>
  <ReqdColltnDt>2017-06-01</ReqdColltnDt> 
- <Cdtr>
  <Nm>Ter Elst BVBA</Nm> 
  </Cdtr>
- <CdtrAcct>
- <Id>
  <IBAN>0000</IBAN> 
  </Id>
  <Ccy>EUR</Ccy> 
  </CdtrAcct>
- <CdtrAgt>
- <FinInstnId>
  <BIC>LXXX</BIC> 
  </FinInstnId>
  </CdtrAgt>
  <ChrgBr>SLEV</ChrgBr> 
- <CdtrSchmeId>
- <Id>
- <PrvtId>
- <Othr>
  <Id>000000</Id> 
- <SchmeNm>
  <Prtry>PA</Prtry> 
  </SchmeNm>
  </Othr>
  </PrvtId>
  </Id>
  </CdtrSchmeId>
- <DrctDbtTxInf>
- <PmtId>
  

Open in new window

0
( An extension of this question.. )

Given the below SQL Server 2008  T-SQL statement and XML fragment, how would I return the value 'Sammy Hagar' WHERE boo i:type="rockstar" ?
DECLARE @x XML 
SET @x = '<goo xmlns="http://underdog.com" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <foo>
   <boo i:type="fruit">banana</boo>
	<boo i:type="rockstar">Sammy Hagar</boo>
	<boo i:type="planet">Mars</boo>
	<boo i:type="movie">Heathers</boo>
	<boo i:type="practicaljoke">Rick Roll</boo>
  </foo>
</goo>'
;
WITH XMLNAMESPACES ('http://underdog.com' as d) 
SELECT @x.value('(/d:goo/d:foo/d:boo)[1]', 'varchar(64)') AS the_amount

Open in new window

0
Guide to Performance: Optimization & Monitoring
Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

< Highly mocked up SQL Server 2008R2 T-SQL >
DECLARE @x XML 
SET @x = '<goo xmlns="http://underdog.com" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <foo>
    <boo>banana</boo>
  </foo>
</goo>'
SELECT @x.value('(/goo/foo/boo)[1]', 'varchar(64)') AS the_amount

Open in new window


I'm expecting to return a the_amount value of 'banana', but I'm always getting NULL.  What's the fix?
0
Is it possible to check duplicate attribute values within same element using an XSD ?

For example:

<MyProduct  category="school" code="123">Pencil</MyProduct>
<MyProduct category="home" code="343">Vase</MyProduct>
<MyProduct category="home" code="752">Fork</MyProduct>
<MyProduct category="school" code="123">Eraser</MyProduct>

Open in new window


In the above example, a pencil and an eraser belong to same category and have same code. How can I control that no product ("MyProduct") can have same category *and* code?
(if possible)


Note: in above example, categories and codes have a specific list of values (i.e. I know I have 12 categories and 728 codes).
Thank you
0
I have to build an XSD and I need to have the following double conditions declared when I define an element.

1. For a given element, only a specific list of attributes is permitted. Example:

<MyElement  currency="USD" payment="online" other="today">some values here</MyElement>

Open in new window

I need MyElement to be allowed to have attributes only 'currency' and/or 'payment' but no 'other' .


1.1. For the ALLOWED attributes, I need to have a permitted list of values. Example:

<MyElement  currency="USD" payment="online">some values here</MyElement>

Open in new window

I need the 'currency' attribute to take only values USD, AUD.. etc as I specify in a list (I have a list ready)
And I need the attribute 'payment' to take one of the two values "online" or "cash".

How can I declare the MyElement in an XSD ?
Your help is much appreciated..
0
I have my XML file which was generated using Soap-UI and our testers are able to execute the test case by calling the api's from Soap-UI with out any issues. But when the same I integrated as a part of continuous integration using Maven I am not getting the result as expected. All of the test cases are failing

Here is the pom.xml I have
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.smartbear.samples</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Maven 2 SoapUI Sample</name>
<url>http://maven.apache.org</url>
<pluginRepositories>
    <pluginRepository>
        <id>SmartBearPluginRepository</id>
        <url>http://www.soapui.org/repository/maven2/</url>
    </pluginRepository>
</pluginRepositories>
<build>
    <plugins>
        <plugin>
            <groupId>com.smartbear.soapui</groupId>
            <artifactId>soapui-maven-plugin</artifactId>
            <version>5.0.0</version>
            <configuration>
            <outputFolder>logs</outputFolder>
            <printReport>true</printReport>
            <junitReport>true</junitReport>
              <projectFile>/MyApp/soapui-project.xml</projectFile>
            </configuration> 
            <dependencies>
                <dependency>
   

Open in new window

0
I have already make a "XML Maps" Mapping list under the XML Sources.
It works file when I do the XML import to the Excel sheet.

However, I would like to add the file name of the XML which imported to the excel.
Can anyone help me on this?

Enclosed with the Excel sheet with the mapping list included
https://drive.google.com/open?id=0B-cvVcO00sRvVldicS1kWFhGSGs
0
Hi,
I am very new to shell scripting and i want to do following
read a xml file to extract value of <not_matched> tag,
from each of <SQL_Analysis>,<Data_Analysis>,<Graph_Analysis>,<Excel_Analysis>,<Pdf_Analysis> tags and compare it against a some value and depending on the result say Pass or Fail.

Any help much appreciated.

XML file as below :
<Execution_Stats>
      <Total_Executions>1</Total_Executions>      
      <Total_Errors>0</Total_Errors>
      <SQL_Analysis>
            <NOT_COMPARED>1</NOT_COMPARED>
            <MATCHED>0</MATCHED>
            <NOT_MATCHED>0</NOT_MATCHED>
            <ERROR>0</ERROR>
      </SQL_Analysis>
      <Data_Analysis>
            <NOT_COMPARED>0</NOT_COMPARED>
            <MATCHED>0</MATCHED>
            <NOT_MATCHED>1</NOT_MATCHED>
            <ERROR>0</ERROR>
      </Data_Analysis>
      <Graph_Analysis>
            <NOT_COMPARED>1</NOT_COMPARED>
            <MATCHED>0</MATCHED>
            <NOT_MATCHED>0</NOT_MATCHED>
            <ERROR>0</ERROR>
      </Graph_Analysis>
      <Excel_Analysis>
            <NOT_COMPARED>1</NOT_COMPARED>
            <MATCHED>0</MATCHED>
            <NOT_MATCHED>0</NOT_MATCHED>
            <ERROR>0</ERROR>
      </Excel_Analysis>
      <Pdf_Analysis>
            <NOT_COMPARED>1</NOT_COMPARED>
            <MATCHED>0</MATCHED>
            <NOT_MATCHED>0</NOT_MATCHED>
            <ERROR>0</ERROR>
      </Pdf_Analysis>
</Execution_Stats>
0
I am having a SOAP API project in which I send the request in XML while calling the API from SOAP UI to create the account on portal. In return, I get the response in XML.

Now I want to change it to Web UI (Don't want to use SOAP UI). To do that I want to use HTML form which will have input fields like v1:type,company name etc (Currently, I pass the fields in XML request using SOAP UI) and while submitting the form, API should be triggered and parse the XML response to display on Web UI.

Note : I am also having the certificate (jks) for API in SOAP UI. where that certificate will I configure?

Please help me as I am very new in this area.

Below is the request and response.

Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v="abc.com" xmlns:v1="abc.com">
   <soapenv:Header>
      <v:vfExtendedHeader>
         <v1:traceIdentifier>
            <v1:applicationId>VSDM_PROVISIONING</v1:applicationId>
            <v1:serviceId>ARI_sis_${=new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(new Date())}</v1:serviceId>
            <v1:serviceInterfaceVersion>2.0</v1:serviceInterfaceVersion>
            <v1:timestamp>${=new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(new Date())}</v1:timestamp>
            <v1:referenceId>ARI_rid_${=new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(new Date())}</v1:referenceId>
            <v1:correlationId>NULL</v1:correlationId>
      

Open in new window

0
HI All,

We have got stuck at a task to convert csv to xml conversion. we have tried some VB script solution but that din't worked out.
PFA sample csv and sample xml output as required.sample1.csvsample1.xlsx
0
Hello,
I am trying to add a header and tabs with info about the XML data file to .xml file in SAS code. How exactly this can be done? Please see what I have currently I have for my SAS code. I can see the XML data file as my output but the Header (tab and tab2) with all info about the XML file does not show up yet in the XML file.
 
libname xmldir xmlv2 '/basepath/examples/XMLData.xml' xmltype=generic;

/* Req. 1: Macro variables to provide appropriate tab spacing. */
%let tab="    ";
%let tab2="        ";

/* Req. 2: XML file information and header*/
data _null_;
   file xmldir;
  
    put '<?xml version="1.0" encoding="UTF-8"?>';
    put '<Schema Name>';
    put &tab. '<Header>';
    put &tab2. '<SampleDate>2017-06-14</SampleDate>';
    put &tab2. '<CaseCount>30</CaseCount>';
    put &tab2. '<Action>Initial</Action>';
    put &tab2. '<YearPeriod>2017</YearPeriod>';
    put &tab. '</Header>';
    put &tab. '<Payload>';
run;

/* Req. 3: Writing two SAS datsets to xmldir library and creating XMLData.xml data file*/ 
data xmldir.dataname1(label="dataset name1 from sashelp library");
       set sashelp.dataset1(obs=10);
run;

data xmldir.dataname2(label="dataset name2 from sashelp library");
       set sashelp.dataset2(obs=20 keep=var1 var2); 
run; 

libname xmldir clear;

/* Req. 4: XML File End*/
data _null_;
   file xmldir mod;

    put &tab'<Payload>';
    put '</Schema Name>';
run;

Open in new window


So, currently only Req. 3 is working.
Any comments or suggestions will be greatly appreciated!
0
Free Tool: Port Scanner
LVL 8
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

I have task that need me to read an xml file that has been given to me. I've made some research, unfortunately I didn't find one that suit with my needs. I am using javascript to read the xml file. Is there any ways on how can I read the xml file using ftp? Your help is greatly appreciated.
0
I think I know the answer to my question but I am asking it anyway (I know one is file  - xdDoc.Load and one is string xdDoc.LoadXml etc)
I have a variable that contains an XML formatted string.
Normally I would load XML from a file, using the following code:
	set xdDoc = Server.CreateObject("MSXML2.DOMDocument.6.0")
         xdDoc.load(strSource)

Open in new window


But the foregoing code fails when I use a XML string.
The following code works for the XML string and why is that??
AM I using the correct version for "Microsoft.XMLDOM"
I know I am okay with "MSXML2.DOMDocument.6.0"

   set xdDoc = CreateObject("Microsoft.XMLDOM") 
   xdDoc.LoadXml(strSource)

Open in new window

0
We are in the process of rolling out Microsoft Enterprise Mode Site List Manager to our enterprise environment, but we were curious if it is possible to specify in the Enterprise Mode list that a URL/Domain can be opened with either IE11 or Edge?  The Enterprise Mode Site List Manager GUI allows to select either IE11 or Edge, but I was curious if there was a hidden syntax we could update the Enterprise Mode - XML file to allow both browsers to be used for a certain URL?
0
Hi,
  Using Access 2016   My xml ribbon is giving me an error on the line with :  SaveObjectAs, FileSaveAsCurrentFileFormat, FileOpen, TabNew, FileExit)
     Do not get these errors in 2010…
 Error:  
    Line:46
    Column: 14
    Error Code Ox80004005
    Failed to find Office control by ID
    ID: SaveObjectAs
Here is part of the  XML file:    
<tab idMso="TabInfo" visible="false"/>
    <tab idMso ="TabOfficeStart" visible="false"/>
    <button idMso="SaveObjectAs" visible="false"/>
    <button idMso="FileSaveAsCurrentFileFormat" visible="false"/>
    <button idMso="FileOpen" visible="false"/>
    <button idMso="FileCloseDatabase" visible="false"/>
    <tab idMso="TabRecent" visible="false"/>
    <tab idMso="TabNew" visible="false"/>
    <tab idMso="TabPrint" visible="false"/>
    <button idMso="FileCloseDatabase" visible="true"/>
    <tab idMso="TabHelp" visible="false"/>
    <button idMso="ApplicationOptionsDialog" visible="false"/>
    <button id = "OpenMainMenu" imageMso ="FileOpenDatabase" label = "Return to Main Menu" onAction = "OnButtonPress"  tag="MainMenu"/>    
    <button idMso="FileExit" visible="false" />

Thanks,
    Donna
0
Hey,

I checked a selfmade ebook with epub validator and it gives many errors:

ERROR      OEBPS/Text/KINDLE FINAL JUNE 2017_split_000.htm      36      2      Error while parsing file 'text not allowed here; expected the element end-tag'.
FATAL      OEBPS/Text/KINDLE FINAL JUNE 2017_split_000.htm      36      18      Fatal Error while parsing file 'The prefix "W" for element "W:WordDocument" is not bound.'.
ERROR      OEBPS/Text/KINDLE FINAL JUNE 2017_split_000.htm      -      -      Error while parsing file 'The prefix "W" for element "W:WordDocument" is not bound.'.




<w:WordDocument>
 
 
  <w:ActiveWritingStyle Lang="EN-GB" VendorID="64" DLLVersion="131078"
   NLCheck="1">1</w:ActiveWritingStyle>
  <w:ActiveWritingStyle Lang="EN-US" VendorID="64" DLLVersion="131078"
   NLCheck="1">1</w:ActiveWritingStyle>
  <w:ActiveWritingStyle Lang="DE" VendorID="64" DLLVersion="131078" NLCheck="1">1</w:ActiveWritingStyle>
 
 
 
  <w:HyphenationZone>21</w:HyphenationZone>
  <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
  <w:DisplayVerticalDrawingGridEvery>0</w:DisplayVerticalDrawingGridEvery>
 
 
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
 
  <w:LidThemeOther>DE</w:LidThemeOther>
  <w:LidThemeAsian>JA</w:LidThemeAsian>
  <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
  <w:Compatibility>






I would appreciate some help.

0
Hi

I am updating an XML file and using XML::LibXML

My attribute value that I am replacing is

DESCRIPTION="== Conversion Messages Start ==&#xA;&#xA;Message ID : INF11004 (31284-19308)&#xA;Description : An empty RBC is added..&#xA;&#xA;== Conversion Messages End ==&#xA;FTP to FTP"

When i try to substitute using the following code the data is not changed.
just trying to move the last line to the beginning line.

$AA =~ s/(.*)== Conversion Messages End ==(.*)/$2 $1== Conversion Messages End ==/;

Output is

== Conversion Messages Start ==

Message ID : INF11004 (31284-19308)
Description : An empty RBC is added..

 == Conversion Messages End ==
FTP to FTP


where it should be

FTP to FTP
== Conversion Messages Start ==

Message ID : INF11004 (31284-19308)
Description : An empty RBC is added..

 == Conversion Messages End ==


I believe its due to the line endings which is causing it to not get the first (.*)


not sure how to get the correct output.

Thanks for the help

Mike
0

XML

20K

Solutions

9

Articles & Videos

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).