- Upvotes Received
- 4
- Posts with Upvotes
- 4
- Upvoting Members
- 4
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
101 Posted Topics
Re: Since 2002/2003 you can save any Word document as an XML file. Just follow Nick's directions above. There are some compatibility issues with older versions of word documents in XML format with newer formats. | |
Re: If you're writing an XSLT, whitespace typically either comes directly from the input document or while you're building the output tree. If you want to remove unwanted input whitespace from the input document and you want to make sure your output tree doesn't have any insignificant whitespace, use the strip-space … | |
Re: Good try. You're pretty close. Try this one. [CODE]<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="associd[associdtype = 'BBB']" /> </xsl:stylesheet>[/CODE] Produces the output [CODE]<associds> <associd> <associdentifierValue>12345</associdentifierValue> <associdtype>AAA</associdtype> </associd> </associds>[/CODE] | |
Re: XSLT 1.0 or 2.0 ? Please post a small sample of your XML input document and how you want the data to look like on the output. USE CODEBOXES. | |
Re: This should be able to be done. Microsoft excel document can be exported into and XML document. Then you can use and XSLT to modify this excel document into a different XMl structure that does what you need it to do. If you want to get the idea, I would … | |
| |
Re: So a input document can contain multiple "SOWaitingParts3" elements, that have the SAME JobOper_JobNum. And each JobOper_JobNum could have multiple "JobOper_OprSeq" elements? And you always want to see the sequence with the lowest number in the JobOper_OprSeq element? XSLt 1.0 or 2.0? | |
Re: Well this is pretty much the most basic XSLT you could write. I'll assume this is a homework assignment. This entire XSLT could be learned from W#C Schools [url]http://www.w3schools.com/xsl/default.asp[/url]. But you need to actually try. [CODE]<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <xsl:apply-templates select="catalog"/> </body> </html> </xsl:template> <xsl:template … | |
Re: You can't directly get the URL from an address bar in xslt unless it's in the input document. You can however use a javascript inside of an XSLT to get that. Please post a sample of your input document and your desired output that you're trying to achieve. | |
Re: It's hard to see exactly what you want because I don't quite understand the problem. If you need to have different rules happen for each SUBTABLE3 element, you need some kind of predicate to differentiate them. If they are all at the same level, you can use a positional predicate. … | |
Re: I think you're confused :) Are you trying to just test out some Xpath that you've written to make sure it's getting the correct nodes? Most XML IDE suites have an XPath query tool built in that allows you open the document and write your xpath and run directly on … | |
Re: Using your input. [CODE]<A> <B> <C> Hello </C> </B> <B> </B> </A>[/CODE] XSLT [CODE]<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*"/> <xsl:apply-templates/> </xsl:copy> </xsl:template> <xsl:template match="B[not(C)]"> <xsl:copy> <C/> </xsl:copy> </xsl:template> </xsl:stylesheet>[/CODE] RESULT [CODE]<A> <B> <C>Hello</C> </B> <B> <C/> </B> </A>[/CODE] | |
Re: You can use the document() function to bring the other XML document into the XSLT as a variable. [CODE]<xsl:variable name="SlaveDoc" select="document('Your_Doc.xml')" />[/CODE] Once it's stored a variable you can navigate that node set just like any other. You can write and Xpath that says Get me nodes that "Child_Part in … | |
Re: This really isn't an XML or XSLT problem. This is something that you should be looking at the Spring Documentation to solve. Or going to a Spring specific forum to ask your question. Just because it's an XML file configuration doesn't mean anyone here knows how to configure Spring or … | |
Re: Are you trying to do this validation within the XSLT itself? And if it doesn't pass this constraint in the XSLT, what behavior do you want? What versions of XSLT are you using 1.0 or 2.0? This very much sounds like something that would be better done in XML Schema … | |
Re: You're going to need to go to a Websphere specific forum. This is really for pure XSLT help. Configuring a 3rd party product really belongs to the product support itself. Not everyone (or anyone for that matter) is going to know the implmentation details of Websphere. Not to mention, if … | |
Re: Your document has multiple "entry" elements, but you current schema only allows for 1 and only 1 of them. You have to change the cardinality on the "entry" definition in order to allow for multiples. [CODE]<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="stations"> <xs:complexType> <xs:sequence> <xs:element name="station-entry" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="station-id" … | |
Re: I'm going to assume that you're only able to use XSLT 1.0. This is actually a really complicated grouping problem, because of the way your data is organized in the input document. You need to be able to group the sets of rows together that belong to the same Process##. … | |
Re: Well there's no concept of read only in XML Schema. It's either a required element/attribute or an optional element/attribute. If it's required in one message, but optional in another, sounds like you need to make it optional. (minoccurs = 0). However if this is something that you MUST check in … | |
Re: I'm confused as to what you're trying to do. Do you have input documents? How do you know which invoice in one document is supposed to be paired with an invoice in another document? Also XSLT 1.0 or 2.0? Please post a better description of the problem with your sample … | |
Re: Can you give an simple example document of what you're dealing with and what you want the desired output to be? Also XSLT 1 or 2 ? | |
Re: I'm working on a solution for this on and off as the day goes on, I'll let you know. It's actually a reasonably complicated problem in XSLT, but I'll have something quick and dirty today :) | |
Re: There's the "substring()" function in XPath. It's a standard function [url]http://www.w3.org/TR/xpath/#function-substring[/url] | |
Re: This is easily done in XSLT. This transformation will take your input document and produce it. I slightly modified the input document so I could verify it was working correctly. It assume 1 thing however. There will never exist a book node that has both a "desc" node and a … | |
Re: The problem is the schema has a default namespace defined. "xmlns="http://mediamart.com/books"" This means that all elements need to be in that namespace as well. Your XML document has the namespace "xmlns:bk="http//mediamart.com/books" defined. this means that things with the prefix "bk" are in that namespace. But, the document has nothing in … | |
Re: This is a pretty straight forward solution. (It's also exactly like another solution I posed a few days ago!) The idea here is that you have a recursive template. The template is called with a couple parameters. The "string" is the input string that you want to divided up. The … | |
Re: The error is pretty self explanatory. The matches functions takes a single supplied STRING and tests if it matches a certain regex format. anytime you call the matches() functions you can only put a single string in the input. "matches(//body, $date_regex)" it's VERY unlikely that there's 1 string in the … | |
Re: I've never seen the <xpath:set> or <xpath:compare> instructions before, so I have to assume those are custom functions you're using. But a simple boolean xpath direct string comparison should work. If the value of your variable is 'foo' the xpath below results in true. [CODE]channel_name = 'foo' [/CODE] Also in … | |
Re: The error message is pretty clear. Variables and parameters have a scope in XSLT depending on where they are declared. In general there's "template" scope and "file scope". A variable only exists and is scoped to he template in which it was declared. So if you have a situation like … | |
Re: So you want to basically add a newline after X number of string characters? First line = 44 characters Next Line = 44 Characters Etc Last Line = Leftover text < 44 What's the rule that you're using to format that particular text node? Once I know that I'll be … | |
Re: I've not used Access to import XSLT transformation, so I can't really speak to that problem. Sounds like either the filename or the document itself has invlad characters inside of it. If you're using Access, it's likely that you're using the MSXML processor to run your transformations. In that case, … | |
Re: There's multiple ways to do this. The best way is to use the document() function to pull your other file in as a second node set variable. Then you can process that node just like anything else. [CODE] <xsl:variable name="AnotherDocument" select="document('SomeDoc.xml')" /> [/CODE] Then you can access this variable just … | |
Re: No this isn't a syntax error per say. MSXML only supports XPath/XSLT 1.0. Doing select="for XXXX in" or select="if then else" is a 2.0 XPath usage. You need a processor that supports 2.0, Saxon for example. | |
Re: why not just //ID for the first? //ABC:plastic_number there's nothing to stop from using the fully qualified name in the xpath. | |
Re: The problem is that you haven't provided us with a defined output. Based off your input document, actually build the HTML result page that your desire. Then we can clearly see the mappings from the input to the ouput, and provide a solution. "I need help trying to get the … | |
Re: It would be helpful if we knew what your input XML document looked like :P Please post a sample of input document (USE CODEBOXES) so we can use it to get your output. Is this XSLT 1.0 ? What processor are you running this on? | |
Re: Why doesn't //p work? You're problem isn't very well described. If you want a clear answer, please give is a stripped down sample document that we can see and use to see your problem. Along with what your desired result set looks like. Do something like this user does in … | |
Re: XPath 1.0 or 2.0? I'm working on something that might meet your needs, but IU don't understand what kind of FOR loop you mean. Are you implementing something in Java/C# that is using this XPath to get a certain node set? Or is this a pure XSLT problem to generate … | |
Re: Well, I don't really have an answer. I took your documents and ran them myself in Stylus Studio, using the Saxon Processor 9.X (XSLT 2.0) and everything worked perfectly fine. I also ran it command line using an older version of Saxon and it worked as well. Obviously this is … | |
Re: Well that's confusing....the entire point of parsing an XML document, is to use a parser. So what is it that you're really trying to do? There are other parsers out there aside from DOM or Sax, but this question doesn't make sense :P | |
Re: This problem isn't complicated, but it's obvious we don't have the entire picture of what your transformation is trying to do. Why don't you provide a simple, stripped down input document. And the Target output document of what you want it to look like. Try and keep as simple as … | |
Re: Because you actually made an effort to solve the problem yourself, and you have the right idea, I'll happily provide you with a solution. It's not the only solution, but it should give you the right ideas. Just put the result in an html document and you'll see it. Also, … | |
Re: Here's a real answer. Look at the web pages below under the "Enumerated attribute values" [URL="http://www.w3schools.com/DTD/dtd_attributes.asp"]http://www.w3schools.com/DTD/dtd_attributes.asp[/URL] [URL="http://www.xmlfiles.com/dtd/dtd_attributes.asp"]http://www.xmlfiles.com/dtd/dtd_attributes.asp[/URL] Use google and "enumerate DTD" and you'll find other examples. The idea is that you can use the <!ATTLIST> and make a list of valid strings that are allowed in those attributes. you … | |
Re: This is an HTML design problem, not an XSLT problem. What you want is "nested tables". Do some googling to learn how to nest 2 tables within a second table. Here's the first link I found. [URL="http://www.htmlcodetutorial.com/help/archive.php/o_t__t_1472__i-need-tables-side-by-side..html"]http://www.htmlcodetutorial.com/help/archive.php/o_t__t_1472__i-need-tables-side-by-side..html[/URL] And example would look something like this, but there's many different ways to … | |
Re: It's an Identity Template with a match on ANY element that has an attribute. ' match="*[@*]" ' [CODE]<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*"/> <xsl:apply-templates/> </xsl:copy> </xsl:template> <xsl:template match="*[@*]" /> </xsl:stylesheet>[/CODE] | |
Re: So, this really is challenging in XSLT 1.0. You basically have to break it down into phases of sorting, grouping, then processing. In 2.0, you can do all of this in basically one pass. The solution posted below, is broken into three steps. The first step is to take the … | |
Re: Provide a sample XML document that you're trying to produce. If we can see what structure you're trying to produce with your transformation, we can can provide a solution. We've got your input document, but what are you trying to produce? Give us a sample output. |
The End.