|
< ?xml version="1.0" encoding="utf-8" ? ><br />
< ?xml-stylesheet href="mystyles.css" type="text/css" ? ><br />
< MYROOT > <!-- Rest of xml here --> < /MYROOT >
the mystyles.css file exists, but my xml won't show in Internet Explorer (it does when I remove the xml-stylesheet tag).
What is wrong here? I also found a version that replaces xml-stylesheet with xml:stylsheet, but this doesn't work either...
Many thanks..
V.
Stop smoking so you can: enjoy longer the money you save.
|
|
|
|
|
<?xml-stylesheet type ="text/css" href="mystyles.css"?>
try this i hope it should work now
|
|
|
|
|
Thanks for the reply, but it doesn't work.
the XmlDocument.Load(Stream) ; function loads it up perfectly. (this function fails if it can't parse the xml stream)
Internet Explorer 7 asks me the allow Active Content question over and over again without showing anything.
Firefox shows nothing. (but it is loaded if I view the Source)
|
|
|
|
|
mmm, my bad, it only shows the text between the tags (I only filled in attributes)
the 'Allow Active Content' warning remains though.
V.
Stop smoking so you can: enjoy longer the money you save.
|
|
|
|
|
Dears,
to apply a stylesheet into an xml document, you should use XSLT technology xml based Stylesheet.
for more information http://www.aspalliance.com/1067
Happy Coding
Best Regards,
Haissam Abdul Malak
|
|
|
|
|
Hello,
I'm trying to create a TreeView from an XmlNodeSet (which is the result of an XmlNode.SelectNodes method call). I want the TreeView to preserve the hierarchy of the XML that was queried. So as I traverse the XmlNodeSet, I need to figure out where each node should be placed in the TreeView.
The problem is, an XmlNodeSet contains no hierarchical information (as near as I can tell). So I need to take any given node, and check it against the other nodes in the XmlNodeSet, looking for ancestors. But how do I check if Node A is an ancestor of Node B? I can check if Node A is Node B's parent, but that's not good enough. Node B's parent may not have been included in the XmlNodeSet that was returned by the xpath query (XmlNode.SelectNodes). For example, Node A may be Node B's grandparent. If Node A is Node B's nearest ancestor, I want to place the TreeNode that represents Node B directly under the TreeNode that represents Node A.
So again, how can I determine if Node A is an ancestor of Node B?
I realize I can brute force this, but the only way I can think of is not very efficient. I was hoping there was an "IsAncestor" method or something, but I've had no such luck!
Any help would be greatly appreciated!
Thanks!
Ian
|
|
|
|
|
The following code may not satisfy exactly what you need. Anyway, using XPath, you can query a given node to list its ancestors. The last node in the ancestor node list is the immediate parent of the given node.
String^ xml =
L"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
L"<years>"
L" <year y=\"2003\">"
L" <month m=\"1\">"
L" <day d=\"4\"/>"
L" </month>"
L" </year>"
L" <year y=\"2002\">"
L" <month m=\"2\">"
L" <day d=\"5\"/>"
L" </month>"
L" </year>"
L" <year y=\"2001\">"
L" <month m=\"3\">"
L" <day d=\"6\"/>"
L" </month>"
L" </year>"
L"</years>";
XmlDocument^ doc = gcnew XmlDocument;
doc->LoadXml(xml);
XmlNode^ day5 =
doc->SelectSingleNode(L"/years/year/month/day[@d='5']");
XmlNodeList^ ancestors = day5->SelectNodes(L"ancestor::*");
for each (XmlNode^ ancestor in ancestors)
{
Console::WriteLine(L"{0} is an ancestor",
ancestor->Name);
}
-- modified at 10:54 Tuesday 7th November, 2006
|
|
|
|
|
Hi all,
When I use a regular expression beginning or ending with '|' (a simple thing like 'aaa |' for example), and pass it to RegexMatcher.find(), it never returns! Infinite loop!
The validate function, RegexPattern.compile(), also hangs.
Has anyone else encountered this bug?
Is there a new version of this dll around (I can't find a newer one than V26)?
Thanks in advance!
~ Mike
|
|
|
|
|
"|" is the alternation symbol. I believe you are trying to express an empty alternation. Some standards (such as POSIX) disallow empty alternatives; or, your version, icuin26.dll, expresses undefined behavior when it encounters empty alternation. However, you might get better results by using this format "(xxx|yyy|zzz|)". I believe "(xxx|yyy|zzz|)" is equivalent to "((?:xxx|yyy|zzz)?)".
George
-- modified at 19:14 Friday 3rd November, 2006
|
|
|
|
|
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
|
|
|
|