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

Hi,

I ran a Nessus scan on a PC and I found the attached vulnerability: Microsoft XML parser (MSXML) and XML Core Services Unsupported.

The solution provided by NEssus is to upgrade the sw package responsible for the unsupported DLL versions or upgrade to a supported version of Windows. Alternatively, Uninstall the outdated MSXML or XML Core Services.

Can you help me find out:

A. What is using MSXML? (What software?)
B. How do yo uninstall MSXML?
C. How do you upgrade it?

Thank you.
Microsoft-XML-Parser.PNG
0
Command Line Tips and Tricks
Command Line Tips and Tricks

The command line is a powerful tool at the disposal of every Linux user. Although Linux distros come with beautiful user interfaces, it's worthwhile to learn the command line because it allows you to do a number of things that you otherwise cannot do from the GUI.  

ab= [['name Belgian Waffles', 'price $5.95', 'description Two of our famous Belgian Waffles ', 'calories 650'] ]

I would like to parse this list to an CSV file in the table format

Ex. :
name                       price                      description                                                    Calories
Belgian Waffles      $5.95                     Two of our famous Belgian Waffles         650


Note : List size may vary . The values can vary . No hard coding should be there
0
Hi Experts,

I'm trying to remove any characters before '/' including character '/'. Final value without white-space.

input:
<inner>L3 C / 371314 8</inner>

Open in new window

expected output:
<inner>3713148</inner>

Open in new window

This is my try (not working)
<xsl:value-of select="substring-after(/, substring-before(/, substring(translate(/, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', ''), 1, 1)))" />

Open in new window


Thank you
Darius
0
I see alert message "Process cannot access the file because it is being used by another process".
when I click the button at third time. It seems reading is okay. but when i click the button to write something inside  to the xml.
it fails. how can i resolve this issue?

I know the  "Process cannot access the file because it is being used by another process". continue to happen the new message is sent.
sendMsg_Click(), but that does not mean the issues came from there.

