Jump to content

kvnmck18

Members
  • Content Count

    365
  • Joined

  • Last visited

Community Reputation

0 Neutral

About kvnmck18

  • Rank
    Member
  • Birthday 04/18/1986

Previous Fields

  • Languages
    XHTML, CSS, XML, XSLT, PHP, Javascript, ActionScript, Photoshop, English, Spanish

Contact Methods

  • Website URL
    http://
  • ICQ
    394941439

Profile Information

  • Location
    Columbus, Ohio USA
  • Interests
    Counting.<br />And I begin: 1, 2, 3...
  1. I feel that you and I worked on one a couple years back. Do you remember this? If so, do you know where that forum thread is?
  2. It has been a good couple of years since I have used SimpleXML to add and modify nodes/attributes. For a personal project I am working on it would be the easiest solution. Below I have posted an example of my XML. The XML is used to build forms for an little jQuery web-app. I am trying to use PHP to create new <Type/> with an inner child of <form/> that will have different <input/> nodes that will have different content in their attributes. Basically, it's pretty simple - I just need some refreshing on how to do this. The only "tricky" part is if a node is added with a the @type="select" it will have it's own children (<input/>).I just need a simple way to create these nodes/attributes and modify them. It's sad that php.net documentation is horrible on this topic and you have to dig deep into XML DOM to even get started.Another tricky thing is that I do not want to delete nodes, the "delete function" I want to work as a "comment out" for that node. So wrap that node with a "<!-- <node/> -->" <Site> <Page> <Type title="Web form" description="Create a new form"> <form name="webpageFORM"> <input title="Question" type="checkbox" defaultValue="1"/> <input title="Email" type="input" defaultValue=""/> <input title="Select" type="select" defaultValue=""> <input title="Opt 1" defaultValue="1"/> <input title="Opt 2" defaultValue="2"/> <input title="Opt 3" defaultValue="3"/> </input> </form> </Type> </Page></Site> Hope someone can help me out. Let me know if I didn't explain this good enough // I'm pretty tired.Thanks in advance!-Kevin
  3. jesh, thanks for your response. I don't know why - but that seems to be working.... I know I tried that before. I probably just had a server-cache.
  4. I just tried this too... and no success: string xml = "<all><node>TEST</node></all>"; string xslPath = Server.MapPath("XSL.xsl"); string id = Request.QueryString["id"]; XsltArgumentList args = new XsltArgumentList(); args.AddParam("id", "", id); ////////// UTF8Encoding xmlUTF = new UTF8Encoding(); byte[] byteXML = xmlUTF.GetBytes(xml); MemoryStream stream = new MemoryStream(byteXML); XmlTextReader xmlReader = new XmlTextReader(stream); //FileStream fs = new FileStream(xmlPath, FileMode.Open, FileAccess.Read); //StreamReader reader = new StreamReader(fs, Encoding.UTF8); // XmlTextReader xmlReader = new XmlTextReader(reader); XPathDocument doc = new XPathDocument(xmlReader); XslTransform xslDoc = new XslTransform(); xslDoc.Load(xslPath); xslDoc.Transform(doc, args, Response.Output); stream.Close(); //reader.Close(); xmlReader.Close();
  5. My code is below. I know my issue is with the "MapPath" I have tried to using XmlTextReader along with StringReader but I have had no success. Should I make the XML into an object? <%@ Import Namespace="System.Xml" %><%@ Import Namespace="System.Xml.Xsl" %><%@ Import Namespace="System.Xml.XPath" %><%@ Import Namespace="System.IO" %><%@ Import Namespace="System.Text" %><%@ Import Namespace="System" %><%@ Import Namespace="System.Net" %><script language="C#" runat="server"> public void Page_Load(Object sender, EventArgs E) { string xml = "<all><node>TEST</node></all>"; string xmlPath = Server.MapPath(xml); string xslPath = Server.MapPath("XSL.xsl"); string id = Request.QueryString["id"]; XsltArgumentList args = new XsltArgumentList(); args.AddParam("id", "", id); FileStream fs = new FileStream(xmlPath, FileMode.Open, FileAccess.Read); StreamReader reader = new StreamReader(fs, Encoding.UTF8); XmlTextReader xmlReader = new XmlTextReader(reader); XPathDocument doc = new XPathDocument(xmlReader); XslTransform xslDoc = new XslTransform(); xslDoc.Load(xslPath); xslDoc.Transform(doc, args, Response.Output); reader.Close(); xmlReader.Close(); }</script> Thanks in advance.
  6. That's pretty good info, "Deirdre's Dad". So have you wrote code to create an "app" with it?
  7. In that case, the lat/long points equation to calculate to miles should not be that difficult. Have you ever see any other posts or sites that talk about this? I have heard that there are free up-to-date databases. Every 6 months a new "official" database is released in the US by the Post Office.
  8. I am trying to figure out how to create a "zip code radius look-up". How is this done? Where can I get a free and accurate database to download that includes zip codes with city, states, long/lat values?Example: I have a list of items that are available in various cities and I want the user to be able to say "find closest available" based off of a Zip-Code in 25 miles. (This isn't a true example, but I think it helps make sense of what I'm trying to figure out)I have always wondered how this works and I don't get Zip-Codes, I don't even know how they are formed (haha)
  9. I am building some canonical elements in an XSLT page. <link rel="canonical" href="{$CanonicalURL}"/> But in the source code my "&" is always "&" -- which is usually a good case but not when using a canonical.I have this code in my XSLT: <xsl:text>http://www.kvnmck18.com/?id=</xsl:text> <xsl:value-of select="Page[@ID=$CononicalID]/@ID"/> <xsl:text disable-output-escaping="no"><![CDATA[&]]>title=</xsl:text> <xsl:value-of select="Page[@ID=$CononicalID]/title"/> This will display as: but needs to be like: How can I do this without throwing errors in the XSLT?
  10. It is valid UTF-8, test it yourself. It's weird.What's weird is that character doesn't post when you disable-output-escaping="yes"XML CDATA bugggggggggg?
  11. jQuery docs are limited for paste event - that's why it's difficult. But, I know there has to be way to get that data.justsomeguy, you should add this to your list of languages. I think you would love it* - syntax is very very simple to use and it is extremely powerful and light. :)I'm going to continue to dig on this! Let me know if you think of anything else // I appreciate your thoughts[*Based off of your posts and your vast knowledge of other languages/scripts]
  12. Here's my code with the log: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled</title> <script type="text/javascript" src="jquery-1.2.6.js"></script> <script type="text/javascript"> $(document).ready(function() { $("textarea").bind('paste', function(e) { Fnc(e); }) function Fnc(e) { var text = e.handler.prototype.value; console.log(e); alert(text); } }); </script></head><body> <textarea cols="50" rows="10"></textarea></body></html> But I can't find anywhere in the log that has the data that is "stored in the paste". Have you tried?
  13. <Items> <Item> <title><![CDATA[»]]></title> <subtitle><![CDATA[»]]></subtitle> </Item></Items> Here's the full code - I extracted it. For some reason it adds "Â" in front of the "raquo"-- I don't know where this is coming from. When I remove the "Â" it gives me the following error: Have you ever seen this? Is there a work-around?
  14. I am receiving the following error: from the following element:<title><![CDATA[Blog test3& <>]]></title> Is there a reason why this code is happening? Isn't this code if I am mixting UTF-8 and ISO-8859-1 - but the content is very basic html characters in a CDATA.Then a couple lines down I have: <meta> <![CDATA[ 1. » 2. dfsdfdsf 3. & 4. < 5. >]]> </meta> And this contains no errors at all.Is there some kind of "hidden character" in my whitespace?
  15. I'm having issues with that - if it would a "standard" event like a click, it would be easy. But I can't get the log of "paste"Any idea on how?
×
×
  • Create New...