|
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[^]
|
|
|
|
|
|
THanks everyone.
finally, I use <xsl:copy-of select="./node()"/>to address my problem.
Thanks for the Url you provided, it is very helpful.
|
|
|
|
|
Hi there,
I'm wondering whether there is a simple way to store longer text blocks containing any kind of character in an xml file. How can this be done? If this can't be done, where could I find information on what characters are allowed an not?
Thanks a ton in advance!
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
You could create CDATA section in xml file to store text with any characters in that section.
Best regards,
-----------
Igor Sukhovhttp://sukhov.net
|
|
|
|
|
Exactly what I needed. Thanks!
Greetings from Berlin!
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
Which is better / cleaner / more 'standard' or is it personal preference?
<DBLIST>
<Database Name="DB1" Owner="Jack SMITH" RequestedBy="" Description="Live Replication" Locked="Yes" Date="12/12/2005" Action="Requested by John SMITH"/>
</DBLIST>
or
<DBLIST>
<Database>Live Replication
<Name>DB1</Name>
<Owner>Jack SMITH</Owner>
<RequestedBy><RequestedBy>
<Locked>Yes</Locked>
<Date>12/12/2005</Date>
<Action>Requested by John SMITH"</Action>
</Database>
</DBLIST>
...and...how to format this post so I can use <pre> but keep the xml tags displayed!
Regards
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
-- modified at 6:37 Tuesday 27th June, 2006 - typo
|
|
|
|
|
What kind of operations expected to be performed on this xml ?
Best regards,
-----------
Igor Sukhovhttp://sukhov.net
|
|
|
|
|
It is a very large file, thousands of entries, and xpath queries, reading every node, every attribute.
Regards
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
|
|
|
|
|
If the xml files are going to be huge - I would recommend running few tests. I've heard about speed difference processing elements and attributes - but tests are necessary to find out if this applies to your particular xml parser.
From the design prospective - I prefer to use attribute (rather that element) if I fee that the entity is not going to evolve in future to contain sub-entities.
If your example I would make all entities as attributes, except "Action" which I feel might require children in future (e.g. action parameters).
Best regards,
-----------
Igor Sukhovhttp://sukhov.net
|
|
|
|
|
Hi Igor
Thanks for the time you've spent on this and the suggestion for the action tag. This is currently text, the action is handled elsewhere and this just shows the latest action - but I agree. The action should be a node, with its own parameters
<Action type="request" actionedby="J Smith" />
Thanks again.
Regards
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
|
|
|
|
|
Hello there
I am new in XSL and want to know how to get the current date in XSL-FO to be printed on report. Also how to get the page numbers like
1 of 10 , 2 of 10, I am able to print the page number but with total pages is my requirement.
Rizwan Bashir
|
|
|
|
|
My xsl:fo is a little rusty. But, the total page numbers is done by placing a marker with a page-number in it at the end of your stream so that it appears on the last page. Then, in your header/footer, you can write the value of that marker using retrieve-marker and it will come out as the total number of pages.
Logifusion[^]
|
|
|
|
|
For the current date, I don't believe there's anything in FO for it. FO is pretty static once it's written, so you're left with what's available in XSL. It will depend on what version of XSL you're dealing with, but there are some date functions. You might be able to put current-date() in an XPath expression. If that doesn't work, you can embed some VBScript or JavaScript into the XSL.
Take a look here for what's in XPath: http://www.w3schools.com/xpath/xpath_functions.asp#context[^]
Logifusion[^]
|
|
|
|
|
can i share my database amount different websites through XML, but the access should be limited. solution would be implement in every environment so i be very thankfull for giving me this solution and if any other way to do this please share.
Thx to all
Zahid Manzoor
cell no.03335167615
Zahid
-- modified at 11:24 Tuesday 27th June, 2006
|
|
|
|
|
I am writing a service desk application. I have an XML file that a c# webservice accesses.
I have 2 tables inside an xml document. I can read from the xml without any problems but writing back to the file causes errors. Here is an sample of the file:
<code><?xml version="1.0" standalone="yes"?>
<ServiceDesk xmlns="http://tempuri.org/ServiceDeskData.xsd">
<ServiceCategory>
<category>
<id>1</id>
<type>Hardware - PC</type>
</category>
<category>
<id>2</id>
<type>Hardware - Printer / Scanner</type>
</category>
</ServiceCategory>
<ServiceRequest>
<Call>
<id>PBS00001</id>
<User>Test</User>
<Category>2</Category>
<Description>Some text</Description>
</Call>
<Call>
<id>PBS00002</id>
<User>Someone</User>
<Category>1</Category>
<Description>gbhjbgjhb</Description>
</Call>
</ServiceRequest>
</ServiceDesk></code>
ServiceDesk is the root element and then ServiceCategory and ServiceRequest are the tables holding the data. The problem occurs when i try to write back a Call to the Service Request Table. If i write to the ServiceRequest table it says that the item (a string array of 4) is too big, and if i write to the Call table it puts it outside the </ServiceRequest> element which breaks the schema. Could anybody give me some suggestions?
The c# code i use is:
<code>
DataSet d = new DataSet();
d.ReadXml("http://localhost/ServiceDeskWS/ServiceDeskData.xml");
String [] s = new String[4];
s[0] = assignID();
s[1] = User;
s[2] = Category;
s[3] = Description;
d.Tables["Call"].Rows.Add(s);
d.WriteXml(Server.MapPath("ServiceDeskData.xml"));</code>
Thanks
-- modified at 9:10 Monday 26th June, 2006
|
|
|
|
|
Hi
I want to simply swap two attributes of different nodes over but can't seem to 'write' to the xml doc..
int swapPos1 = 8;
int swapPos2 = 9;
System.Xml.XPath.XPathDocument xml = new System.Xml.XPath.XPathDocument("myxml.xml");
System.Xml.XPath.XPathNavigator xmlNav = xml.CreateNavigator();
System.Xml.XPath.XPathExpression expr = xmlNav.Compile("/Tabs/Tab");
expr.AddSort("@position", System.Xml.XPath.XmlSortOrder.Ascending, System.Xml.XPath.XmlCaseOrder.None, "", System.Xml.XPath.XmlDataType.Text);
System.Xml.XPath.XPathNodeIterator iterator = xmlNav.Select(expr);
while (iterator.MoveNext())
{
int pos = int.Parse( iterator.Current.GetAttribute("position", "").ToString() );
if (pos == swapPos1)
{
iterator.Current.MoveToAttribute("position" , "");
iterator.Current.SetTypedValue( swapPos2.ToString() );
continue;
}
if (pos == swapPos2)
{
iterator.Current.MoveToAttribute("position", "");
iterator.Current.SetTypedValue ( swapPos1.ToString());
continue;
}
}
The SetTypeVAlue throws - not supported' exception. Basically, I want to swap the position attribute of two nodes.
Any help much appreciated. Not just new to XML, but to C# as well!
Regards
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
|
|
|
|
|
XPath is read only - doh!!!
Regards
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
|
|
|
|
|
to be more precise - XPathNavigator created by XPathDocuments are readonly (for performance reasons). However you might create XPathNavigator by XmlDocument.
Best regards,
-----------
Igor Sukhovhttp://sukhov.net
|
|
|
|
|
hi..
I wanted to know that how to add constraints and restriction to xml schema?
thanks
|
|
|
|
|
can we convert from one structure of code to different one using xml technology...
suppose:
assembly code in xml form to c cod like in xml form
if its possible pls suggest me which xml technologies i should be looking into
thanx..
|
|
|
|
|
Hi, I have a windows application that calls a web service. Web service returns a string response like
<?xml version="1.0" encoding="utf-16"?>
<v1:ABCMerchant v1:tcid="11111" xmlns:v1="http://abc/2005/response">
<v1:ABCs>
<v1:ABC v1:ID="1" />
<v1:ABC v1:ID="2" />
</v1:ABCs>
</v1:ABCMerchant >
I have to parse this string and get the values returned in <v1:ABC V1:ID="1"
<v1:ABC v1:ID="2" /> etc.
Number of ids returned by web service will depend on ABC number being passed. if user passed let's say 10 as ABC number then 10 ID's will be returned with string <v1:ABC v1:ID="1" /> repeated 10 times with separatge Unique ID in each string.
I want to retrive these values from the string that I have up in this message.
How can I do that. Also, I am using vb.net. I would appreciate code sample in vb.net etc.
Thanks
Needy
|
|
|
|
|
Take the string that you get back and turn it into an XmlDocument:
Dim s as String = ...
Dim doc as XmlDocument = New XmlDocument()
doc.LoadXml(s)
The difficulty is in the namespace. You have to take a few extra steps to do an XPath:
Dim xnm as XmlNamespaceManager
xnm = new XmlNamespaceManager(doc.NameTable)
xnm.AddNamespace("v1", "http://abc/2005/response")
Dim nodes as XmlNodeList
nodes = doc.SelectNodes("//v1:ABCs/v1:ABC", xnm)
This gives you a collection of the "v1:ABC" nodes. Run that code and you'll see that nodes.Count is equal to the number of those "v1:ABC" nodes.
Logifusion[^]
|
|
|
|