Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: need help from xsl guru

From: William Park <opengeometry@-----.-->
To: NULL
Date: 11/2/2004 3:04:00 AM
eric <ezhou@s...> wrote:
> Hi,Joris:
> 
> I checked the html output. it is still a little bit different than I thought.
> 
> How can we have something like: 
> 
> p1 1000
>    c1 1001
>    c2 1002
> p2 2000
>    c3 2001
> p3 3000


If you can compile a Bash shell, then you can try

    start () {
	case ${XML_ELEMENT_STACK[1]} in
	    child) [ "$parent_name" ] && printf '%s %s\n' $parent_{name,id}
		   unset parent_{name,id}
		   ;;
	esac
    }
    data () {
	local e=${XML_ELEMENT_STACK[1]}
	case $e in
	    name|id)
		pp_append ${XML_ELEMENT_STACK[*]|/^(child|parent)$}
		strcpy $2_$e $1
		;;
	esac
    }
    end () {
	case ${XML_ELEMENT_STACK[1]} in
	    parent) printf '%s %s\n' $parent_{name,id}
	    child) printf '\t%s %s\n' $child_{name,id}
	esac
    }
    xml -s start -d data -e end "`< file.xml`"

Ref:
    http://freshmeat.net/projects/bashdiff/

-- 
William Park <opengeometry@y...>
Open Geometry Consulting, Toronto, Canada


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent