|
given i've been writing the stuff for 30+ years I guess the thrill of writing stuff that don't need writing has gone. BTW only Basic I ever used was Dartmouth Basic on a GE timesharing system - Gates would have been at scool then & I dont mean grad or high scool
cya
|
|
|
|
|
I been at this only 15+ years, I wish I had even one team member with half your experience. You guys hiring?
|
|
|
|
|
we're always hiring, no shortage of applicants, you can join at your leisure.
rgds phild - retiree's inc.
btw I did the xml stuff yesterday
oh I do free work for heart disease research - university CompSci are the politicians.
|
|
|
|
|
hi all,
i have the following xml file.
<rss version="2.0" xmlns:media="http://tools.search.yahoo.com/mrss/" >
<channel>
<title>SWF media</title>
<link>http://www.blogdigger.com/media/</link>
<description>Recent .swf files found by Blogdigger</description>
<item>
<title>Dollar Bus Rolls Into Town</title>
<link>http://feeds.feedburner.com/Chicagoist?m=1115</link>
<description>some description</description>
<pubDate>Thu, 23 Mar 2006 14:11:57 EST</pubDate>
<enclosure url="http://www.kitschn.com/flash/MenuCoverPage-DrinksMenu09-05.swf" type="application/x-shockwave-flash"/>
<media:content url="http://www.kitschn.com/flash/MenuCoverPage-DrinksMenu09-05.swf" type="application/x-shockwave-flash"/>
</item>
<item>
<title>E-mail</title>
<link>http://billarnold.typepad.com/poet_in_motion/2006/03/email.html</link>
<description>description 2/description>
<pubDate>Wed, 22 Mar 2006 17:28:28 EST</pubDate>
<enclosure url="http://www.softlab.ece.ntua.gr/~sivann/pub/swf/may02-smilepop-soapbox4.swf" type="application/x-shockwave-flash"/>
<media:content url="http://www.softlab.ece.ntua.gr/~sivann/pub/swf/may02-smilepop-soapbox4.swf" type="application/x-shockwave-flash"/>
</item>
</channel>
</rss>
i am using xpath to navigate through this xml file.
i used the following code to navigate through items node.
XmlDocument doc = new XmlDocument();
doc.Load(xmlfile);
XPathNavigator nav = doc.CreateNavigator();
XPathExpression exp = nav.Compile("rss/channel/item");
XPathNodeIterator iterator = nav.Select(exp);
XPathNodeIterator iter1;
while (iterator.MoveNext())
{
iter1 = iterator.Current.SelectChildren("media:content", "");
if (iter1.Count > 0)
{
while (iter1.MoveNext())
{
if (iter1.Current.HasAttributes == true)
{
string url = iter1.Current.GetAttribute("url", "");
}
}
}
}
but when i execute the code, the iter1.count always returns zero. if i select anyother children(like title or description)i am able to display the value.but when i select media:content(one of the subitems of item) i am not able to display the attribute value.
Where am i going wrong?
Any suggestions please
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
hi guys,
i solved it by myself. for everybody's reference,
iter1 = iterator.Current.SelectChildren("content", "http://tools.search.yahoo.com/mrss/");
i need to include the namespace URI in the selectchildren method and it worked.
Thanks
Regards
Anu
|
|
|
|
|
I am trying to generate a Word document for an ASP.Net application -- all users will have Word 2003.
I created a simple document in Word (Simple.doc).
Then, I used an XML Schema found in Simple.xsd and placed a couple of XML placeholders in the document.
I saved it as Simple.XML.
Downloaded and ran wml2xslt to create simple.xslt.
However, I am a little stuck as to how to get the data from my application into xml using this xslt file. Every example I can find seems to assume all data will be coming from a SQL database or databound web/win forms.
I would like to do something like:
Swap("xmlDataElementName", myObject1.ToString());
Is this doable; any help is greatly appreciated.
--G
|
|
|
|
|
I want to figure out the formula in getting the following:
$2500 loan amount
239.9961% APR
12 month term
Bi-weekly payment (26 payment total)
What is the formula for each payment?
What is the formula for the Total Finance Charge?
How can I calculate Bi-weekly equal payments??
We know that each payment will be $251.96 (Equal Payments) But how have they come up with such formula?? And where?
HELP!?!?!?!?!
Victoria
|
|
|
|
|
I will assume that your $251.96 is paying both interest on the balance and part of the loan is repaid each month.
So each each payment = interest + repayment
I used to Excel and "Goal-Seek" to work out the nominal (annual) rate of interest, it is 234.214%. Therefore each bi-weekly payment (assuming 52 weeks in a year) is 1/26 x 234.214% which is 9.008%
This is the interest part: so in first week interest is balance x 9.008% which is $225.206
Subtract this from $251.96 and you have the net repayment that month, $26.76.
For bi-week 2, interest on the balance is now $2473.24 x 9.008% .. etc
As to formulas I don't know if there is one, it's so long since I did all this stuff.. As you can see the interest is calculated monthly based on the remaining balance, and totals $4050.96
'Howard
|
|
|
|
|
I am venturing into the .NET XML world and have already run into a problem.
I have some very simple (I think) XML that defines several loan rate values, with attributes indicating the min and max amount for the loan:
<code>
<LoanInformation>
<LoanRates>
<Loan MinValue="001000.00" MaxValue="004999.99">
<Margin>10.25</Margin>
<Floor>14.75</Floor>
</Loan>
<Loan MinValue="005000.00" MaxValue="009999.99">
<Margin>5.25</Margin>
<Floor>9.75</Floor>
</Loan>
</LoanRates>
</LoanInformation>
</code>
So, a loan for $2500.00 should have a margin of 10.25/floor of 14.75, while a loan of $7500.00 should have a margin of 5.25/floor of 9.75.
I want to access these values in my C# code to calculate the rate/payment, but am stuck.
<code>
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(Server.MapPath(@"~\App_Data\LoanInformation.xml"));
string xPath = string.Format("//LoanRates/Loan[@MinValue >= '{0:000000.00}' and @MaxValue <= '{0:000000.00}']", plcdata.LoanAmount);
XmlNode node = xmlDoc.SelectSingleNode(xPath);
</code>
node seems to always be null, unless I remove the 'and @Max ..' clause. I added the leading zero's in case text vs. number comparison was causing a problem.
Any pointers would be greatly appreciated.
--G
-- modified to "ignore HTML tags"
|
|
|
|
|
Your XPath query is incorrect. Your code should read:
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(Server.MapPath(@"~\App_Data\LoanInformation.xml"));
string xPath = string.Format("//LoanRates/Loan[@MinValue <= '{0:000000.00}' and @MaxValue >= '{0:000000.00}']", plcdata.LoanAmount);
XmlNode node = xmlDoc.SelectSingleNode(xPath);
Paul Marfleet
|
|
|
|
|
<smacks head="">
Duh! I've been trying various combinations, *assuming* the problem was XML (and my lack thereof) related. Stupid logic!
Thanks.
--G
|
|
|
|
|
I'm Getting Different XML files.So I want to Create a single XSL file For all those XML Files..How Can I do?
|
|
|
|
|
What have you tried so far? What are you having difficulties with?
only two letters away from being an asset
|
|
|
|
|
Hi all,
I have developed a spring java web service which will be consumed by .net client
when ever I am adding a web reference from .net it fetching me error
The document was understood, but it could not be processed.
- The WSDL document contains links that could not be resolved.
- There was an error downloading 'http://iss2w900:7001/GetIssuerWS/ServiceSchema/Services/Core/v1/Issue/GetIssue/input.xsd'.
- The request failed with HTTP status 405: Met
'http://iss2w900:7001/GetIssuerWS/ServiceSchema/Services/Core/v1/Issue/GetIssue/input.xsd'.
this is path for my xsd file that internally call another schema location.
Cabn u please help me out
vijaya
|
|
|
|
|
Hi, I wrote a Schema Validator in C#.NET.
XmlTextReader R = new XmlTextReader(FileToParse);
XmlValidatingReader V = new XmlValidatingReader(R);
try
{
XmlSchemaCollection xsc = new XmlSchemaCollection();
xsc.Add("", SchemaFile);
V.Schemas.Add(xsc);
V.EntityHandling = EntityHandling.ExpandEntities;
V.ValidationEventHandler += new ValidationEventHandler(ShowValidationErrors);
while (V.Read())
{
}
//V.Close();
//MessageBox.Show("Validation Completed");
//R.Close();
}
catch (XmlException xe)
{
//Display exceptions
}
catch (XmlSchemaException xse)
{
//Display exceptions
}
catch (Exception ee)
{
//Display exceptions
}
finally
{
V.Close();
MessageBox.Show("Validation Completed");
}
This works fine if the xml file DOES NOT contain entity declarations.
But, If the xml file contains any entity declaration (as below), the 'ValidationEventHandler' throws errors like
"Validation Error: The 'mytest' element is not declared.Line : 8 Position : 2"
"Validation Error: The 'articles' element is not declared.Line : 9 Position : 2", etc.....
How do I overcome this in C#.NET
]>
<mytest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nonamespaceschemalocation="X:\Schema\content.xsd">
|
|
|
|
|
hi ,
can someone tell me what is xml serializer and why it works only on public fields
Thanks
Mukkanti
|
|
|
|
|
|
Because private means that the proprty/field/method/whatever is only visible to code inside the scope that declares it. Since an XmlSerialer class is not declared as part of your class code, it can't see inside your class.
|
|
|
|
|
Hi,
I am not able to display images using XML. Only images with .gif are being displayed. I tried out with jpeg and png extensions. Please help me out.
Thank you.
|
|
|
|
|
All I want to do is select all the nodes under the docment root. e.g:
<?xml version="1.0" encoding="UTF-8"?>
<Categories>
<Category>
<content_provider_id type="integer">1</content_provider_id>
<id type="integer">2</id>
<name>Traffic Alerts</name>
</Category>
<Category>
<content_provider_id type="integer">1</content_provider_id>
<id type="integer">1</id>
<name>News Alerts</name>
</Category>
<Category>
<content_provider_id type="integer">1</content_provider_id>
<id type="integer">3</id>
<name>testing category</name>
</Category>
</Categories>
What xpath would return all the Category nodes? But I don't want it to be specific to this xml file.
/\ |_ E X E GG
|
|
|
|
|
To return a collection (list) of nodes, you need to use the SelectNodes function. Using your example XML, to return all of the Category nodes, you need to use the following XPath query: //Category . This tells the parser to find all of the "Category" nodes that are one level below the root node.
|
|
|
|
|
Below is a sampling of my code. The code takes information from one program and list it all on an excel sheet. The problem is that the excel sheet is generic. Some of the information going into the excel sheet have different lengths of characters. How can i use this same code but instead of generating a generic excel sheet I could change the dircectory to point at a custom formatted excel sheet with all of the cells custom formatted.
thannks for any help.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- Output Design List as an comma seperated (csv) file. -->
<xsl:output method="text" encoding="iso-8859-1"/>
<xsl:template match="DESIGNLIST">
<xsl:for-each select="DESIGN">
<xsl:if test="position()=1">
<xsl:call-template name="DesignData">
<xsl:with-param name="HeaderRow" select="1"/>
</xsl:call-template>
</xsl:if>
<xsl:call-template name="DesignData">
<xsl:with-param name="HeaderRow" select="0"/>
</xsl:call-template>
</xsl:for-each>
</xsl:template>
<!-- Process and output the child elements of the design element. -->
<xsl:template name="DesignData">
<xsl:param name="HeaderRow"/>
<!-- Output the index -->
<xsl:choose>
<xsl:when test="$HeaderRow>0"><xsl:text>item Number</xsl:text></xsl:when>
<xsl:otherwise><xsl:value-of select="position()"/></xsl:otherwise>
</xsl:choose>
<!-- Output the columns -->
<xsl:if test="THUMBNAIL">
<xsl:choose>
<xsl:when test="$HeaderRow>0"><xsl:text>,Thumbnail</xsl:text></xsl:when>
<xsl:otherwise><xsl:text>,</xsl:text><xsl:value-of select="THUMBNAIL"/></xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="NAME">
<xsl:choose>
<xsl:when test="$HeaderRow>0"><xsl:text>,Design#</xsl:text></xsl:when>
<xsl:otherwise><xsl:text>,"</xsl:text><xsl:value-of select="NAME"/><xsl:text>"</xsl:text></xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="REV">
<xsl:choose>
<xsl:when test="$HeaderRow>0"><xsl:text>,Rev</xsl:text></xsl:when>
<xsl:otherwise><xsl:text>,</xsl:text><xsl:value-of select="REV"/></xsl:otherwise>
</xsl:choose>
|
|
|
|
|
Hi all,
Can anyone tell me How can we acheive RSS feed through ASP.net ?
Advance thanks
By Jegastar.
Exchanging the knowledge leads to wisdom.
|
|
|
|
|
We currently define the structure of flat file wthiin our organisation using fields stored in a database.
However i want to move to an xml file type definition to define file structure, maybe using some sort of schema file.
I've seen an article on the use of XFlat. Does anyone know if its any good or any other alternative 'best practice' solutions?
Regards
|
|
|
|
|
XFlat is an XML language for defining flat file schemas.
link[^]
Based on your post it sounds like you want to create XML files from your database so XFlat would be of no value to that effort.
What platform and development tools are you using?
Have you looked at any database/xml related articles here on code project?
|
|
|
|