|
Thank you
He who laughs last...
|
|
|
|
|
hi
I am using MS XML 4.0 and VC++.
When I tried to load the XML file with XSD referecvv , my XPAth queries are returning NULL .
What could be reason?
Please help me.
thanks in advance
|
|
|
|
|
Hi,
I'm looking to search through child nodes, and then capture the value of the node and also that of the parent node. For example, the user enters details into a field, which then gets checked against the child node, if matched then it gets the value of that node and also the parent value. Which then will be populated into a treeView
I'm trying to use XMLPathNavigator and it doesn't appear to be working. Any ideas? Or other ways to attempt this. I'm using c#.net 2005 to do this.
It sounds extremely easy, but just can't get it to work.
Cheers... Dan
Cheers.. Dan
|
|
|
|
|
Perform the search in XPathDocument or XmlDocument by using SelectSingleNode method. When element is found it is easy to navigate back to the parent node (ParentNode property).
Best regards,
-----------
Igor Sukhovhttp://sukhov.net
|
|
|
|
|
Hi,
in xslt i have written an template where in i have created text box(txtbx2) and binded a value as follows:
<asp:DataGrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 465px; POSITION: absolute; TOP: 151px" runat="server">
<Columns>
<asp:TemplateColumn HeaderText="col1">
<ItemTemplate>
<asp:TextBox ID="txtbx2" Runat="server" text='<%# DataBinder.Eval(Container,"DataItem.BookNum") %>'></asp:TextBox>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
</xsl:template>
</xsl:stylesheet>
but on running it i get an exception that scripts cant be run.Pls help me out
|
|
|
|
|
I am entering some of my data straight into an XML doc and like the nodes to display like the top form. But calling XmlDocument.Save(filepath) changes them to the 2nd form. Is there any way to keep the formating or write out the elements? Or do you know of an Xml Editor to help me?
<KICategory>
<Name>TIME</Name>
<Type>GENERAL</Type>
<KnownItems Add="true">
<BaseKI><Name>FULL_DATE</Name></BaseKI>
<BaseKI><Name>MONTH_DAY</Name></BaseKI>
<BaseKI><Name>MONTH_YEAR</Name></BaseKI>
<BaseKI><Name>YEAR</Name></BaseKI>
</KnownItems>
</KICategory>
<KICategory>
<Name>TIME</Name>
<Type>GENERAL</Type>
<KnownItems Add="true">
<BaseKI>
<Name>FULL_DATE</Name>
</BaseKI>
<BaseKI>
<Name>MONTH_DAY</Name>
</BaseKI>
<BaseKI>
<Name>MONTH_YEAR</Name>
</BaseKI>
<BaseKI>
<Name>YEAR</Name>
</BaseKI>
</KnownItems>
</KICategory>
|
|
|
|
|
HI ,
I have an xml file in my application folder
when i run the application, i wanna load the contents of the xml file into text box.I am using C#.net .how do i do??
.
please help
Thanks
Jiny
-- modified at 1:18 Friday 30th June, 2006
|
|
|
|
|
hi,
i hope it is help
<br />
<?xml version="1.0" encoding="UTF-8" ?><br />
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ><br />
<xsl:template match="/"><br />
<textarea style="width:100%;border:0;overflow:visible"><xsl:value-of select="//doc"/></textarea><br />
</xsl:template><br />
</xsl:stylesheet>
regards
|
|
|
|
|
Try this in your code-behind file:
string strPath = "xmlFolder/MyXMLFile.xml";
StreamReader objSR = new StreamReader(Server.MapPath(strPath), Encoding.Default);
string strSRcontent = objSR.ReadToEnd();
Textbox1.Text = strSRcontent;
--Dimple
|
|
|
|
|
Good Morning All,
I have a wierd problem... I have these "-&-#xD-;-&-#-xA-" (I inserted the -'s because it wasnt showing up on this post); characters showing up all through my XML transfomration where there is a line feed or a return... I have used this, (not sure it helps) and I still get them.<xsl:strip-space elements="*"> Is there anyway to get ride of these characters (without a regular expression on the transformed XML) ? It is screwing up my embedded JavaScript...
System.IO.StringWriter swTransformedXML = new System.IO.StringWriter();
trainingXSL.Transform(xmlTransformDoc, xslArguments, swTransformedXML, new System.Xml.XmlUrlResolver());
The swTransformedXML contains the junk characters...
Brandon
-- modified at 13:35 Thursday 29th June, 2006
|
|
|
|
|
Instead of transforming with the StringWriter , wrap it in an XmlWriter :
XmlWriterSettings xws = new XmlWriterSettings();
xws.NewLineChars = "\n";
XmlWriter xw = XmlWriter.Create(swTransformedXML, xws);
The XmlWriterSettings gives you more control over how the XML is written to the string.
Logifusion[^]
|
|
|
|
|
Hi there,
I've got the following problem. I'd like to find a specific node using this XPath: /entry/comments/comment/[@author:"Jimmy" and @dateAdded:"29.06.2006 17:21:13"] . I use the following code to fill the XmlNodeList .
XmlNodeList nodes = xml.SelectNodes(sXPath);
I receive an error (due to german framework here my attempt of a translation): System.Xml.XPath.XPathException : The expression passed into this method must result in a NodeSet.
Yes, this is what I expect. An XmlNodeSet . What else should I want to get?
Can anybody help me? Thanks in advance!
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
matthias s. wrote: /entry/comments/comment/[@author:"Jimmy" and @dateAdded:"29.06.2006 17:21:13"]
Do you mean /entry/comments/comment[@author:"Jimmy" and @dateAdded:"29.06.2006 17:21:13"] ?
Logifusion[^]
|
|
|
|
|
yes, how did you know?
thanks!
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
Hi all,
I'm having a problem with my XSL converting to HTML. I can view all content fine, except the white space is not preserved! I've tried all relevant attributes such as xml:space, xsl:preserve-space, bt don't work
( ( ( ( (
For example in my XML:
<catalog>
<content>
lines and lines of text
more text
</content>
</catalog>
When transforming I get:
lines and lines of text more text
It's all bunched up...where did the newline characters go?
my XSL contains this:
<xsl:value-of select="content"/>
Any ideas? Thanks.
-- modified at 11:55 Thursday 29th June, 2006
|
|
|
|
|
In order for your message to show correctly you have to use < to create the < and > to create the > signs.
Anyways, this typically happens when doing an XSL transform. If you're coding the transformation yourself in .NET, you can put settings on the XmlTextWriter that will handle the spacing. If you're using a tool like XmlSpy, you can do a pretty print. There might be settings on the transformation software you're using to format the output.
Logifusion[^]
|
|
|
|
|
thanks.
i think you might misunderstand my issue, the problem is about how to transform xml to html with all whitespace which the xml file has, not about the pretty print.;)
plz help me
|
|
|
|
|
Well, I am doing the same thing as you. I pass some XML through a stylesheet to create HTML. The source is all cramped together, but I don't mind much as long as the HTML comes out ok. But sometimes it doesn't. For instance, if I want a space between two items like so:
<xsl:value-of select="$data/ch2_State"/> <xsl:value-of select="$data/vch10_ZipCode"/> XSL will strip out the space between the state and the zip code so it looks like this: NY12345
That's a real pain. And, like you say, preserve space and whatever else you put there just doesn't work. So, what I ended up doing was this:
<xsl:value-of select="$data/ch2_State"/>
<xsl:text disable-output-escaping="yes">&</xsl:text>nbsp;
<xsl:value-of select="$data/vch10_ZipCode"/>
It's an extra annoyance, but it gets the job done.
Logifusion[^]
|
|
|
|
|
it is also one of solutions, but what i'm aim to do is to write a xsl file, and i use this xsl to transform all articles which stored in xml file. So the positions of carriage return in each article are random.
do you have any solution to deal with it?
thanks?
|
|
|
|
|
In one situation where I needed the HTML to look exactly a certain way, I changed my output type from HTML to Text. This way, the stylesheet had to pay more attention to me. The stylesheet was harder to write because you have to enclose things in <xsl:text> tags, but it got the job done. To do a new line, you can do something like this:
<xsl:text>
</xsl:text> or
<xsl:text>
</xsl:text>
Even if the target is set to Text, XSL still likes to get rid of whitespace, so it's a lot of trial and error.
I hope that helps. If you find an easier solution, I'd be happy to hear it!
Logifusion[^]
|
|
|
|
|
oh god!
i tried your way to do a new line with <xsl:text> tags:
<xsl:text>
</xsl:text>
it's just displayed a space instead of carriage return.
what's wrong?
-- modified at 17:51 Thursday 29th June, 2006
|
|
|
|
|
Ya, unfortunately that way works with some XSL transformers and not with others. It's really quite annoying. You might want to use the other method instead. I'm not sure if you have to escape it or not, but this seemed to work pretty well for one guy at work. The only trouble is that it makes the XSL really ugly.
Logifusion[^]
|
|
|
|
|
yes, i tried to enter <cr/> tag (my self-define tag )to substitute each CARRIAGE RETURN, when i am entering content of my article into xml file, and make relevant manipulation for this tag in xsl file.
however, i meet another problem , how to find out all <cr/> tags in a xml file? because this tag can be existed in different hierarchy of xml file.
any ideas?
many thanks
|
|
|
|
|
That sounds difficult. Is it that you have text in your XML document that has newlines in it and you want the formatting to be the same in the HTML? If you have the ability to, you might want to try putting it into a CDATA in the XML. After switching to text output, I was able to get my stylesheets working the way I wanted them to.
Logifusion[^]
|
|
|
|
|