And I check all controllers I used, and when the file is opened, it is closed immediately.

  protected void Page_Load(object sender, EventArgs e)
        {
            phoneNoList.DataSource = Utility.Controller.GetUniquePhoneNo(fromPhoneNo);
            phoneNoList.DataBind();
}

  protected void sendMsg_Click(object sender, EventArgs e)
        {
		 #region add a record to all message xml
                Domain.User u = new Domain.User();
                u.fullName = fullName.Text;
                u.from = "+1" + fromPhoneNo;
                u.to = "+1" + toPhoneNo.Text;
                u.body = body.Text;
                u.dateTimeSent = DateTime.Now.ToString();
                u.direction = "outbound-reply";
                string result = Utility.XML.Add(Utility.Controller.filePathUserMessagesAll, u);
                #endregion


}

  public static string Add(string inputFilePath,Domain.User u)
        {
            XDocument doc = XDocument.Load(inputFilePath);
            XElement user = 

Open in new window

0
when we upgrade the report to our new server the xml export stopped working.

I've been trying t troubleshoot but since i'm not to familiar with xslt transformations i'm having a hard time finding the problem.

I think the problem is with name spaces.
if i use this code i got from here i can get the entire xml to export
</xsl:template>
    <xsl:template match="node()">
        <xsl:copy>
            <xsl:copy-of select="@*"/>
            <xsl:apply-templates select="node()"/>
        </xsl:copy>
    </xsl:template>

but when i try to match a specific node it fails.

my original xml without the transformation comes out like this:
<?xml version="1.0" encoding="UTF-8"?>
<Report xmlns="Logos_x0020_Export_x0020_Report" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="Logos_x0020_Export_x0020_Report http://reportserver?%2FLogos%20Export%20Report&rs%3AFormat=XML&rc%3ASchema=True" Name="Logos Export Report">
   <Tablix1>
      <Textbox15>
         <Textbox19 />
      </Textbox15>
      <Group2_Collection>
         <Group2>
            <Group1_Collection>
               <Group1 Group1="PB2017-1886&amp;#xD;&amp;#xA;">
                  <NamePaidby1 NamePaidby1="INTERIOR ENVIRONMENTS&amp;#xD;&amp;#xA;48700 ADDRESS City ST 111111" PaymentType="Check Number: " CheckNumber="30000" TotalAmount="167.00">
                     <Details_Collection>
                        <Details Description="Initial Plan Review Fee" …
0
Hi Guys,

 I am using xslt ver1(mapping) to create output xml file with simple value change.
The node() is matching all text, element, processing instructions... And attributes (@*) of the current context.

How to get small change in the thousands lines. Please advice

  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:choose>
        <xsl:when test="../.../node">
          <xsl:text>text</xsl:text>
        </xsl:when>
        <xsl:otherwise>
          <xsl:apply-templates select="@* | node()"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:copy>
  </xsl:template>

Open in new window


Thank you
Darius
0
I have xml codes below and want to achieve two goals

1. Load XML into MS SQL Table.
2. I want to use the <Element> name as field name so I do not have to create new ms table in advance.

so the table structure will look like below
GetCarriersPlansBenefitsResponse
ExtensionData
RequestId
Plans
Plan
PlanId
State
and etc.

and the xml has around 50+ k records.

<?xml version="1.0" encoding="utf-8"?>
<GetCarriersPlansBenefitsResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ExtensionData/>
<RequestId>208793868asdfasdf</RequestId>
<PodId>ws_V2_A2_S2asdfasd</PodId>
<TotalMilliseconds>5145sdfads</TotalMilliseconds>
<LoadSequenceId>5392823432</LoadSequenceId>
<Carriers>
	<Carrier>
		<Version>1.0</Version>
	</Carrier>
	<Plans>
		<Plan>
			<PlanId>123</PlanId>
			<State>CA</State>
		</Plan>
	</Plans>
</Carrier>

Open in new window

0
I need to display HTML report from and XML response in ASP.NET application.
Say, I have a default.aspx page and in the default.aspx.cs page, I use a web client to make a request and get a response.
once i get a response (sample below), how should I read/display the embedded Html report from my XML response file in default.aspx page.

<Response>
    <htmlreport><![CDATA[<html>
        <head/>
        <body/>
        </html>
     ]]>
    </html>
</Response>
0
newbie API developer here!  I created a .NET web API with XML payload--just a GET. I can run and use it on localhost. I built the solution, converted the folder to an app in IIS, but get a 404 error in the browser from my client using the external address. So https://localhost:60332/api/contact works on the dev server, but not https://my.domain.com/api/contact

What am I missing?
0
<document>
 <component>
  <structuredBody>
   <component>
    <section>
     <title>Title A</title>
     <text>Some Text</text>
      <component>
        <section>
        <title> Subsection of Title A</title>
         <text> Some Text of Subsection </text>
        </section>
      </component>
     <component>
        <section>
        <title> Subsection 2 of Title A</title>
         <text> Some Text of Subsection </text>
        </section>
      </component>
     <component>
        <section>
        <title> Subsection n of Title A</title>
         <text> Some Text of Subsection </text>
        </section>
      </component>
    </section>
   <component>
        <section>
        <title>Title B</title>
         <text> Some Text  </text>
        </section>
      </component>
   </component>
  </structuredBody>
 </component>
</document>

Open in new window






// my xsl, currently trying doing the template on the title , not sure if its the right way to go
<xsl:template match="v3:title">
  <xsl:element name="h{$sectionLevel}">
			<xsl:if test="$sectionLevel = '1'">
				<xsl:attribute name="style">font-size:1.5em;</xsl:attribute>
			</xsl:if>
			<xsl:if test="$sectionLevel = '2'">
				<xsl:attribute name="style">font-size:1.3em;</xsl:attribute>
			</xsl:if>
			<xsl:if test="$sectionLevel = '3'">
				<xsl:attribute name="style">font-size:1.2em;</xsl:attribute>
			</xsl:if>
			<xsl:if test="$root/v3:document[v3:code/@code = '3565717']">
				<xsl:attribute name="style">display: inline;</xsl:attribute>
			</xsl:if>
			<xsl:apply-templates select="@*"/>
		</xsl:element>
  <xsl:number format="1. " level="any"/>  //the problem is that it counts every title, including the child nodes which I dont want
  <xsl:value-of select="position()"/>  //All sections are 1. and doesn't count up
</xsl:template>

Open in new window


1. Title A
  Some text with information...
 2. Subsection
   Some text with information...
 3. Subsection
  Some text with information...
 4. Subsection
  Some text with information...
   5. Sub subsection
     Some text with information...
    6. Sub sub subsection
      Some text with information...
7. Title B
 Some text with information...


I have an XML that looks like this, there will be main sections, but there may be n subsections. I am having trouble getting the Xpath to get numbered sections. In the above example, it should look like this:

1. Title A
  Some text with information...
 1.1 Subsection
   Some text with information...
 1.2 Subsection
  Some text with information...
 1.3 Subsection
  Some text with information...
   1.3.1 Sub subsection
     Some text with information...
    1.3.1.1 Sub sub subsection
      Some text with information...
2. Title B
 Some text with information...

I havent been able to figure out the Xpath/count/position thing for the autonumbering. The main sections have heading h1, while subsections are h2, sub subsections are h3, etc... The subsections vary, some may or may not have any at all.
0
What does it mean to be "Always On"?
LVL 4
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

I can't  create a Project on TFS 2017 with a custom process template.

i get this error log from the server

The following element contains an error: PortfolioBacklog(Microsoft.EpicCategory)/States. TF400587: This element defines the states for work items that appear on your backlog. Each state must exist in at least one of the work item types belong to category defined in: 'PortfolioBacklog(Microsoft.EpicCategory)/States'. The following state does not exist in any of the work item types: Committed, Test.
[08:09:49.777]   The following element contains an error: PortfolioBacklog(Microsoft.FeatureCategory)/States. TF400587: This element defines the states for work items that appear on your backlog. Each state must exist in at least one of the work item types belong to category defined in: 'PortfolioBacklog(Microsoft.FeatureCategory)/States'. The following state does not exist in any of the work item types: Committed, Test.
[08:09:49.777]   The following element contains an error: RequirementBacklog/States. TF400587: This element defines the states for work items that appear on your backlog. Each state must exist in at least one of the work item types belong to category defined in: 'RequirementBacklog/States'. The following state does not exist in any of the work item types: InProgress, Test.
[08:09:49.777]   The following element contains an error: TaskBacklog/States. TF400587: This element defines the states for work items that appear on your backlog. Each …
0

Below is my code.
Web-sphere context path is set to simple slash /.

xml


<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
 version="3.0">
 <servlet>
    <servlet-name>RestServlet</servlet-name>
    <servlet-class>javax.ws.rs.core.Application</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>RestServlet</servlet-name>
    <url-pattern>/users/*</url-pattern>
</servlet-mapping>
</web-app>

Open in new window



appln

package com.ibm.jaxrs.sample;

import java.util.HashSet;
import java.util.Set;

import javax.json.JsonWriter;
import javax.ws.rs.ApplicationPath;

@ApplicationPath("/users")
public class HelloWorldAppConfig extends javax.ws.rs.core.Application {
	   
	   public Set<Class<?>> getClasses() {
	      HashSet<Class<?>> set = new HashSet<Class<?>>();
	      set.add(HelloWorldResource.class);
	      System.out.println("Completed application getclasses");
	      return set;
	   }

}

Open in new window



resource

package com.ibm.jaxrs.sample;

import javax.ws.rs.core.*;
import javax.ws.rs.*;
import javax.servlet.http.HttpServletRequest;

import javax.ws.rs.core.Application;

@javax.ws.rs.Path("/show")
public class HelloWorldResource {

	private static final String LINK_SELF = "self";
	public HelloWorldResource() {
		// TODO Auto-generated constructor stub
    	System.out.println("Got inside constructor");
	}
	
	@GET
	@POST
    @Produces(MediaType.TEXT_PLAIN)
	@Path("/show")
    public Response getAll(@Context UriInfo uriInfo) {
		System.out.println("Completed application getsingleton");
        return Response.ok("Hello").build();
    }//@Produces( MediaType.APPLICATION_JSON )
	
 }

Open in new window



included jars in WEB-INF\lib foler


com.ibm.jaxrs2.0.thinclient_9.0.jar
com.ibm.jaxws.thinclient_9.0.jar
com.ibm.ws.ejb.portable_9.0.jar
com.ibm.ws.ejb.thinclient_9.0.jar
com.ibm.ws.jaxrs20.tools.jar
cxf-rt-frontend-jaxrs-3.1.12.jar
cxf-rt-rs-client-3.1.12.jar
cxf-rt-rs-extension-providers-3.1.12.jar
cxf-rt-rs-extension-search-3.1.12.jar
cxf-rt-rs-json-basic-3.1.12.jar
javax.ws.rs-api-2.0.jar

Open in new window

0
I am part of a development for a SOAP web services client on WCF/.NET. After a session of sending request, team for server side left feedback "extend someAction from schema i am mentioning below", and mentioned an URL. In this context, what does it mean to extend from schema?
0
Last year I setup a Group policy to set file associations it worked. (basically this https://4sysops.com/archives/default-file-associations-in-windows-10/, export the xml file and deploy it through Group policy Now its not working anymore. The only association I am setting is .PDF to Adobe Reader vs Edge. I am using "Set a default associations configuration file" Setting ( Have attached the XML file) . I have run an RSOP and see the policy applying and even see the entry in the registryThe problem is on Windows 10 703 its just not working the PDF setting is still set to Edge. What I've found is that if I login as a user it doesn't work, if I log off and back on the next login it applies (even though its a machine not a user policy) We are a school without assigned machines so the logins are almost always first time is there any way to get this policy to apply the first time?
AppAssoc.xml
0
Resp_7812.xml
I try to get columns from a XML file. I have attached it in here.
The code is as follows:

declare
c_xml     xmltype;
begin
      c_xml := xmltype('<?xml version=''1.0'' encoding=''utf-8''?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <env:Header/>
  <env:Body>
    <srvc:returnActStateByEgnResponse xmlns="http://curr_state_egn/CURR_STATE_EGNService" xmlns:srvc="http://curr_state_egn/CURR_STATE_EGNServiceService">
      <srvc:result>
        <consents_tblType>
          <item>
            <req_id>112</req_id>
            <purpose_code>CC0100</purpose_code>
            <consent_state>0</consent_state>
          </item>
          <item>
            <req_id>112</req_id>
            <purpose_code>CC0200</purpose_code>
            <consent_state>1</consent_state>
          </item>
          <item>
            <req_id>112</req_id>
            <purpose_code>CC0300</purpose_code>
            <consent_state>0</consent_state>
          </item>
        </consents_tblType>
      </srvc:result>
    </srvc:returnActStateByEgnResponse>
  </env:Body>
</env:Envelope>');

      FOR consents_tblTypes IN
        ( SELECT
              p_req_id            
              , p_purpose_code    
              , p_consent_state    
          FROM  xmltable(
                    XMLNamespaces(
                       …
0
I need to create the root element of which is not available template in the input

XML I used as:

    <Body>
    <p outputclass="Body_Text">AAAA.</p>
   
    <p outputclass="Normal"><b>Q:</b> Why?</p>
    <p outputclass="Body_Text_Question"><b>Q:</b> What?</p>
    <p outputclass="Body_Text_Answer"><b>A:</b> In.</p>
    <p outputclass="Body_Text_Answer">The</p>
   
    <p outputclass="Normal"><b>Q:</b> Why?</p>
    <p outputclass="Body_Text_Question"><b>Q:</b> What?</p>
    <p outputclass="Body_Text_Answer"><b>A:</b> In.</p>
    <p outputclass="Body_Text_Answer">The</p>
    </Body>

XSL I used:

    <xsl:template match="p[@outputclass='Body_Text']">
        <para>
          <xsl:apply-templates/>
        </para>
      </xsl:template>
     
        <xsl:template match="p[@outputclass='Normal']">
        <item num="{replace(node()[1], '^\s+', '')}">
          <para><xsl:apply-templates select="node()[position() gt 1]"/></para>
        </item>
      </xsl:template>
     
      <xsl:template match="p[@outputclass='Body_Text_Question'][b]">
        <item num="{replace(node()[1], '^\s+', '')}">
          <para><xsl:apply-templates select="node()[position() gt 1]"/></para>
        </item>
      </xsl:template>
     
      <xsl:template match="p[@outputclass='Body_Text_Answer'][b]" priority="10">
        <item num="{replace(node()[1], '^\s+', '')}">
          <para><xsl:apply-templates select="node()[position() gt 1]"/></para>
        …
0
I want to remove the empty space &lt;p&gt; element using XSL:

XML I'm having:

        <Body>
          <p> </p>
          <h1>AAA</h1>
       <p>aaa</p>
      </Body>

XSL I Used:

   <xsl:strip-space elements="p"/>

   <xsl:template match="Body">
      <xsl:copy>
         <h1><xsl:value-of select="h1[normalize-space()]" separator=" "/></h1>
         <xsl:apply-templates select="@*|node()"/>
      </xsl:copy>
   </xsl:template>

   <xsl:template match="h1"/>

   <xsl:template match="p[not(normalize-space())]"/>

Output I'm getting like:

        <Body>
          <h1>AAA</h1>
              <p> </p>
              <p>aaa</p>
            </Body>

Expected output be like:

        <Body>
          <h1>AAA</h1>
              <p>aaa</p>
            </Body>
            
Need to remove the empty space para tags. Please suggest code. Thanks in advance
0
I want to generate sublist for specific

Mysource

    <p class="l1">   (a)<tab/>blah blah</p>
    <p class="l1">   (b)<tab/>blah blah</p>
    <p class="l1">   (c)<tab/>blah blah</p>
    <p class="l2">   (i)<tab/>blah blah</p>
    <p class="l2">   (ii)<tab/>blah blah</p>
    <p class="l2">   (iii)<tab/>blah blah</p>
    <p class="l2">   (iv)<tab/>blah blah</p>


xslt used:

    <xsl:template match="p[@outputclass='l1']">
        <item num="{replace(node()[1], '^\s+', '')}">
          <para><xsl:apply-templates select="node()[position() gt 2]"/></para>
        </item>
      </xsl:template>
    <xsl:template match="p[@outputclass='l2']">
        <item num="{replace(node()[1], '^\s+', '')}">
          <para><xsl:apply-templates select="node()[position() gt 2]"/></para>
        </item>
      </xsl:template>
    <xsl:template match="p[@outputclass='l3']">
        <item num="{replace(node()[1], '^\s+', '')}">
          <para><xsl:apply-templates select="node()[position() gt 2]"/></para>
        </item>
      </xsl:template>


output i am getting with out sublist format:

    <item num="(a)"><para>blah blah</para></item>
    <item num="(b)"><para>blah blah</para></item>
    <item num="(c)"><para>blah blah</para></item>
    <item num="(i)"><para>blah blah</para></item>
    <item num="(ii)"><para>blah blah</para></item>
    <item num="(iii)"><para>blah blah</para></item>
    <item num="(iv)"><para>blah blah</para></item>


but i want output …
0
I have two types of XML elements, one type is

First XML:

<Body>
<h1>aaa</h1>
<h1>bbb</h1>
<h1>ccc</h1>
</Body>

Second XML:

<Body>
<h1> </h1>
<h1>aaa</h1>
<h1>bbb</h1>
</Body>

XSL I'm using as

<xsl:strip-space elements="h1"/>

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

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

   <xsl:template match="h1"/>

Output I'm getting correctly for first XML as like:

<Body>
<h1>aaa bbb ccc</h1>
</Body>

But even I used strip-space element as h1 for the second xml, I'm getting like below:

<Body>
<h1> aaa bbb</h1>
</Body>

Expected output be like

<Body>
<h1>aaa bbb</h1>
</Body>

Need to remove the space element of h1. But due to that tag, its combining even the space. I used priority and used the seperate h1[normalize-space()] tag also in the template. But its not working. There is having any way to avoid this. Please suggest. I'm using XSLT 2.0 and saxon-PE 9.6.0.7. Thanks in advance
0
Stack Overflow Podcast - Developer Story
Stack Overflow Podcast - Developer Story

Welcome to the Stack Overflow podcast recorded Thursday July 20 at Stack Overflow Headquearters in NYC. Your hosts today are podcast regulars Jay Hanlon, David Fullerton, and Ilana Yitzhaki, plus the quite irregular Matt Sherman (Stack Overflow Engineering Manager extraordinaire)

I generated and submitted my own sitemap.xml map for a webiste.
I also have Yoast installed for this wordpress website.
When I go into Yoast I am getting this error
The following file is blocking your XML sitemaps from working properly. Either delete it (this can be done with the "Fix it" button) or disable Yoast SEO XML sitemaps.
D:\sites\tebike\electricbicycle.com.au\home/sitemap.xml

I don't really want to fix it, as I sucussfully logged into my google account to verify and submit the site map, but now I am getting this error message.  Should I just ignore this Yoast error, fix it, remove my site map.
What is the best way to approach this?
Thanks
0
Hello.

I have some XMLWriter code that I need to modify:
========================================
XmlWriter messageWriter = XmlWriter.Create(strbuilder);
messageWriter.WriteStartDocument();

//Add this line below
messageWriter.????  (@"<!DOCTYPE message SYSTEM "work_request_20.dtd">");

messageWriter.WriteStartElement("message");
messageWriter.WriteAttributeString("message_id", id.ToString());
messageWriter.WriteAttributeString("message_dt", Lb.TestDate.ToString("MM/dd/yyyy hh:mm:ss.fff tt"));
========================================

Unfortunately, so far, no matter which method I use connected to the XMLWriter it does not like the "<" ">" or "!" characters.  If I use the StartElement or similar I believe it will add the "< >" for me.

Please advise on how to add this line to my XML document.  

Thanks.
0
How to get the hierarchy of the tagging for table format input

My input XML:

    <?xml version="1.0" encoding="UTF-8"?>
    <topic outputclass="TOA_Entries">
       <title outputclass="TOA_E">Table of Authorities – Entries</title>
       <body>
          <table frame="all" outputclass="TableGrid0">
             <tgroup cols="2">
                <colspec colname="col1" colwidth="130.50pt"/>
                <colspec colname="col2" colwidth="245.50pt"/>
                <tbody>
                   <row>
                      <entry namest="col1" nameend="col2">
                         <p outputclass="TOA_Title">Structures</p>
                      </entry>
                   </row>
                   <row>
                      <entry namest="col1" nameend="col2">
                         <p outputclass="TOA_Text_L1">Carnivanal Code (26 U.S.C.)</p>
                      </entry>
                   </row>
                   <row>
                      <entry>
                         <p id="p_S_IRC_ch61" outputclass="TOA_ID">S_IRC_ch61</p>
                      </entry>
                      <entry>
                         <p outputclass="TOA_Entry_L1">ch. 61</p>
                      </entry>
                   </row>
                   <row>
                      <entry>
                         <p id="p_S_IRC_IRC1931" outputclass="TOA_ID">S_IRC_IRC1931</p>
                      </entry>
                      <entry>
                       …
0
Hi, My Input file is:

<p><b><img src="https://admin.com"/>abc</b> efgh</p>

XSL I tried as:

   <xsl:template match="p[b[img]]">
      <xsl:value-of select="img"/>
      <xsl:apply-templates/>
   </xsl:template>

Expected Output be like:

<img src="https://admin.com"/>
<p><b>abc</b> efgh</p>

Please provide me the suggestion XSL code. Thanks in advance.
0
How to use (using visual studio c #) xml import sql service data table, study a lot of xml import demonstration (single repeat content, use a single element), xml content is very complex, a lot of element name, element value, element attributes. Do not know how to complete the analysis xml, how to import SQL form? Has recently been learning to use LINQ TO XML, is this a good way?

Download the XML file: https://drive.google.com/file/d/0B6BlJrfBeE4pX0hTQkl6cV82TTA/view?usp=sharing


<?xml version="1.0" encoding="UTF-8"?>
<questestinterop>
	<item title="The following memory, which access to the information of the most ..." ident="WM_ITEM1_1000100000_10015878_1329724731_981848" xmlns:wm="http://www.sun.net.tw/WisdomMaster">
		<presentation label="The following memory, which access to the information of the most ...">
			<flow>
				<material>
					<mattext><p>Which of the following <span style = "color: # FF0000"> memory </ span> has the fastest access to data?</p></mattext>
				</material>
				<response_lid ident="ANS01" rtiming="No" rcardinality="Single">
					<render_choice shuffle="Yes">
						<response_label ident="1">
							<flow_mat>
								<material>
									<mattext>Cache memory</mattext>
								</material>
							</flow_mat>
						</response_label>
						<response_label ident="2">
							<flow_mat>
								<material>
									<mattext>Read only memory</mattext>
								</material>
							</flow_mat>
						</response_label>
						<response_label ident="3">

Open in new window

0
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.gp.com/Patient"
	xmlns:tns="http://www.gp.com/Patient" elementFormDefault="qualified">

	<element name="patient" type="tns:Patient" />

	<complexType name="Patient">

		<sequence>
			<element name="id" type="tns:ID" />
			<element name="name" type="tns:string15chars" />
			<element name="age" type="int" />
			<element name="dob" type="date" />
			<element name="email" type="string" />
			<element name="gender" type="tns:genderEnum" />
			<element name="phone" type="string" />

		</sequence>

	</complexType>

	<simpleType name="ID">
		<restriction base="int">
			<pattern value="[0-9]*"></pattern>
		</restriction>
	</simpleType>

	<simpleType name="string15chars">
		<restriction base="string">
			<pattern value="15"></pattern>
		</restriction>
	</simpleType>



	<simpleType name="genderEnum">
		<restriction base="string">
			<enumeration value="M"/>
			<enumeration value="F"/>
		</restriction>
	</simpleType>


</schema>

Open in new window


Based on aboveXSD i generated below XML which gives error at line 4 of XML as
Multiple annotations found at this line:
      - cvc-type.3.1.3: The value 'Maaa' of element 'tns:name' is not valid.
      - cvc-pattern-valid: Value 'Maaa' is not facet-valid with respect to pattern '15' for type
       'string15chars'.


<?xml version="1.0" encoding="UTF-8"?>
<tns:patient xmlns:tns="http://www.gp.com/Patient" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.gp.com/Patient Patient.xsd ">
  <tns:id>1</tns:id>
  <tns:name>Maaa</tns:name>
  <tns:age>0</tns:age>
  <tns:dob>2001-01-01</tns:dob>
  <tns:email>tns:email</tns:email>
  <tns:gender>M</tns:gender>
  <tns:phone>tns:phone</tns:phone>
</tns:patient>

Open in new window



why i am getitng this error and how to fix it. i using eclipse for this as IDE.
any other open source XML IDEs bettr than eclipse to work on these simple xml, XSDs etc
please advise
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).