Results 1 to 6 of 6

Thread: Entity Referencing

  1. #1
    Join Date
    Jan 2009
    Posts
    66

    Entity Referencing

    Hello, recently I have started to learn about the xml language. And now I want to get some basic information about it. I want to know the Entity referencing. If anyone knows the details then please reply me about it. If anyone is having information about the sources then also provide me that, so that I can read from there.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Entity Referencing

    Basically entity referencing is the reference of the entity with the use of its name which will cause it to be inserted into the document in the place where entity exist. If you want to create the entity reference then your entity name must be surrounded by the ampersand and a semicolon as below:
    &<name of the entity>;

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: Entity Referencing

    Hi, I am not having any type of knowledge about the XML, but while searching on internet I come to know that you can able to get information about the Entity Referencing by the use of the book of Michael Fitzgerald which is having name as Learning XSLT. So, it may be helpful to you to get more basic information about the Entity Referencing and also about the xml basic concepts. So, make use of it.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Entity Referencing

    I have got the basic code about the Entity Referencing and you can simply make use of it for getting more knowledge about it.
    Code:
    package javaxml3;
    
    import java.io.FileInputStream;
    
    import javax.xml.stream.XMLEventReader;
    import javax.xml.stream.XMLInputFactory;
    import javax.xml.stream.XMLStreamConstants;
    import javax.xml.stream.XMLStreamReader;
    import javax.xml.stream.occurs.XMLEvent;
    
    public class EntityRef {
    
        public static void main(String[] args) throws Exception {
            XMLInputFactory IF = XMLInputFactory.newInstance();
            IF.setProperty(XMLInputFactory.IS_COALESCING, Boolean.TRUE);
            IF.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.TRUE);
            
            XMLStreamReader rdr = IF.createXMLStreamReader(new FileInputStream("sample/entity1.xml"));
            System.out.println(rdr.getProperty(XMLInputFactory.IS_COALESCING));
            System.out.println(rdr.getProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES));
            while (rdr.hasNext()) {
                int occur = rdr.next();
                if (occur == XMLStreamConstants.CHARACTERS)
                    System.out.println(rdr.getText());
                else if (occur == XMLStreamConstants.ENTITY_REFERENCE) {
                    System.out.println("en: "+rdr.getLocalName());
                    System.out.println("er: "+rdr.getText());
                }
            }
    
            System.out.println("---------------------");
            IF.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.FALSE);
            
            rdr = IF.createXMLStreamReader(new FileInputStream("sample/entity1.xml"));
            System.out.println(rdr.getProperty(XMLInputFactory.IS_COALESCING));
            System.out.println(rdr.getProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES));
            while (rdr.hasNext()) {
                int occur = rdr.next();
                if (occur == XMLStreamConstants.CHARACTERS)
                    System.out.println(rdr.getText());
                else if (occur == XMLStreamConstants.ENTITY_REFERENCE) {
                    System.out.println("en: "+rdr.getLocalName());
                    System.out.println("er: "+rdr.getText());
                }
            }
        }
    
    }

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Re: Entity Referencing

    You can use differnt books to get the knowledge about the xml. Below are some good books.
    Books for XML:
    • XML Complete by Steven Holzner
    • Presenting XML by Richard Light
    • XML: Extensible Markup Language by Elliotte Rusty Harold
    • XML: Principles, Tools, and Techniques by Dan Connolly
    • The XML Handbook by Charles F. Goldfarb, Paul Prescod

  6. #6
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Entity Referencing

    Syntax:
    Code:
    &<name of the entity>;
    It is the referencing of the entity simply using name of it. If you are using name of it then you will able to insert the reference into the document in place of the entity. So, it will cause simple for you. So, just use the above syntax and get the solution.

Similar Threads

  1. Adding Harvard Ref Style to Referencing - Links Gone
    By LizH78 in forum Windows Software
    Replies: 1
    Last Post: 08-04-2011, 07:35 AM
  2. Changing the entity of a datatype
    By GOOL in forum Software Development
    Replies: 6
    Last Post: 06-01-2011, 08:31 AM
  3. Audit tool referencing required
    By AbhayD in forum Software Development
    Replies: 5
    Last Post: 16-01-2010, 12:13 PM
  4. Cell referencing in VBA
    By Antonio00 in forum MS Office Support
    Replies: 2
    Last Post: 08-02-2008, 11:05 PM
  5. How can I download Harvard Referencing into Word Office 2007?
    By Hayworth in forum Office Update Service
    Replies: 2
    Last Post: 30-04-2007, 11:42 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,750,448,983.71999 seconds with 16 queries