XSL transformation
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 4
- Joined: Wed Nov 05, 2003 7:46 pm
XSL transformation
Post by agashirazi »
Hey guys,
First of all, I think its great we have a FREE forum thats actually out to help others.
Guys, I have an XML file with three tags i.e. <author>. Now I want to reinsert this into another XML file using an XSL query. I use the same value-of command, but it just gets the first author from the XML file, and pastes it thrice. I know why this is happening, but I do not want to go back and rename the author tags in the first XML file to author1, author2 and author3. Is there any other way out of it?
Once again, im really appreciative of this.
Thanks a million
Aga Shirazi
First of all, I think its great we have a FREE forum thats actually out to help others.
Guys, I have an XML file with three tags i.e. <author>. Now I want to reinsert this into another XML file using an XSL query. I use the same value-of command, but it just gets the first author from the XML file, and pastes it thrice. I know why this is happening, but I do not want to go back and rename the author tags in the first XML file to author1, author2 and author3. Is there any other way out of it?
Once again, im really appreciative of this.
Thanks a million
Aga Shirazi
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Dear Aga,
There are a lot of possible answers and one cannot know what fits best your needs unless you provide more details. Please consider posting a cut down sample that shows your problem.
Sure you do not need to rename the author tags as author1, author2, etc. you can access each of them separately. For instance if you use an XPath expression like //author you can access all the author elements in your input document. If you want to iterate through them you can use
You can have a template that matches author an if you issue apply-templates that will act on author elements that template will be activated.
If you want to access the first three author elements then //author[1], //author[2] and //author[3] will select them respectivelly.
Best Regards,
George
There are a lot of possible answers and one cannot know what fits best your needs unless you provide more details. Please consider posting a cut down sample that shows your problem.
Sure you do not need to rename the author tags as author1, author2, etc. you can access each of them separately. For instance if you use an XPath expression like //author you can access all the author elements in your input document. If you want to iterate through them you can use
Code: Select all
<xsl:for-each select="//author">...</xsl:for-each>
If you want to access the first three author elements then //author[1], //author[2] and //author[3] will select them respectivelly.
Best Regards,
George
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service