Dynamic schema?

I have a schema with a “list” node that can contains only “item” nodes:

schema.nodes.mylist = {
  type: MyList,
  content: 'myitem*'
};

Now depending on some attribute set on a “list” node, i would like to dynamically restrict schema to be

schema.nodes.mylist = {
  type: MyList,
  content: 'myitem[name="title"] myitem[name="description"]'
};

or

schema.nodes.mylist = {
  type: MyList,
  content: 'myitem[name="email"]'
};

and so on.

This way i could tell prosemirror to keep the right items in the right places (impossible to remove or split an item, for example).

The schema language isn’t powerful enough to do it this way. You’ll have to define different list node types, and give them different content.

(Also, I recommend against using myitem* as content in the initial example — empty nodes tend to behave poorly in contentEditable. myitem+ is likely to give better results.)