Nitin Agrawal
Contact -
  • Home
  • Interviews
    • Secret Receipe
    • InterviewFacts
    • Resume Thoughts
    • Daily Coding Problems
    • BigShyft
    • CompanyInterviews >
      • InvestmentBanks >
        • ECS
        • Bank Of America
        • WesternUnion
        • WellsFargo
      • ProductBasedCompanies >
        • CA Technologies
        • Model N India
        • Verizon Media
        • Oracle & GoJek
        • IVY Computec
        • Nvidia
        • ClearWaterAnalytics
        • ADP
        • ServiceNow
        • Pubmatic
        • Expedia
        • Amphora
        • CDK Global
        • CDK Global
        • Epic
        • Sincro-Pune
        • Whiz.AI
        • ChargePoint
      • ServiceBasedCompanies >
        • Altimetrik
        • ASG World Wide Pvt Ltd
        • Paraxel International & Pramati Technologies Pvt Ltd
        • MitraTech
        • Intelizest Coding Round
        • EPAM
    • Interviews Theory
  • Programming Languages
    • Java Script >
      • Tutorials
      • Code Snippets
    • Reactive Programming >
      • Code Snippets
    • R
    • DataStructures >
      • LeetCode Problems
      • AnagramsSet
    • Core Java >
      • Codility
      • Program Arguments OR VM arguments & Environment variables
      • Java Releases
      • Threading >
        • ThreadsOrder
        • ProducerConsumer
        • Finalizer
        • RaceCondition
        • Executors
        • Future Or CompletableFuture
      • Important Points
      • Immutability
      • Dictionary
      • URL Validator
    • Julia
    • Python >
      • Decorators
      • String Formatting
      • Generators_Threads
      • JustLikeThat
    • Go >
      • Tutorial
      • CodeSnippet
      • Go Routine_Channel
      • Suggestions
    • Methodologies & Design Patterns >
      • Design Principles
      • Design Patterns >
        • TemplatePattern
        • Adapter Design Pattern
        • Decorator
        • Proxy
        • Lazy Initialization
        • CombinatorPattern
        • RequestChaining
        • Singleton >
          • Singletons
  • Frameworks
    • Apache Velocity
    • Spring >
      • Spring Boot >
        • CustomProperties
        • ExceptionHandling
        • Issues
      • Quick View
    • Rest WebServices >
      • Interviews
      • Swagger
    • Cloudera BigData >
      • Ques_Ans
      • Hive
      • Apache Spark >
        • ApacheSpark Installation
        • SparkCode
        • Sample1
        • DataFrames
        • RDDs
        • SparkStreaming
        • SparkFiles
    • Integration >
      • Apache Camel
    • Testing Frameworks >
      • JUnit >
        • JUnit Runners
      • EasyMock
      • Mockito >
        • Page 2
      • TestNG
    • Blockchain >
      • Ethereum Smart Contract
      • Blockchain Java Example
    • Microservices >
      • Messaging Formats
      • Design Patterns
    • AWS >
      • Honeycode
    • Dockers >
      • GitBash
      • Issues
  • Databases
    • MySql
    • Oracle >
      • Interview1
      • SQL Queries
    • Elastic Search
  • Random issues
    • TOAD issue
    • Architect's suggestions
  • Your Views
Attached is the short tutorial on XSD taken from one online resource mentioned in the document itself.

If need more details then visit the given link. Will attach some samples of xsd later.

http://www.w3schools.com/schema/default.asp
xsd_tutorial.docx
File Size: 149 kb
File Type: docx
Download File

Ok...if you have gone through the attached tutorial file then check the attached XSD files.
I will take the JAXB code for these XSD later. Also attached is the xml file sample for the main XSD - trade.xsd
I believe that all the XSDs are covered in the generated xml for trade. Just check it once.
trade.xml
File Size: 4 kb
File Type: xml
Download File

xsd.zip
File Size: 7 kb
File Type: zip
Download File

Below are the java files to provide the dummy data to create the xml file for trade.xsd. You can generate the jaxb classes in eclipse, so have not attached those classes here. Just download these & execute them to understand some features of xsd & jaxb. I have just provided these so that you should not need to create the basic structure to explore further. Enjoy :)
creators.zip
File Size: 4 kb
File Type: zip
Download File

processors.zip
File Size: 0 kb
File Type: zip
Download File

binding.xml
File Size: 0 kb
File Type: xml
Download File

Below file can be used to save & read the xml data from Oracle database. You need to create your own connection to database. To execute the below class you will also need to download jars - xdb.jar, xmlparsev2.jar, ojdbc6.jar
sqlxmls.java
File Size: 2 kb
File Type: java
Download File

Below java file can be used to read the above trade.xml if you are not having xsd for that xml but want to read value of a particular tag. Below I am fetching the first name of client & so have used the break point if reader is going outside client details. Similarly you can tweak it to suit your requirement. No XMLPath is used here, on this will paste the sample code next time.
xmlreader.java
File Size: 1 kb
File Type: java
Download File

Powered by Create your own unique website with customizable templates.