Code Monkey home page Code Monkey logo

Comments (3)

AirQuick avatar AirQuick commented on July 24, 2024

Are you looking for something like this?

test.xsl

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet exclude-result-prefixes="#all" version="2.0"
	xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template as="text()" match="remotelink">
		<xsl:value-of select="(child::emph, .)[1]" />
	</xsl:template>
</xsl:stylesheet>

test.xml

<?xml version="1.0" encoding="UTF-8"?>
<CASEDOC>
	<docinfo>
		<url>
			<remotelink>http://www.uspto.gov/trademarks/teas/index.jsp</remotelink>
		</url>
		<url>
			<remotelink>http://<emph>www.lawandarts.co.uk</emph>/</remotelink>
		</url>
	</docinfo>
</CASEDOC>

test.xspec

<?xml version="1.0" encoding="UTF-8"?>
<x:description stylesheet="test.xsl" xmlns:x="http://www.jenitennison.com/xslt/xspec">
	<x:scenario label="testing">
		<x:context href="test.xml" />

		<x:scenario label="remotlink w/o child::emph">
			<x:context select="/CASEDOC/docinfo[1]/url[1]/remotelink[1]" />
			<x:expect label="transformed to url"
				>http://www.uspto.gov/trademarks/teas/index.jsp</x:expect>
		</x:scenario>

		<x:scenario label="remotelnk w/ child::emph">
			<x:context select="/CASEDOC/docinfo[1]/url[2]/remotelink[1][child::emph]" />
			<x:expect label="extracts emph">www.lawandarts.co.uk</x:expect>
		</x:scenario>
	</x:scenario>
</x:description>

Result

C:\test>bin\xspec.bat test.xspec
...
passed: 2 / pending: 0 / failed: 0 / total: 2

from oxygen-xml-editor-xspec-support.

neeraj0015 avatar neeraj0015 commented on July 24, 2024

from oxygen-xml-editor-xspec-support.

AlexJitianu avatar AlexJitianu commented on July 24, 2024

It don't think there is anything to be done here anymore.

from oxygen-xml-editor-xspec-support.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.