Saturday, February 5, 2011

XML - namespace

    <!--    "xmlns" This is default namespace consturctor.
            "xmlns:xhtml" This is prefixed, and belongs xhtml.
            "xmlns:my"
    -->


<feed   xlmns="http://www.w3.org/2005/Atom"
        xmlns:xhtml="
http://xml.w3.org/1999/xhtml"
        xmlns:my="hthp://xmlportfolio.com/xmlmyguid-examples">
   

    <title>Example Feed</title>

    <!--
    "right" is an element.
    "type" is attribute.
    "my" can be any word, and makes no difference
    -->


    <right type="xhtml" my:type="silly">
        <xhtml:div>
            You may not read, utter, interpret, or otherwise
            contained in this feed...
        </xhtml:div>
    </right>
</feed>

2 comments:

  1. Testing if java code can be posted:


    package popandpush3_ver02;

    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.BufferedReader;

    public class Main {

    public static void main(String[] args) throws IOException{

    String input;

    int [] answer = new int [2];

    System.out.print("Enter the Postfix equation: ");
    System.out.flush();

    input = getString();
    if(input.equals("")){
    System.out.println("Bye!");
    }
    else{
    InfixEquation infix = new InfixEquation(input);
    input = infix.convert();
    // System.out.print(input);
    PostfixEquation postfix = new PostfixEquation(input);
    answer = postfix.convert();
    if (answer[0] == 0){
    System.out.printf("answer is: %4d\n\n", answer[1]);
    }
    System.out.print("\nstop here for now.\n");
    }
    }

    private static String getString() throws IOException{
    InputStreamReader isr = new InputStreamReader(System.in);
    BufferedReader br = new BufferedReader(isr);
    String s = br.readLine();
    return s;
    }

    }

    ReplyDelete
  2. ummm...
    how come it's not formatted...



    package popandpush3_ver02;

    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.BufferedReader;

    public class Main {

    public static void main(String[] args) throws IOException{

    String input;

    int [] answer = new int [2];

    System.out.print("Enter the Postfix equation: ");
    System.out.flush();

    input = getString();
    if(input.equals("")){
    System.out.println("Bye!");
    }
    else{
    InfixEquation infix = new InfixEquation(input);
    input = infix.convert();
    // System.out.print(input);
    PostfixEquation postfix = new PostfixEquation(input);
    answer = postfix.convert();
    if (answer[0] == 0){
    System.out.printf("answer is: %4d\n\n", answer[1]);
    }
    System.out.print("\nstop here for now.\n");
    }
    }

    private static String getString() throws IOException{
    InputStreamReader isr = new InputStreamReader(System.in);
    BufferedReader br = new BufferedReader(isr);
    String s = br.readLine();
    return s;
    }

    }

    ReplyDelete