Jump to content

boen_robot

Members
  • Posts

    8,493
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by boen_robot

  1. boen_robot

    CSS Customization

    It's possible with XML and XSLT I think. But you'll have to use XML file instead. Your file will look something like: <css><component>1 CSS to be used</component><component>2 CSS to be used</component><component>3 CSS to be used</component></css> Then, with XSLT, you can transform that into an XHTML equivalent: <link type="text/css" rel="stylesheet" href="1 CSS to be used" /><link type="text/css" rel="stylesheet" href="2 CSS to be used" /><link type="text/css" rel="stylesheet" href="3 CSS to be used" /> Or a CSS equivalent: @import url('1 CSS to be used');@import url('2 CSS to be used');@import url('3 CSS to be used'); Or even both, but that's not usefull here .That is what you want, right? If not, what do you mean? Any example in code?
  2. It seems the W3C validator doesn't like the keyword "transparent". If you explicitly use a color in any other form, it removes the warning. The strange thing is that it doesn't show a syntax error or anything. It just behaves as if background-color is not declared at all.I think I'm going to report this to the validator team right now.[edit] It's reported. See Bug 768 for details.[/edit]
  3. boen_robot

    XML validation doubt

    Try doing anything with the data by using a script that actually validates the input before making the query. You won't succeed at that point. The DTD makes sure of it.
  4. Did you tryed using "margin: 0 auto;" instead? And remove this align property, will you? It doesn't exist:p { padding:0; margin:0 auto; text-align:center;}p.a { font-weight:bold;color:red;padding-bottom:0px; margin: 0 auto; text-align: center;} [edit] I did. Can't you read? Look at my last code.[/edit]
  5. I'm telling you, distinct-values() is the real deal, but it's simply not supported yet: nodes = xmldoc.selectNodes("distinct-values(Holiday/Data[Month = 'August'])"); There isn't any other XPath only way to do this. Scripting can only do it's way around it with more scripting.
  6. The same way you would center anything else. "margin: 0 auto;" or "text-align: center;" depending if you want to center the element or it's content (text to be exact).
  7. Wait wait wait... you're saying this JavaScript enables PNG alpha transparency in IE5.5 and IE6?That would be priceless if it works (I'll test it later...). Where did you got it from? Is it yours? If so, then you're one heck of a JavaScript master .
  8. Do you at least know an <object> that would work only in FF or Opera? You can use IE's conditional comments to hide the inner objects from it, thus allowing it to see only the object it could handle.
  9. WRONG! Source for validating the page. Source for rendering is the MIME type.@Sakura I don't think you need a DTD with a web service. WSDL file may be enough.
  10. I would suggest you learn and get a load of PHP's SOAP functions. You'll also need to enable the soap extension.By the way, feel free to PM me any breakthroughs you make. I'm especially interested in Web Services, but I'm not that good at PHP. Not to mention I'm still trying to imagine a use case.
  11. Just from curiosity, what is your native language anyway?
  12. Oh, pure JavaScript way. Um... no. You'll have to wait until the distinct-values() function is supported.The only workaround I can think of is if you query every element of the targeted group and compare it's value with the previous one, then output it if it's not duplicated. I'm not good at JS, so I can't tell you how exactly to do this.
  13. As a matter of fact, I figured the solution shortly after I posted the first one, but I was too busy to post it .Simply define a loop as normal. The output is converted to a single text node, so it's much like a concatenation: <ServiceNumber><xsl:for-each select="service_id"><xsl:value-of select="."/><xsl:if test="position()!=last()">,</xsl:if></xsl:for-each><ServiceNumber> If you need to re-use this value in another element, then you could enclose everything up to the <ServiceNumber> element in a template that you would call, or a variable. Each method has it's pros and cons, depending on the situation.
  14. I can't help you with the first question, mostly because I have never even head of this "SQL DDL" thing.For the second one, I can tell you for sure that XSLT is NOT the solution. XSLT can convert XML to another XML based document or plain text, but not any other formats.The only sure way I know to map XML to SQL data fields would be to use a server side script, but writing it would be such a big pain...
  15. I guess it really depends on the web service itself. That's why both options exist after all . If you mean a single containing element for all parameters, then the answer is definetly no. This makes use harder.
  16. If you only want the data grabbed from another site, you may get the targeted data with a DOM inside a server side script (or XPath in XSLT, but that's out of the question). If the other site is written in XHTML, you may actually use the server side script's XML parser to launch an XPath expression aimed at the targeted data.If you want to completely preserve the other site, I think the <object> element is the only non-frame way, but I'm not aware of a cross browser configuration for it. Not to mention the ugly "click here to activate this control" which will appear.
  17. Simply use the position() to move from one element to another: <ServiceNumber><xsl:value-of select="concat(service_id[position()=1], ',' ,service_id[position()=2], ',' ,service_id[position()=3]"/><ServiceNumber> It's a bit trickier if the number of service_id elements is unknown though. Is that the case here, or does this work for you?
  18. You mean you want to perform an XPath expression that returns only distinct values?There are three ways:1. The XPath 2.0 function disting-values(). Not supported by most of today's XSLT processors, so it's probably out of the question.2. The set:distinct() EXSLT function. It's not supported across XSLT processors though. If you're using XSLT on the client side, then it's not supported for sure.3. Download the set:distinct EXSLT template and include it in your stylesheet. Call it like this: <xsl:call-template name="set:distinct"> <xsl:with-param name="nodes" select="node-set" /></xsl:call-template>
  19. Well, web services are for trasmitting data across domains, not whole pages or anything. If you want to include the result, you could just use your server side script's XML reader to caputre that data with an XPath expression like /html/body//table aimed at the result document. Use the web service, if you want to caputre the data and give it some alternative presentaion.
  20. Oops. Busted . In my haste for the problem (registering a domain) I didn't wrote the abbreviation correctly .[edit]@Cronthenoob, please refer to the topic I gave a link to.[/edit]
  21. All a <div> defines is a devision. A part of the page. Achors define a clickable link. You should re-learn HTML. Elements can be nested in one another, simply by marking the inner element with the outer one. For example, in your case: <DIV Id="Bar1" class="Bar"><a href="BP-Docs\HPSD Personnel Numbers.html">BP Acc and Pwd</a></DIV> A valid case (as far as I remember) is: <a href="BP-Docs\HPSD Personnel Numbers.html"><DIV Id="Bar1" class="Bar">BP Acc and Pwd</DIV></a>
  22. I'm scared to ask what this JS does (it looks scary).Well, as I said, use anchors instead. In other words: <a> elements.Eg : <a Id="menuItem1_1" class="menuItem" cmd="BP-Docs\HPSD Personnel Numbers.html" target="_parent">View User Account</a>
  23. <div> elements can't serve as linking elements. Only anchors can. In HTML 4, XHTML 1.0, XHTML 1.1 that is. XHTML 2 is expected to allow every element to be used as a link with the "href" attribute, the same way that anchors are today.What is this "cmd" attribute for anyway?
  24. boen_robot

    Purpose of XML

    For the same reason you need an information in any kind of database, like MySQL for example. To re-use a piece of data multiple times over, applying it different presentation each time, or simply calling it on more then one time on a single platform.I thought you understood me the last time. Oh well...A more real life example. You have a menu at your site. Let's say it you have "Home", "Products" and "About". Your site has 1000 pages. In a static environment, each page might look like: <html><head>...</head><body><div id="menu"><ul><li><a href="/">Home</a></li><li><a href="/Products">Products</a></li><li><a href="/About">About</a></li></ul></div><div id="main">...</div></body></html> Now imagine that you want do add a "Links" menu. Do you really want to go over 100 pages and add the new menu to each one? No, you don't.At that point, many will suggest SSIs (Server Side Includes), which is a good start for the unaware and is appropriate for the situation above. However, imagine that the menu is quite larger and even has submenus for the sake of usability. Let's say there are 30+ links there. Adding or removing a single one is easy with SSIs, but what would you do if let's say, the path to a certain group of items changes. You would have to edit every single occurance of the old path to the new one. With a database driven site, you can only modify one path, so that everything that uses it will now use the new path.It's all for the sake of flexibility. The ability to influence on multiple platforms is also to be mentioned. You edit one data and everything that uses it accepts it automatically.
  25. boen_robot

    convert xml

    Well, you don't have anything complicated, so the easiest thing to do is simple mapping: <xsl:template match="oldElementName"><newElementName><xsl:apply-templates/></newElementName></xsl:template> However, I don't understand how would you know the author of the second para? I mean it isn't written anywhere in the input.
×
×
  • Create New...