|
Hi everyone,
I'm trying to create an integration interface using strings to pass messages between a new c# product and a legacy vb app. I have an xsd that defines the schema for a message and permits a message to be a reply or a request or an error; this equates to my c# object model. This works fine and the VB app can check that what is passed in is an appropriate message.
A request could be 1 of about 25 types (at the moment, maybe more later) and each request could have a different number of parameters associated with it. Rather than specifying every combination of arguments in the main schema is it possible to define sub-schemas.
Thanks for any advice you can give
Russell
|
|
|
|
|
|
thanks for that link.
it lead me to http://www.w3.org/TR/xmlschema-0/ and section 4 has all the answers i require
Thanks again,
Russ
|
|
|
|
|
Hi there,
i have a application which use xslt to read the data from the particular tag for example i have a xml file like below:
<?xml version="1.0" encoding="UTF-8" ?>
<datafield tag="300" ind1="" ind2="">
<subfield code="a">xxiii, 2-297 p.</subfield>
<subfield code="c">21 cm.</subfield>
</datafield>
<datafield tag="310" ind1="" ind2="">
<subfield code="a">monthly</subfield>
</datafield>
and i read data using xslt for ex:
<dc:test>
<xsl:call-template name="selectFields">
<xsl:with-param name="fields">
<xsl:copy-of select="marc:datafield[@tag='310']/marc:subfield[@code='a']"/>
</xsl:with-param>
</dc:test>
i use c# to load the data into database for ex:
objTempNodes = objXml.SelectNodes("//dc:test", objNameSpaceMgr);
sData[21] = "";
foreach (XmlNode objNode in objTempNodes)
{
sData[21] += objNode.InnerText.Trim();
sData[21] += (objNode.InnerText.Trim().Length > 0 ? sDelimiter : "");
sData[21] = sData[21].Substring(0, (sData[21].Length == 0 ? 0 : sData[21].Length - 1));
sData[21] = objNode.InnerText;
if (sData[21].Trim() != "")
sData[21] = RemoveDups(sData[21]);
objNode.InnerText = sData[21];
}
but the problem is i have value in tag '310' but it show me blank, i can see the other tag value. any suggestion on this issue? pls do the needful it urgent.
|
|
|
|
|
Hi there,
i have a application which use xslt to read the data from the particular tag for example i have a xml file like below:
<datafield tag="300" ind1="" ind2="">
<subfield code="a">xxiii, 2-297 p.
<subfield code="c">21 cm.
<datafield tag="310" ind1="" ind2="">
<subfield code="a">monthly
and i read data using xslt for ex:
<dc:test>
<xsl:call-template name="selectFields">
<xsl:with-param name="fields">
<xsl:copy-of select="marc:datafield[@tag='310']/marc:subfield[@code='a']">
i use c# to load the data into database for ex:
objTempNodes = objXml.SelectNodes("//dc:test", objNameSpaceMgr);
sData[21] = "";
foreach (XmlNode objNode in objTempNodes)
{
sData[21] += objNode.InnerText.Trim();
sData[21] += (objNode.InnerText.Trim().Length > 0 ? sDelimiter : "");
sData[21] = sData[21].Substring(0, (sData[21].Length == 0 ? 0 : sData[21].Length - 1));
sData[21] = objNode.InnerText;
if (sData[21].Trim() != "")
sData[21] = RemoveDups(sData[21]);
objNode.InnerText = sData[21];
}
but the problem is i have value in tag '310' but it show me blank, i can see the other tag value. any suggestion on this issue? pls do the needful it urgent.
|
|
|
|
|
Could you please edit your post and have it ignore the HTML tags? Or convert all the <'s to <'s and >'s to >'s.
Logifusion[^] "This isn't a business. I've always thought of it as a source of cheap labor. Like a family."
|
|
|
|
|
i did already pls check the subject XSLT:copy-of element
thanx
|
|
|
|
|
I have an XML and XSLT pair that I created to display the contents of a sorted list of items. I want the transformed output to have anchors on each letter of the alphabet and a list of letters at the top which the user can click to jump directly to a particular letter. For example...
A B C ... (all the letters of the alphabet.)
A
some stuff
B
some more more stuff
C
you get the idea...
If someone clicked on C, they would link to the named anchor at C below in the list. I have two types of element, the one for the individual list entries and one for the letters that go between elements. My XML looks something like:
<list>
<letter>A</letter>
<listitem>
<name>A-item name</name>
<description>The description of this item which has a name that begins with 'A'.</description>
</listitem>
<listitem>
<name>A Seoncd-item name</name>
<description>The description of another item which has a name that begins with 'A'.</description>
</listitem>
<letter>B
<listitem>
<name>B-item name</name>
<description>The description of this item which has a name that begins with 'A'.</description>
</listitem>
<listitem>
<name>B Seoncd-item name</name>
<description>The description of another item which has a name that begins with 'A'.</description>
</listitem>
</list>
I can create a two column table and have no trouble creating the rows with the letter header but can't seem to get the value of the letter into the name of the anchor tag. What I want is that when it sees a letter element, it should create the following content for the table cell that shows the letter 'A':
<td colspan="2">AIs there a way to do that or am I just wasting my time? I've been looking all morning at various web sites and haven't found anything that will do what I want. My boss thinks it would be a cool/useful idea for the page I'm creating and I want to look good. I haven't got a ton of time to waste as I have other projects due this week, so any help would be appreciated. Maybe I'm just not looking for the right thing...
Irene
|
|
|
|
|
I made some changes to your xml document:
<list>
<items letter="A">
<item name="First A-Item Name">
<description>The description of this item which has a name that begins with 'A'.</description>
</item>
<item name="Second A-Item Name">
<description>The description of another item which has a name that begins with 'A'.</description>
</item>
</items>
<items letter="B">
<item name="First B-Item Name">
<description>The description of this item which has a name that begins with 'B'.</description>
</item>
<item name="Second B-Item Name">
<description>The description of another item which has a name that begins with 'B'</description>
</item>
</items>
</list>
Here is my XSLT code that produces what you may want:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title>Alpha-Anchor</title>
</head>
<body>
<table cellpadding="3">
<tr>
<xsl:apply-templates select="list/items/@letter"/>
</tr>
</table>
<div style="height: 800pt"></div>
<xsl:apply-templates select="list/items"/>
</body>
</html>
</xsl:template>
<xsl:template match="@letter">
<td><a href="#{.}"><xsl:value-of select="."/></a></td>
</xsl:template>
<xsl:template match="items">
<div id="{@letter}">
<xsl:apply-templates select="item"/>
</div>
<div style="height: 400pt"></div>
</xsl:template>
<xsl:template match="item">
<table>
<tr>
<td><xsl:value-of select="@name"/></td>
</tr>
<tr>
<td><xsl:value-of select="description"/></td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>
|
|
|
|
|
Thank you for your help. I couldn't figure out how to get my value into the attribute for the anchor and I couldn't even formulate the question correctly! I appreciate your help.
Irene
|
|
|
|
|
I would like to develop a web service to be invoked from an InfoPath form which will create a Blog posting in Sharepoint (V3). Blog would already exist, need to create post values from Infopath XML form values. I noticed there is a long list of Sharepoint objects that start with SP*. Would appreciate any help to get started. Thanks.
|
|
|
|
|
Hello,
I am transforming a XML file into another XML file using a XSLT.
Everything is working fine! I have only one problem:
I want one of the values in my XSLT file to be taken from a Key in my Web.Config AppSettings!
Please see the XSLT code:
Hi,
I was reading some Merge Methods in the web but I am having some problems making this work.
Look at my XSLT code:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.google.com/schemas/sitemap/0.84"
xmlns:dk="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="dk:*"/>
<xsl:template match="@*|text()|comment()"/>
<xsl:template match="/">
<xsl:element name="urlset">
<xsl:apply-templates select="//dk:siteMapNode[@google='true']"/>
</xsl:element>
</xsl:template>
<xsl:template match="dk:siteMapNode">
<xsl:element name="url">
<xsl:element name="loc">
<xsl:text>http://www.MYDOMAIN.com/</xsl:text>
<xsl:value-of select="substring(@url, 3)"/>
</xsl:element>
<xsl:element name="lastmod">
<xsl:value-of select="@lastmod"/>
</xsl:element>
<xsl:element name="changefreq">
<xsl:value-of select="@changefreq"/>
</xsl:element>
<xsl:element name="priority">
<xsl:value-of select="@priority"/>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Do you see the line?
<xsl:text>http://www.MYDOMAIN.com/</xsl:text>
I want "http://www.MYDOMAIN.com/" to be taken from a Key in Application Settings in my Web.Config or at run time before the XML file is displayed.
Thanks,
Miguel
|
|
|
|
|
You can pass a parameter into the XSL when you perform the transformation. The XSL would have this:
<xsl:stylesheet version="1.0" ... >
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:param name="myUrl"/>
...
<xsl:element name="loc">
<xsl:value-of select="$myUrl" />
<xsl:value-of select="substring(@url, 3)"/>
</xsl:element>
...
Then when you perform the transformation, we'll assume you have a XslCompiledTransform object called transform . You just create an XsltArgumentList object and pass it in when you call Transform :
XsltArgumentList xal = new XsltArgumentList();
xal.AddParam("myUrl", "", "http://www.MYDOMAIN.COM");
transform.Transform("some.xml", xal, XmlWriter.Create("someoutput.xml"));
That way you should be able to pull your value from the app.config when you do the transformation.
|
|
|
|
|
hi, i have an xml and xsl for creating wordml. during the transformation i have to reach the some xsl nodes with xpath. but the xpaths i wrote always run for xml. how can i reach xsl inside the xsl? (there is only one xsl.)
Savas
|
|
|
|
|
If you are trying get the XSLT processor to address nodes in the XSLT file using XPath... you can't.
led mike
|
|
|
|
|
without xpath? or can i reach anyway?
Savas
|
|
|
|
|
savasorama wrote: or can i reach anyway?
"reach"? What does that mean?
led mike
|
|
|
|
|
Are you storing XML data in your XSL stylesheet or are you trying to run a set of XSL commands from a different place in the stylesheet?
|
|
|
|
|
I'm storing data in the xml file and transforming to the wordml via xsl. My problem is; there is font name and size declaration in the xsl and also one template that replaces string. In the xsl all <w:rPr> tags have <w:rFonts w:ascii="Arial"> but when the replace string template being called all of these fonts are ignored and it writes with the default font (Times New Roman).
Is there any way to let this not happen?
|
|
|
|
|
I'd have to see a little of your XSL to help with this. Could you provide an example of where you have the font set up and then call the "replace string" template?
|
|
|
|
|
<w:tc>
<w:tcPr>
<w:tcW w:w="1476" w:type="dxa"/>
</w:tcPr>
<w:p>
<w:pPr>
<w:rPr>
<w:rFonts w:ascii="Arial" w:h-ansi="Arial" w:cs="Arial"/>
<wx:font wx:val="Arial"/>
<w:sz w:val="18"/>
<w:sz-cs w:val="18"/>
</w:rPr>
</w:pPr>
<xsl:variable name="value">
<xsl:call-template name="replace-string">
<xsl:with-param name="text">
<xsl:call-template name="replace-string">
<xsl:with-param name="text">
<xsl:call-template name="replace-string">
<xsl:with-param name="text">
<xsl:value-of select="obj:ClientName"/>
</xsl:with-param>
<xsl:with-param name="replace">[H]</xsl:with-param>
<xsl:with-param name="with"><b><i></xsl:with-param>
</xsl:call-template>
</xsl:with-param>
<xsl:with-param name="replace">[/H]</xsl:with-param>
<xsl:with-param name="with"></i></b></xsl:with-param>
</xsl:call-template>
</xsl:with-param>
<xsl:with-param name="replace">&</xsl:with-param>
<xsl:with-param name="with">&amp;</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:apply-templates select="msxsl:node-set(elu:StringToDom($value,'true'))/*" mode="dynamic-formatting"/>
</w:p>
</w:tc>
this is the font-name declaration and template calling part..
<xsl:template name="replace-string">
<xsl:param name="text"/>
<xsl:param name="replace"/>
<xsl:param name="with"/>
<xsl:choose>
<xsl:when test="contains($text,$replace)">
<xsl:value-of select="substring-before($text,$replace)"/>
<xsl:value-of select="$with"/>
<xsl:call-template name="replace-string">
<xsl:with-param name="text" select="substring-after($text,$replace)"/>
<xsl:with-param name="replace" select="$replace"/>
<xsl:with-param name="with" select="$with"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
and this is the template.. Thanks...
Savas
|
|
|
|
|
I think your XSL is fine. It's probably got something to do with how you're organizing the WordML tags. For instance, when I see the node <w:rPr> in a WordML, it's usually inside a <w:r> instead of a <w:pPr>. I would just be checking that the WordML is correct because your XSL looks fine and shouldn't be the cause of the changing fonts.
|
|
|
|
|
Hi everybody,
I reading an XML file with the code bellow and when I want to get the value of an xml node there are also whitespaces (space, newline, tab) and the Ignore Whitespace are set to true.
Any ideea is welcome.
Dim xmlsettings As New XmlReaderSettings
With xmlsettings
.ConformanceLevel = ConformanceLevel.Auto
.IgnoreComments = True
.IgnoreProcessingInstructions = True
.IgnoreWhitespace = True
End With
Dim reader As XmlReader = XmlReader.Create(file, xmlsettings)
Dim doc As New XmlDocument
doc.Load(reader)
Dim root As XmlElement = doc.DocumentElement
Dim invoiceId As XmlNode = root.SelectSingleNode("/a/b")
biglewy
|
|
|
|
|
They hide that information in the documentation[^]
Gets or sets a value indicating whether to ignore insignificant white space.
White space that is not considered to be significant includes spaces, tabs, and blank lines
used to set apart the markup for greater readability.
led mike
|
|
|
|
|
If the spaces inside a tag are significant, it's best to enclose them in a CDATA block so they will always be preserved, for example:
<foo><![CDATA[this is
lots of
stuff...
x>]]
</foo>
|
|
|
|