|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Just worte about this today:
creating a .css file for xml - SitePoint Forums Code:
<xsl:stylesheet version='1.0' xmlns:xsl="http://w3.org/1999/XSL/Transform" xmlns="http://w3.org/1999/xhtml"> <xsl:output method="xml" ... /> </xsl:stylesheet> Quote:
axis::node test [predicats] structure while filtering node sets. So you need to know the following concepts to perform tests:
Quote:
Read more ...
__________________
Mini Network:: Financial information at your fingertips Learn object oriented programming where it started Last edited by kgun; 12-05-2007 at 12:04 PM. |
|
||||
|
Regarding my last remark.
To cite from may favourite PHP XML book, Robert Richards (2006): "Pro PHP XML and Web Services" from Apress page 354: The name attribute, whose value is interpreted as an attribute value template, specifies the target of the Processing Instruction (PI) being created. The content of the element defines the data for the PI: Code:
<xsl:processing-instruction name ="php"> print "Hello World"; </xsl:processing-instruction> |
|
||||
|
Thanks for the information so far. I am (somewhat) getting the hang of it. I have a preliminary build of the site's first few pages up at TicketWarehouse.us, but I am finding certain components of this more tricky than others. For example, if I have html content in the xml file (such as inline elements like links) the processor ignores them. I have gone through stacks of tutorials but haven't been able to find anything that addresses topics beyond the very basics covered in the w3schools tutorials.
__________________
The best way to learn anything, is to question everything. |
|
||||
|
I have mentioned one of my favourite books above. It is excellent. If you are going to be serious about this, you have to go to Amazon or another bookstore and buy some books, KW search:
You can view a page online. You can view its source. The DOM is another method to view a page. Basically it maps the element, attributes, text nodes etc. onto a node tree of objects. You can manipulate the document by walking through the DOM tree, changing, deleting, inserting elements etc. You have complete control over the document by combining these technologies. You find the most important technolgies here. It is technical, but the sooner you get used to searching for the right concepts, you should learn to use this site. As an extra benefit, you will be able to make Web applications and AJAX much better after you handle the XML and DOM technologies.
__________________
Mini Network:: Financial information at your fingertips Learn object oriented programming where it started Last edited by kgun; 12-05-2007 at 07:01 PM. |
|
|||
|
I had also lot of same kind of conditional problems when I wrote my WAP platform - Developing mobile web publishing platform using XML, XSLT and Perl. « Veiko Herne – lifetime entrepreneur with adventurous soul
In some cases I got it work using choose instead of if. Somehow everything worked much better in Opera than IE. XPath is not supported at all with browsers (IE 7, Opera 9), so I wasn't able to use it. If element does not exists you should use apply-templates for that condition.
__________________
Submit your site free to Unknown Web Directory eCommerce and Internet Marketing articles in my blog |
|
||||
|
Quote:
Solution: If there is no browser support for the XML technology, you can:
Let progressive enhancement be your guiding principle. Start simple and increase functionality and complexity. Related link: XSL Operators >= and <= - SitePoint Forums
__________________
Mini Network:: Financial information at your fingertips Learn object oriented programming where it started Last edited by kgun; 12-06-2007 at 11:01 AM. |
|
|||
|
The problem I tried to solve with XPath was that I had several <comment> tags for each <item> and I tried to get comments visually appear on separate WAP pages.
I added ID's for each comment but still wasn't able to format those with XSLT this way as specified with XPath. If anyone have ideas how to implement this with XSLT I would be more than happy to learn. Im unable to add any additional parsers as Im trying to run my app anywhere and was testing it on free UNIX server. I do not have any thousands of pounds project budgets to do something.
__________________
Submit your site free to Unknown Web Directory eCommerce and Internet Marketing articles in my blog |
|
||||
|
Quote:
Note: Comment nodes do not have an expanded name and are children of either the root (document in XPath 2.0) or the element nodes, but those are not parents of the comment nodes in XPath. So if you are talking about comment (or processing instruction) nodes, those may be filtered with special filters in XPath. Note: Elements should be semantic, like links. Use descriptive and meaningful names for elements and dispaly content on your site using elements that contains information. Separate
|
|
|||
|
The XML code I had was following:
<item><description>this is page one</description></item>
__________________
Submit your site free to Unknown Web Directory eCommerce and Internet Marketing articles in my blog |
|
||||
|
The line should be <comment id="comment1">this should be on comment page one</comment> and you would access it with a test conditional
<xsl:choose> <xsl:when test="@id='comment1'> <xsl:apply-templates /> </xsl:when> </xsl:choose> Of course there will be additional decision logic in the template file to determine which comment to display based on the request url or some other parameter, but this example is just to show how to test for the attribute.
__________________
The best way to learn anything, is to question everything. |
|
||||
|
This is a typical XPointer (and XLink) problem. But the support for both technologies is not implemented in the major browsers as far as I know, but there are XML PHP libraries that can be used. Even some JavaScript libraries like jQuery (note the book Learning jQuery) has implemented XML functionality like XPath. Navigating, moving and manipulating the DOM tree is fairly easy once you understand these libraries.
Back to your problem. Ideally the (future?) solution using XPointer is: General syntax: xpointer(xpath_expression) Solution: http://www.xxx.com/item1.xml#xpointer(id('comment1')) That is a static HTML link. You can hoperfully soon make it semantic using XLink. And you can write XSLT transformations to transform XLinks to HTML links as long as the browsers are not XPointer and XLink enabled.
__________________
Mini Network:: Financial information at your fingertips Learn object oriented programming where it started Last edited by kgun; 12-07-2007 at 11:08 AM. |
|
|||
|
As far I remember the problem was to pass a URL parameter to the XSLT file. Thats why I wasnt able to use any workarounds to implement conditional operations as I had a need to know, which comment was shown and which was the next one.
__________________
Submit your site free to Unknown Web Directory eCommerce and Internet Marketing articles in my blog |
|
|||
|
I would be interested to know how you went on with your "pure XML site" - I am working on one at the moment, and my experience has been that, for basic listings (items for sale, etc), it seems to be OK (although not as straightforward as CSS), but for complex areas, like Admin, or members areas, requiring a lot of input, it just seems to add an unnecessary level of complication.
I usually write PHP/MySQL, with as much code / data separation as sensible via CSS.
__________________
Pete Clark Got any spare time? Anything you need? Barter in Spain at http://BarterWithBart.com |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| getting XML file to show on separate pages using XSLT? | Veikoh | Web Programming Discussion Forum | 0 | 09-12-2007 10:01 PM |
| Office2007, OpenXML and XSLT. | kgun | IT Discussion Forum | 0 | 06-01-2007 09:57 AM |
| XSLT Question | subho | Graphics & Design Discussion Forum | 3 | 01-20-2007 11:36 AM |
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |