For XML you can use xpath to grab data from xml. http://camel.apache.org/xpath
But mind that xpath is not always so easy, especially if the xml has namespaces, as then you must use namespace mappings. But if you already loaded the data from XML into some Java objects with XSDToCamel then you can just use java code to grab it. eg its not so much a Camel problem how to get some piece of data from XML. That is a generic use-case, which you can search the internet to find solutions / study to learn more. On Fri, Dec 5, 2014 at 1:27 PM, smilevasu6 <[email protected]> wrote: > Its about xsd file. I created bean in java and calling from camel like > > .bean(XSDToCamel.class,"parseXSD(/home/cloudera/Desktop/Sample.xsd)") > > then i need to fetch the tags like, > > .setHeader("tablename", simple("${body[0]................")) > > Here i am expecting the tag value > > My XSD: > > <?xml version="1.0" encoding="utf-8"?> > <xs:schema elementFormDefault="qualified" > xmlns:xs="http://www.w3.org/2001/XMLSchema"> > <xs:element name="Address"> > <xs:complexType> > <xs:sequence> > <xs:element name="Recipient" type="xs:string" /> > <xs:element name="House" type="xs:string" /> > <xs:element name="Street" type="xs:string" /> > <xs:element name="Town" type="xs:string" /> > <xs:element name="PostCode" type="xs:string" /> > <xs:element name="Country" type="xs:string " /> > </xs:sequence> > </xs:complexType> > </xs:element> > </xs:schema> > > > > How can i get the element name? > > Because i need to insert into database dynamically. Reason why i need > element name to fetch. > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Camel-Array-tp5760111p5760209.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/
